Hello,
I'm developing an EA that needs partial order closing. In the past I've just split the initial order volume into 2 separate orders, but now I'm trying to actually close a part of the trade calculating the amount of lots to be closed. My main question is, the MT4 tester shows anything regarding actual partial closure? I just see in the results tab:
buy/sell
modify
sl/tp
The strategy basically moves SL to BE and then closes half of the position, but I don't see anything regarding the actual partial closure of the trade, does the tester should generate any log for that when a backtest is performed?
Pd. No errors are shown on the logs tab, and the code actually goes through the part where I have the Order Close function.
Regards,
Fernando
- EA based on direction change of moving average
- Backtest and Graph tab don't show anything when testing an EA
- What is wrong with this logic? Trailingstop for half position
In results tab you will see a normal "close" with your partially closed ticket number and the lot size closed.
Just after that you will see a new order that is the order with remained lot size, the one with "#from ....." comment, that will have different ticket number compared to the original order.
Fabio Cavalloni:
Thanks! Just fixed that up, it was a code issue, my dumb ass was dividing a double value by an integer value so the partial closure was always 0. 😂
In results tab you will see a normal "close" with your partially closed ticket number and the lot size closed.
Just after that you will see a new order that is the order with remained lot size, the one with "#from ....." comment, that will have different ticket number compared to the original order.
Fabio Cavalloni: remained lot size, the one with "#from ....." comment,
Broker specific, some do not.
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