Forum

Opening position on sharp price movement

Hi all, Can someone help me with the below please? I have developed this piece of code, which aims to open a position following a sharp variation in price in a given time-span. If the price rises by at least 550 points in 2 candles, then the robot opens a SELL position. If the price drops by at last

Check if a condition remains true for a given number of bars.

Hi All, Hopefully, someone can help me with the below. I want to check if a condition remains true for a given number of bars . Specifically, I want a MA to keep growing for at least 10 bars, after having crossed a slower MA. If the condition is not met, I want the FOR loop to restart from 0. This

Close order X candles after MAs crossover

Hi, I am running an exercise to close a position 20 candles after a MA Crossover . The code is made of 3 blocks, the 1st to open the trade, the 2nd to count the bars since the last MA crossover, and the 3rd to close the position. This code doesn't work and the position is closed immediately