Hi, I am new to this forum. I have just started to write my own EA.. I have the following codes..
the program is able to execute the position at OrderSend, but is not able to execute the OrderModify commands.. could someone help please?
Many Thanks
First you have to make sure you are entering the trade loop . I assume the code reaches that point.
Then you may have 2 problems :
1.You are trying to adjust the TP and SL at the same time , i've encountered a little broker that did not like that
2.You may be hitting the stop level limit (which is the minimum of how close your stops can be to the live price close price)
MarketInfo(_Symbol, MODE_STOPLEVEL);//this returns it in points if i recall //and SymbolInfoInteger(_Symbol,SYMBOL_TRADE_STOPS_LEVEL);
These will return the value in points so you will have to ((double)value)*_Point to get it in price
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I am new to this forum. I have just started to write my own EA.. I have the following codes..
the program is able to execute the position at OrderSend, but is not able to execute the OrderModify commands.. could someone help please?
Many Thanks