Morning inversion of Ftsemib with RSI and previous day body size filter.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29297 quote
    Francesco78
    Participant
    Master

    Hello, I just started practicing with prorealtime automatic trading. It is great to have discovered this community.

    I wanted to show you a somehow interesting strategy based on taking the opposite direction of previous day in the morning between 09:00 and 09:30 on Ftse mib.

    I then add some filter in order to avoid taking the position in an overbought or oversold environment unless there is a momentum defined by the positive or negative local derivative of RSI.

    Furthermore I added a filter based on the size of the body of the previous day candle.

    Will be great if you tell me what you think about it.

    Ciao

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    timeenter = time = 090000
    timeexit = time = 093000
    b = 175
    size = 5
    // Conditions to enter long positions
    c1 = (DClose(1) <= DOpen(1)-b)
    
    indicator1 = RSI[14](close)
    c3 = (indicator1[1] < 60)
    c4 = (indicator1[1] > 40)
    c5 = (indicator1[1] > indicator1[2])
    c6 = (indicator1[1] < indicator1[2])
    
    c7 = c3 OR c5
    c8 = c4 OR c6
    
    IF c1 AND c7 AND timeenter THEN
    BUY size PERPOINT AT MARKET
    ENDIF
    
    if longonmarket AND timeexit THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    c2 = (DClose(1) >= DOpen(1)+b)
    
    IF c2 AND c8 AND timeenter THEN
    SELLSHORT size PERPOINT AT MARKET
    ENDIF
    if shortonmarket AND timeexit THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    SET STOP pLOSS 300
    proreal-149010167484cpl1.jpg proreal-149010167484cpl1.jpg
    #29982 quote
    Nicolas
    Keymaster
    Master

    Hi Francesco, are you sure you included the spread in your own tests? I did 200k bars backtest with 1.5 spread on MIB40 1€/point and I do not get the same result as you?

    MIB40-trading-strategy-backtest.png MIB40-trading-strategy-backtest.png
    #31544 quote
    Francesco78
    Participant
    Master

    Hi Nicolas, I just saw your answer, sorry, yes I included the spread, I re run it and I got results similar to my first test. What I find weird is  that on my platform, 100,000 half an hour candles go back to Apr 2015, while I see that yours 200,000 candles go back much further than double mine.

    Anyway I have just posted a refined version of this code on the forum. Would be great if you could have a look to that as well.

    #31545 quote
    Francesco78
    Participant
    Master

    Pls also note that I did the backtest in tick by tick mode.

    Regards

    Francesco

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Morning inversion of Ftsemib with RSI and previous day body size filter.


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Francesco78
8 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/21/2017
Status: Active
Attachments: 2 files
Logo Logo
Loading...