Fibonacci retrace backtest for PRT – collaboration project

Viewing 11 posts - 46 through 56 (of 56 total)
  • Author
    Posts
  • #19015 quote
    Nicolas
    Keymaster
    Master

    You can get trial and demo account at PRT-CFD website : https://www.prorealcode.com/PRT-CFD-english/

    About Tapatalk, this is something I will consider later. If you have questions about the platform or programming, please open individual topic to let this one dedicated to the Fibonacci retrace project.

    #21989 quote
    GraHal
    Participant
    Master

    Hi Guys

    This project was going so well, we don’t want to waste the good efforts thus far. Be good to get it going again when you’re ready?

    GraHal

    #27117 quote
    ALE
    Moderator
    Master

    Hi guys
    how is going this project?

    #27119 quote
    GraHal
    Participant
    Master

    Hi Ale

    This Project keeps flashing through my mind every few days! Seems its dead in the water at this stage? I keep meaning to check out the code, run it and see how near to working it is. I will do this over the weekend and report back.

    It was Maz who was the inspiration and driving force and seem’s ‘he’s not been around these parts’ for a while? I’m sure Nicolas would find the time to help again if another ‘accomplished coder’ was leading the Project.

    Cheers
    GraHal

    #27121 quote
    GraHal
    Participant
    Master

    Hey Great News! … Maz is ‘alive & kicking’ and last committed on the code 10 days ago on GitHub.

    I’m getting excited again as this code is close to how I trade manually … Elliott Waves / retracements etc. I’m going to read all the posts in this Thread again over the weekend for a fresh re-start!

    GraHal

    #27167 quote
    Maz
    Participant
    Veteran

    Hey guys, yes I am still here but just travelling a lot. On business in puerto rico until second week of March. I will then be able to do some more contributions.

    GraHal thanked this post
    #84347 quote
    Meta Signals Pro
    Participant
    Veteran

    Hi Grahal,

    DId you finally used this script? and of yes with some performances?

    Is Maz gone or on an island? 😉

    #84348 quote
    GraHal
    Participant
    Master

    Wow doesn’t time / life fly by!? 🙂

    @Kris75 no, I’ve not used the script, if I recall correctly … the code never got to a stage where it was usable.  I’m not clever enough at coding to finish it off … might you be??

    Last I heard from @Maz (he emailed me 2-3 months ago) he has been very busy in his day job all through 2018, but is hoping to be back on here at some stage / one day!

    #84349 quote
    Maz
    Participant
    Veteran

    Hi All,

    Just saw the update – yes it has been a while since I had any time to dedicate to this thread / community.

    I did complete that PRT indicator and have it archived. If you’d still find it useful and would like to continue then I can dig it out and post it in the indicator library.

    Best

    M

    #84365 quote
    GraHal
    Participant
    Master

    Yes please @Maz that would be great if you could post the Indicator in the Library.

    If (in Library post) you include a link back to this Thread then it might reignite the collaboration towards an Auto-System based around the indicator, improvements, new versions etc?

    Many Thanks
    GraHal

    #84368 quote
    Meta Signals Pro
    Participant
    Veteran

    Hi Maz,

    What a cool coincidence;-) good to read you;

    Am definitely interested in the final script so is Grahal;-)

    I downloaded the Github code but it did not work as expected on stocks even after modifications (surely missing smthing);

    May I ask you precise questions so we can use your script? Hereunder is the modified script taken from the github project

    https://github.com/publicprtcode/Backtests/blob/master/autofib/FibRetrace(long)-boiler-0.01a

    • I modified the script in order to adapt it to stocks to be sold at progressive levels of the Fibo grid but the selling process does not wait to reach the next levels (see image1) – which is normal as the former level is still trigering the selling order; but how can we create this level selling process?
    • do we need to do smthing with in this part? (line 166)
      • // Re-evaluate price action and current strategy // …
    • I don’t get this part (line 182)
      • //if t236 or t382 or t500 or t618 or t764 then
        endif
    • Did you code the short part?
    • Which screeners would you use to maximize this strategy?

    Thanks a lot

     

     

    // ============================ \
    // Fib Retracement system (long)
    // v 0.01a
    //
    // ============================ /
     
     
    // -------------------------- \
    // Global Settings
    // -------------------------- /
    DEFPARAM PRELOADBARS = 1000
    
    equity = 1000 + strategyprofit
    n= round(equity/close)
    //MaxDrawDownPercentage = 10
    //MaxDrawdown = Equity * (MaxDrawDownPercentage/100)
    //
    //
    //IF OnMarket and ((PositionPrice - low)*CountOfPosition) > MaxDrawDown THEN
    //Quit
    //ENDIF
    
    once positionSize = n
     
    // ================================= \
    // Global indicators commplied inline
    // ================================= /
    rsi14 = rsi[14] // required by RSI Pop
     
    // -------------------------- \
    // RSI-Pop Inidcator
    // -------------------------- /
    once rsipopOS  = 0
    once rsipopOB  = 0
    rsiPop = 0
    if rsi14 < 30 then
    rsipopOS = 1
    elsif rsi14 > 70 then
    rsipopOB = 1
    endif
    if rsipopOS and (rsi14 >= 30) then
    rsipopOS = 0
    rsiPop = 1
    elsif rsipopOB and (rsi14 <= 70) then
    rsipopOB = 0
    rsiPop = -1
    endif
    // - END RSI-Pop ----------------------
     
     
    // --------------------------------- \
    // Auto-Fib (Long) Optimised Indicator
    // Requires RSI-Pop
    // --------------------------------- /
    //fibHigh, fibLow, support, t236, t382, t500, t618, t764, ma20, ma5 = CALL "AutoFib_long"
     
    once maPeriod = 34 // to eventually become dynamic
    once mDD = 150
    once fibSet = 0
    once hH = 0
    once lL = 0
    once cS = 99999
     
    // requreid by AutoFib
    ma20 = Average[maPeriod](Close)
    ma5  = Average[5](Close)
     
    if not fibSet then
    if ma5 crosses over ma20 then
    hH = 0
    cS = 99999
    cbi = barIndex
    else
    if (close > ma20) then
    hH = MAX(hH, High)
    endif
    if (ma5 > ma20) and (open < ma5) then
    cS = MIN(cS, Low)
    endif
    if (ma5 < ma20) and (hH > 0) and (low < cS) then
    spike = (Close<Open and Close-Low > 14) OR (Open<Close and Open-Low > 14)
    //rsiPop = CALL "RSI Pop"(close)
    fibSet = fibSet or rsiPop
    fibSet = fibSet or (((hH-Low) > mDD) and spike)
    if fibSet then
    lL = Lowest[(barIndex-cbi)](Low)
    endif
    endif
    endif
    endif
    if fibSet then
    fV = (ma5 > ma20)
    if fV then
    fibSet = 0
    hH = 0
    lL = 0
    cS = 99999
    //t236 = 0
    //t382 = 0
    //t500 = 0
    //t618 = 0
    //t764 = 0
    endif
    lL = MIN(lL, Low)
    //fibHigh = hH
    fbL = lL
    //support = cS // not needed at the moment
    if not fV then
    // Calculate fib levels
    //hMS = (fibHigh-fbL)
    hMS = (hH-fbL)
    t236 = fbL + hMS * 0.236
    t382 = fbL + hMS * 0.382
    t500 = fbL + hMS * 0.5
    t618 = fbL + hMS * 0.618
    t764 = fbL + hMS * 0.764
    endif
    endif //if fibSet
    // - END Auto-Fib (Long) ----------------------
     
     
    // -------------------------- \
    // System Defaults (do not touch)
    // -------------------------- /
    once currentStrategy = 0
    // -------------------------- \
    // Auto-Fib (Long) Optimised
    // Requires RSI-Pop
    // Strategy Selection
    // -------------------------- /
    if (not onMarket) and fibSet and (close < t236) then
    BUY positionSize CONTRACTS AT t236 STOP
    buyBarIndex     = barIndex + 1
    currentStrategy = 1
    endif
     
    if longOnMarket then
     
    // -- Strategy selections ---
     
    if currentStrategy = 1 then
     
    // exit rules
    if (barIndex-buyBarIndex)>=2 and POSITIONPERF < 0 then
    set target pprofit 1
    endif
     
    if (high > t382) then
    sell round(positionsize/4) contracts at market
    endif
     
    if (high > t500) then
    sell round(positionsize/4) contracts at market
    endif
     
    if (high > t618) then
    sell round(positionsize/4) contracts at market
    endif
     
    if (high > t764) then
    sell at market
    endif
     
    endif
     
    // Re-evaluate price action and current strategy
    // ...
     
    endif
     
     
     
    // debug -----------
    //graph hH as "fibHigh"
    //graph lL
    //graph t236
    //graph Close
    //graph ma20
    //graph ma5
    // ------------------
     
    if t236 or t382 or t500 or t618 or t764 then
    endif
    Image1-1.png Image1-1.png
Viewing 11 posts - 46 through 56 (of 56 total)
  • You must be logged in to reply to this topic.

Fibonacci retrace backtest for PRT – collaboration project


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Maz @eqmaz Participant
Summary

This topic contains 55 replies,
has 6 voices, and was last updated by Meta Signals Pro
7 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/23/2016
Status: Active
Attachments: 20 files
Logo Logo
Loading...