Code will not Optimise!!??

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #73793 quote
    GraHal
    Participant
    Master

    Weirdest thing out, must be a simple answer I am missing surely?

    Code below runs fine on DJI, results attached.

    Try and optimise any value and results are ZERO!

    Please try maperiod first as maybe maperiod is the weird one and that is screwing all the others??

    Tell me what I’m missing please … to preserve my sanity and stop me shouting at the wife! 🙂

    DEFPARAM CUMULATEORDERS = False
    //INDICATOR
    IBS = (Close-Low) / (HIGH-LOW) * 100
    RSI2 = RSI[2](close)
    MA = average[maperiod](close)
    
    //CONTRACTSIZE
    X = 1
    
    //MOVING AVERAGE PERIOD
    maperiod = 144
    
    //SIGNAL
    IBSLONGTRIGGER = 50
    IBSSHORTTRIGGER = 50
    
    RSILONGTRIGGER = 10
    RSILONGEXIT = 80
    RSISHORTTRIGGER = 90
    RSISHORTEXIT = 20
    
    //ENTRY CONDITION
    l1 = NOT LongOnMarket
    l1 = l1 and IBS > IBSLONGTRIGGER
    l1 = IBS[1] < IBSLONGTRIGGER[1]
    l1 = l1 and RSI2 > RSILONGTRIGGER
    l1 = RSI2[1] < RSILONGTRIGGER[1]
    l1 = l1 and low[1] > MA
    
    b1 = NOT ShortOnMarket
    b1 = b1 and IBS < IBSSHORTTRIGGER
    b1 = IBS[1] > IBSSHORTTRIGGER[1]
    b1 = b1 and RSI2 < RSISHORTTRIGGER
    b1 = RSI2[1] > RSISHORTTRIGGER[1]
    b1 = b1 and high [1] < MA
    
    //EXIT CONDITION
    l2 = LongOnMarket
    l2 = RSI2 > RSILONGEXIT
    
    b2 = ShortOnMarket
    b2 = RSI2 < RSISHORTEXIT
    
    //LONG ENTRY
    IF l1 THEN
    BUY X CONTRACTS AT MARKET NextBarOpen
    ENDIF
    
    //LONG EXIT
    If l2 THEN
    SELL X CONTRACTS AT MARKET NextBarOpen
    ENDIF
    
    //SHORT ENTRY
    IF b1 THEN
    SELLSHORT X CONTRACTS AT MARKET NextBarOpen
    ENDIF
    
    //SHORT EXIT
    IF b2 THEN
    EXITSHORT AT MARKET NextBarOpen
    ENDIF
    
    Weird-1.jpg Weird-1.jpg Weird-2.jpg Weird-2.jpg weird-4.jpg weird-4.jpg weird-5.jpg weird-5.jpg
    #73804 quote
    robertogozzi
    Moderator
    Master

    Move line 11

    maperiod = A //144

    between lines 4 and 5, BEFORE the average is referred to!

    #73805 quote
    GraHal
    Participant
    Master

    Aha thank you Roberto … as always!

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

Code will not Optimise!!??


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

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