Start to look for conditions after crossover

Forums ProRealTime English forum ProOrder support Start to look for conditions after crossover

Viewing 6 posts - 1 through 6 (of 6 total)
  • #208741

    Trying to get the algorithm to wait for a crossover between the two moving averages to occur, and then checks the RSI value in the next 5 candles. If the RSI is below 30 in one of those candles, the algorithm generates a buy signal. This way, the algorithm waits for confirmation of the oversold condition before entering a trade. This code do not work it trades on the crossover but the crossover should only indicate the starting point from where it should look at the RSI

     

    #208800
    JS

    Hi @johann,

    Try replacing the For…Next with:

    Direction=0

    If CrossOver=1 and nrsi[0]<30 or nrsi[1]<30 or nrsi[2]<30 or nrsi[3]<30 or nrsi[4]<30 then

    Direction=1

    EndIf

    1 user thanked author for this post.
    #208888

    Thanks JS, will try…

    #208889

    Hi JS, nope unfortunately it does not work. The idea is that the algo should look at the next 5 bars whether the RSI is in oversold territory just after the cross over up of the 20SMA and 30SMA. The trade has to take place within 5 bars after the cross over. If the RSI does not go into oversold territory within the next 5 bars the trade aborts and wait for the next cross over.

    #208902

    Here is a new attempt, store the barindex of the event, then check bars elasped since. Not tested.

    1 user thanked author for this post.
    #208911

    Thank you Nicolas will try your suggestion…

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login