Can anyone help re: altering RSI easy-language code

mpi2008

Junior member
Messages
21
Likes
0
Hi, I was wondering if anyone can help me as i'm not a programmer.

I have seen the RSI long/short-entry strategy which comes as part of Tradestation's canned strategies. Code for RSI short-entry is below

inputs: Price( Close ), Length( 9 ), OverBought( 70 ) ;
variables: MyRSI( 0 ) ;

MyRSI = RSI( Price, Length ) ;

if Currentbar > 1 and MyRSI crosses under OverBought then
{ CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
Sell Short ( "RsiSE" ) next bar at market ;

The only problem I have with this is that when I automate this strategy in practice, the RSI often crosses under 70 temporarily during the formation of the current candle and then following the close of the candle is back above 70. However, this doesn't stop tradestation from going short at the open of the next candle. What I would like is for the following:

"IF RSI VALUE < 70 AT 'CLOSE' OF CURRENT CANDLE, SELL SHORT NEXT BAR AT MARKET"

Does anyone know how I would alter the existing code above to accomplish this as I keep getting error messages when I try and modify it.

Many thx

Mark
 
Mark,

Use the following code and I hope it should help!

If Currentbar > 1 and MyRSI crosses under OverBought and MyRSI[1] > Overbought then
Sellshort ( "RsiSE" ) next bar at market ;
check your PM

Cheers
Johnan Prathap
 
Thanks Johnan,

Your code modification has resolved my problem. Thank you very much indeed and I will keep your services in mind for future.

Much obliged

Mark
 
Top