3 Candle Strategy

Viewing 8 posts - 76 through 83 (of 83 total)
  • Author
    Posts
  • #77813 quote
    Vonasi
    Moderator
    Master

    Well by your rule of thumb Vonasi it more or less passes! 🙂

    More or less it passes – but then more rather than less you need enough start capital to fund it and then as it is on a 5 minute chart your back test data is so very limited that you have to take the results as potentially being an over optimised pile of poop! So multiply draw down by 100!

    #77814 quote
    GraHal
    Participant
    Master

    Here you go @Marc 🙂

    //-------------------------------------------------------------------------
    // Main code : Marc 3Bars DJI 5M v1.0
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders = false
    
    TPL = (AverageTrueRange[28]((open+close+low+high)/4))*16
    SLL = (AverageTrueRange[14]((open+close+low+high)/4))*45
    
    TPS = (AverageTrueRange[26]((open+close+low+high)/4))*10
    SLS = (AverageTrueRange[2]((open+close+low+high)/4))*18
     
    //Buy-Condition
    l1 = OPEN[2] > CLOSE[2] AND OPEN[1] > CLOSE[1] AND High[2] > High [1] AND High[1] > High AND Low[2] > Low[1] AND Low[1] > Low AND Close > Close[2]
     
    //Sell-Condition
    s1 = OPEN[2] < CLOSE[2] AND OPEN[1] < CLOSE[1] AND High[2] < High [1] AND High[1] < High AND Low[2] < Low[1] AND Low[1] < Low AND Close < Close[2]
    
     
    //Buy @ open of nextcandle if condition l1 is met
    IF l1 AND Not OnMarket THEN
    BUY 2 SHARES AT MARKET //MarketOrder
    SET STOP   LOSS   SLL
    SET TARGET PROFIT TPL
    ENDIF
     
    //Sell @ open of nextcandle if condition s1 is met
    IF s1 AND Not OnMarket THEN
    SELLSHORT 2 SHARE AT MARKET //MarketOrder
    SET STOP   LOSS   SLS
    SET TARGET PROFIT TPS
    ENDIF
    
    #77832 quote
    Marc
    Participant
    Average

    thank you 🙂 for DJ this looks awesome in my opinion 😉

     

    GraHal thanked this post
    #133746 quote
    Regan2020
    Participant
    Junior
    Hi all, I am being met with the following message when trying to implement my back testing using the above code (a newbie to coding FYI) – ” Syntax Error in assignment” I am sure that its probably something really simple, but any advice would be great,   many thanks
    #133752 quote
    GraHal
    Participant
    Master
    ” Syntax Error in assignment”
    I just copied the code above and pasted  and backtested and I don’t get any syntax error. Try copying and pasting the code again and let us know. Attachments are with Spread = 4 and 3 min TF.
    #133773 quote
    Regan2020
    Participant
    Junior
    Thank you, I have re-run the code and its now working. However, I noticed that you Back-tested it on DJI, so I followed suit, but my back test results were different to yours (please see attached screen shot) Why set-up was a 3 minute timeframe with a 4 spread – but came back with far more results at a much higher loss?
    #133778 quote
    GraHal
    Participant
    Master
    You backtested on a $10 contract for 1,000 bars. I backtested on a £1 contract for 10,000 bars. Re far more trades … I suspect you have below?
    DEFPARAM CumulateOrders = True
    I have below, same as the code I posted above  …
    DEFPARAM CumulateOrders = false
    #133884 quote
    Regan2020
    Participant
    Junior
    Many thanks, seems to be working now.
    GraHal thanked this post
Viewing 8 posts - 76 through 83 (of 83 total)
  • You must be logged in to reply to this topic.

3 Candle Strategy


ProOrder support

New Reply
Author
author-avatar
Marc @mast83 Participant
Summary

This topic contains 82 replies,
has 6 voices, and was last updated by Regan2020
5 years, 8 months ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 07/25/2018
Status: Active
Attachments: 23 files
Logo Logo
Loading...