RSI on CAC40 ?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #73735 quote
    JR1976JR1976
    Participant
    Veteran

    I would shares my strategy  ….  could be interest a test with 200k  bar

    //-------------------------------------------------------------------------
    // Codice principale : RSI2P_LarryConnors_4h
    //
    //   CAC40 mini    TF  4 h
    //-------------------------------------------------------------------------
    ////////////////RSI2p CAC40  /////////////////////////////////
    
    DEFPARAM CUMULATEORDERS =  true
    //defparam  FLATBEFORE = 080000
    endtime = 210000
    
    starttime = 045500
    
    
    //n = 4  // mettre ce que vous voulez
    Reinvest=0
    if reinvest then
    //Capital = 10000
    Capital = 5000
    //Risk = 1//in % pr position
    Risk = 3//0.1//in % pr position
    StopLoss = 48
    //StopLoss = 70
    REM Calculate contracts
    equity = Capital + StrategyProfit
    maxrisk = round(equity*(Risk/100))
    MAXpositionsize=5000
    //MINpositionsize=1
    MINpositionsize=1
    Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(round((maxrisk/StopLoss)))))//*Pointsize))))
    else
    Positionsize=1
    StopLoss = 48
    //StopLoss = 70
    Endif
    n = positionsize
    //positive = Dclose(1) > Dopen(1)
    inside  = low > low[1] and high <high[1]
    
    /// moltiplicatore
    x1 = n+1
    
    // INDICATEURS
    MM200 = average[100](close)
    //MM10 = average[10](close)
    //MM20 = average[20](close)
    
    //MM5 = average[5](close)
    RSI2 = RSI[2](close)
    // NEW  only for short high > bbup
    ///////////////
    ha1 = high > BollingerUP[20]
    //low100 = low > MM200+5
    //////////////////
    //GAP
    gap = open < low[1]
    /////
    // ACHAT
    //ca1 = close > MM200
    
    ca2 = RSI2 < 10
    
    if currentdayofweek < 5 then
    if CurrentMonth <> 8 then
    
    if  time > starttime and time < endtime then
    if not GAP then
    IF  ca2   and not inside AND Currentmonth < 5  then
    BUY x1 shares at high stop
    //reversal = 0
    ELSE
    IF  ca2     and not inside then
    BUY n shares at   high stop
    
    //reversal = 0
    ENDIF
    endif
    endif
    endif
    endif
    endif
    
    
    
    
    //  --- SHORT
    
    cv1 = close < MM200
    cv2 = RSI2 > 90
    //IF cv1 and cv2 THEN
    //SELLSHORT n shares at market
    //ENDIF
    //if CurrentdayOfWeek < 3 then
    if time > starttime and time < endtime then
    IF cv1 and  cv2 and ha1  and not inside   THEN
    //IF cv1 and  cv2  THEN
    SELLSHORT n shares at low  stop
    //reversal = 0
    ENDIF
    endif
    
    
    
    //Stop loss utileper AUD/USD
    SET STOP %LOSS 2.9
    
    
    SET Target %profit 0.7  // 1.2  - 1.9
    //***************************************************************************************
    trailingstart =  5 //3,14   trailing will start @trailinstart points profit
    trailingstep  = 1      //1     trailing step to move the "stoploss"
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    ///   ------------------------
    
    Nicolas thanked this post
    RSIcac-prorealcode.png RSIcac-prorealcode.png
    #74434 quote
    JR1976JR1976
    Participant
    Veteran

    SOmeone has a possibility to test with more  history  in the past  ?

    Thanks

    #74438 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This is with 200k history.

    JR1976 thanked this post
    x-7.jpg x-7.jpg
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

RSI on CAC40 ?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
JR1976 @jr1976 Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/20/2018
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...