hedging problem
-
Hi, I want to create a hedging robot. when price goes againts the trade. it will open opposite trade
example
if first trade open buy lot 0.01 . price goes down 10 pips. it will open sell lot 0.01 . if price goes down another 10 pips, it will open another sell lot 0.01 and vice versa.Also when price go up again 10 pips from initial price open ,it will open buy lot 0.01 every 10 pips until it reach targeted profit and will close all trade.
.
I am half thru the process but the problem is in the image. where robot open many layer around the second sell entry. i want the robot to open new entry every 10 pips
how to fix this. thanks.
here the link project

-
no one can help?

-
I looked several times to figure out what wrong here brother... I couldn't. Sell trades comes from the buy side logic. the issue must be there.
-
after a long fix and error. I manage to get what I want. here is the block for future other users reference


here is the result. price open exactly what I want.

-

full block for buy and sell