top of page
Writer's pictureProRealAlgos

Timing-optimized RSI14 strategy


Don’t go long on fridays? Avoid shorting in December? If you’re not using these timing tricks, you’re leaving money on the table!"


When building a trading strategy the possibilities are limitless, you can add hundreds of different indicators, filters, oscillators, codes and features - but I’ve found that new developers find it hard to know where to start - just because of the fact that there are so MANY possibilities. 


So I’m going to help you get started by guiding you with some simple filters on trading hours, days and seasons.


Here's the code from the simple RSI[14] strategy we developed in the video above. Please note that the strategy is overly optimized.


Backtest report



The ProRealTime™ code

defparam cumulateorders = False
// Conditions to enter long positions
IF NOT LongOnMarket AND RSI[14] < 50 and time > 210000 and time < 230000 and day >= 5 and day <= 31- and dayofweek <> 4 and month <> 8 THEN
BUY 1 CONTRACTS AT MARKET
ENDIF

// Conditions to exit long positions
If LongOnMarket and barindex- tradeindex >= 20 THEN
SELL AT MARKET
ENDIF

// Conditions to enter short positions
IF NOT ShortOnMarket AND RSI[14] > 75 and time > 50000 and time < 90000 and day >= 1 and day <= 28 and dayofweek <> 0 and month <> 10 THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF

// Conditions to exit short positions
IF ShortOnMarket and barindex- tradeindex >= 20  THEN
EXITSHORT AT MARKET
ENDIF

140 views0 comments

Recent Posts

See All

Comments


bottom of page