I have actually tried it out but it is only for the fixed pips. I want to open trades after 2 conditions have been met.
Condition 1: Current price is more than 100 pips away from the latest open trade in the loop
Condition 2: Run condition 1 only once when new candle opens
I have tried out a lot of things but some or the other errors are popping up. If the code is correct then it fails to performs when chosen long only or short only positions.