Backtesting RSI and MA

Forums ProRealTime English forum ProOrder support Backtesting RSI and MA

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

    Hi guys,

    I am trying to figure out how to set up with the following conditions:

    Enter Long position:

    If the RSI crosses under 30 and while the RSI is below 70 and MA9 CROSSES OVER MA21. I have tried with an IF condition with the RSI and if that triggers I want to have the MA9 crosses over the MA21 and only then I want to go long.

    Is it possible to have a system like that and if so Could you please help me with that?

     

    Thanks,

    #162354

    There you go:

    you only need to add SL & TP.

    1 user thanked author for this post.
    #162374

    Hi Robertogozzi,

    Thank you so much for your help.

    This was exactly what I looked for, but what about exiting the long position without the TP and SL, I mean to exit the trade once the RSI is over 70 and the MA9 is crossing under the MA21?

    and if I want to reverse the long to short, I need to need to create a new variable eg. CondS?

    #162387

    To exit long trades, you can append these lines to my code:

    Yes, to support SHORT trades you need to add CondS (and now also ExitS) to which you will have to assign the opposite conditions to both enter and exit trades.

    #162388

    I have the code like this, but it does not allow me to exit the market

     

     

     

     

     

    #162389

    Sorry, I saw the mistake, it was on the line 32, I had sma9 crosses under sma9, it should of been sma9 under sma21

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