‘Daxophone’ 5m (v1)

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #167374 quote
    borderlineJim
    Participant
    Senior

    Greetings to the ProRealCode community!

    This system was made for fun and practice as I am new to programming.  It is very straightforward, using multiple time-frames and indicators to filter trades which are launched from the 5m timeframe.

    This system is purely experimental and probably curve fitted to a large extent. However, I did try to optimize some of the variables and I performed a number walk-forward tests.  It was fun playing with different indicators and using the WF tool!

    DEFPARAM CUMULATEORDERS = false
    
    // Prevents the system from creating new orders to enter the market or increase position size before the specified time
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Prevents the system from placing new orders to enter the market or increase position size after the specified time
    noEntryAfterTime = 183000
    timeEnterAfter = time < noEntryAfterTime
    
    // Prevents the system from placing new orders on specified days of the week
    daysForbiddenEntry = OpenDayOfWeek = 5 OR OpenDayOfWeek = 2
    
    
    //Establish a trend on a higher timeframe - 4hr
    timeframe(4 hour,updateonclose)
    MA24 = average[5]
    Rplse1 = Repulse[5](close)
    
    c2 = close > MA24
    c3 = Rplse > 0
    c5 = close < MA24
    c6 = Rplse < 0
    c7 = Rplse1 > 0
    c8 = Rplse1 < 0
    
    //Filter a trend on a medium timeframe - 1hr
    timeframe (1 hour, updateonclose)
    Rplse = Repulse[5](close)
    MA20 = average[20]
    
    cA = MA20 < close
    cB = MA20 > close
    cC = RocnRoll(close) < 2 and RocnRoll(close) > -1
    cD = RocnRoll(close) > 1 
    
    exitL1 = RSI[14](close)> 80
    exitS1 = RSI[14](close)< 20
    
    //These conditions nested together establish direction of the trend.  The system will only trade in the direction of trend
    bullT = (c2 AND c3 AND cA AND c7 and cC)
    bearT = (c5 AND c6 AND cB AND c8 and cD)
    
    //This is the timeframe from which entry signals will be activated
    timeframe(5 minute, default)
    
    //buy entry conditions
    buyC =  Repulse[5](close) crosses over 0
    IF bullT AND buyC AND (timeEnterBefore AND timeEnterAfter AND NOT daysForbiddenEntry) THEN
    buy at market
    set stop trailing AverageTrueRange[14](close)*3.5
    ENDIF
    
    // Conditions to exit long positions
    ExitL = RocnRoll(close) > 1 and RocnRoll(close) < 1
    
    IF ExitL or exitl1 THEN
    SELL AT MARKET
    ENDIF
    
    //sell entry conditions
    sellC =  Repulse[5](close) crosses under 0
    IF bearT AND sellC AND (timeEnterBefore AND timeEnterAfter AND NOT daysForbiddenEntry) THEN
    sellshort at market
    set stop trailing AverageTrueRange[14](close)*3.5
    endif
    
    //conditions to exit short positions
    ExitS = RocnRoll(close) < 2
    
    IF ExitS or exits1 THEN
    exitshort at market
    ENDIF

     

    Thanks everyone

    J

    Nicolas and Midlanddave thanked this post
    Detailed-report.png Detailed-report.png Detailed-report1.png Detailed-report1.png
    #167415 quote
    GraHal
    Participant
    Master

    Line 55 condition will never be true?

    ExitL = RocnRoll(close) > 1 and RocnRoll(close) < 1
    #167444 quote
    borderlineJim
    Participant
    Senior

    I have tested it when ‘true’ and it seems to make a huge difference to the gain.  Seemed a bit unrealistic though.

    Apologies if much of the code is not correct.  I genuinely have no idea apart from the most basic programming.  This is merely for fun and learning.

    #167445 quote
    borderlineJim
    Participant
    Senior

    tested over 100k candles, don’t have access to 200k unfortunately 🙁

    equity-curve.png equity-curve.png
    #167449 quote
    Francesco
    Participant
    Veteran

    1M Backtest attached

    borderlineJim thanked this post
    1-1.png 1-1.png
    #167456 quote
    borderlineJim
    Participant
    Senior

    is that a 1 million back-test???

    #167464 quote
    Francesco
    Participant
    Veteran

    is that a 1 million back-test???

    Yes it is; v11 PRT Premium allows it

    borderlineJim thanked this post
    #167484 quote
    borderlineJim
    Participant
    Senior

    that’s amazing…. I thought the maximum was 200k! Do you think that optimizing on over 1 million candles is too much?

    #167486 quote
    Francesco
    Participant
    Veteran

    I asked myself the same question, here’s the topic: https://www.prorealcode.com/topic/1m-backtest-available-how-do-you-manage-it/

    Anyway in a general understanding i think it’s pretty much useless rn; but could be very helpful in low timeframe systems (<1m)

    #167490 quote
    GraHal
    Participant
    Master

    have tested it when ‘true’ and it seems to make a huge difference to the gain.

    True means a condition is met and using ‘GRAPH condition’ would result in a ‘1’ on a Chart.

    Below can never be True / 1 because how can RocnRol be both > 1 and < 1 at the same time?

    The condition below is doing nothing in your strategy.

    When you say above “have tested it when ‘true’ and it seems to make a huge difference to the gain.” then you must have made a change that made ExitL = True / 1, for example used OR instead of AND,  or changed values for RocnRol etc?

    GRAPH ExitL below as it is written in your strategy (using AND) and you will see a straight line at 0?

    Sorry to labour the point, but I’m hoping it helps you and others understand about True and False and use of GRAPH?

    ExitL = RocnRoll(close) > 1 and RocnRoll(close) < 1
    borderlineJim thanked this post
    #167496 quote
    robertogozzi
    Moderator
    Legend

    Yes GraHal, but it works no matter what owing to line 37, so they are likely not to care much.

    #167505 quote
    GraHal
    Participant
    Master

    Ah but they will care when a similar faux pas doesn’t execute trades and they hopefully will think … what was GraHal on about re True and False!? 🙂

    #167533 quote
    borderlineJim
    Participant
    Senior

    thanks Grahal!

    You are right, it should have been ‘OR’ instead of ‘AND’

    GraHal thanked this post
Viewing 13 posts - 1 through 13 (of 13 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

‘Daxophone’ 5m (v1)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 12 replies,
has 4 voices, and was last updated by borderlineJim
5 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/18/2021
Status: Active
Attachments: 3 files
Logo Logo
Loading...