top of page

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

 
 
 

Commenti


Try the products free for 7 days

Easy setup • full version • get-started support

ProRealTime made easy

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. On average 74% of retail investor accounts lose money when trading CFDs. Past performance is no guarantee of future results. You should consider whether you understand how CFDs work before starting.

Read full terms and conditions

ProRealTime™ is a trademark registered by the third-party entity ProRealTime SAS

We have no link with the ProRealTime™ entity that offers the ProRealTime™ trading software

Copyright ProRealAlgos 580648-4231
Harju maakond, Tallinn, Kesklinna linnaosa, Pille 13, 10173

bottom of page