My trade has been dissabled

Back to topics list To post a new topic, please log in or register
avatar
66
macpee 2016.04.11 12:23
 
I tried to execute a transaction to open a pending order on the SGDJPY, but the terminal returned an error "Trade is disabled". I checked the market watch and realized that the currency pair in question has been removed therein. I want to program my EA not to execute any transaction on disabled trade. I tried the IsTradeAllowed() but it did not work. Any help please. Thank you in advance.
avatar
66
macpee 2016.04.11 12:37 #
 
In fact I guess that trade is not disabled for the pair SGDJPY. It is not just listed on the market watch. But again the chart window is open (I must have opened it sometime earlier) from the market watch of course. I think the function I need is the one to indicate whether SGDJPY exists in the market watch, and avoid trading it if it does not exist. Somebody can help here.
avatar
1215
FMIC 2016.04.11 12:43 #
 

In the earlier days of my coding, I had on many previous occasions had both the "IsTradeAllowed()" and the "IsTradeContextBusy()" not report correctly about the state of a symbol.

So I ended up, just keeping track of Error codes when executing trade functions and have the EA react accordingly if the Error persisted.

Has anyone else also had this kind of misbehavior with these functions? Or maybe a solution to have them report correctly?

avatar
1215
FMIC 2016.04.11 12:48 #
 
macpee:
In fact I guess that trade is not disabled for the pair SGDJPY. It is not just listed on the market watch. But again the chart window is open (I must have opened it sometime earlier) from the market watch of course. I think the function I need is the one to indicate whether SGDJPY exists in the market watch, and avoid trading it if it does not exist. Somebody can help here.
Maybe use some of the "Symbol...()" functions? https://docs.mql4.com/marketinformation
avatar
2017
gooly 2016.04.11 12:55 #
 
macpee:
I tried to execute a transaction to open a pending order on the SGDJPY, but the terminal returned an error "Trade is disabled". I checked the market watch and realized that the currency pair in question has been removed therein. I want to program my EA not to execute any transaction on disabled trade. I tried the IsTradeAllowed() but it did not work. Any help please. Thank you in advance.
Maybe you logged in using the Investor-password instead of the other one?
avatar
Moderator
3206
angevoyageur 2016.04.11 13:13 #
 
macpee:
I tried to execute a transaction to open a pending order on the SGDJPY, but the terminal returned an error "Trade is disabled". I checked the market watch and realized that the currency pair in question has been removed therein. I want to program my EA not to execute any transaction on disabled trade. I tried the IsTradeAllowed() but it did not work. Any help please. Thank you in advance.

If the error is 133 "Trade is disabled", that means the broker disabled trading on this symbol.

You can check that with something like :

         if(SymbolInfoInteger(Symbol(),SYMBOL_TRADE_MODE)==SYMBOL_TRADE_MODE_DISABLED)
            return;

avatar
66
macpee 2016.04.11 14:01 #
 
Thank you all, I will take the right action from what you have all suggested.
Back to topics list  

To add comments, please log in or register