The robot I work on opens multiple deals about the same price, I want to stop repeating trades from the same point. For example, if the price of 1.200 opens only one transaction regardless of its type, and continues until the condition is met again and opens one deal at the new price.
Question 2: I want to determine the maximum spread not exceeding 2 cents to open transactions, I wrote the condition as follows without benefit if (MarketInfo (Symbol), MODE_SPREAD) P> MaxSpread && MaxSpread! = 0) return; How this problem is resolved. Please help me quickly and thank you very much
- coding help
- Sleep code
- EA opening multiple trades after a condition is met
We can't help you if you don't show the relevant code
MarketInfo( _Symbol, MODE_SPREAD)
Question 1 : just a simple bool variable that you set to true when you open an order and to false when the order is closed.
ionone: just a simple bool variable that you set to true when you open an order and to false when the order is closed.
| EAs must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required. |
i think this code can help you ^^
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