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.
- Limit Trade / Orders On Each Pair
- How to make EA to check MT4 Expert Advisors option 'Disable experts when the profile has been changed"
- How to disable to market order
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.
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?
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
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.
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?
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.
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.
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;
Thank you all, I will take the right action from what you have all suggested.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register