I think the answer is highly related to this post but I amnot sure how to incorporate these equations ( especially they are in the picture format and include special characters) and I am not a mathematician.
https://www.mql5.com/en/forum/279448/page10#comment_8704870

Any great idea about HEDGING positions welcome here
- 2018.09.17
- www.mql5.com
i am a professional trader that have been in the marketplace since 9 years ago...

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
Hi, My EA is opening a grid of sell orders when the price goes down, and a grid of buy orders when the price goes up. I need to calculate the last ( current) order so that if pair goes to an input price, the whole cycle will achieve break even.
I wrote a function for that but it seems not working correct.
I used excel to prove if it is working correct or not. It seems it is wrong.
Example:
I have 4 sell orders opened on a grid every 10 pips:
1- 0.1 lot at 1.1200
2-0.2 lot at 1.1190
3-0.3 lot at 1.1180
4-0.4 lot at 1.1170
Now the EA wants to open the 5th order at 1.1160 and needs to calculate the sizing of the fifth so that if price goes to 1.1180, the whole cycle profit = 0
Please help