ZIGZAG autotrading

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #40480 quote
    Kenneth Kvistad
    Participant
    Senior

    Anybody who knows if a zigzag system works for autotrading. I used the code in the PRT trading manual and it gives 100%win every time and on every TF?

     

    myZigZag = ZigZag[10]
     c11 = (myZigZag > myZigZag[1])
     c12 = (myZigZag < myZigZag[1]) 
    IF c11 AND NOT LONGONMARKET THEN  
     BUY 1 SHARES AT MARKET
     ENDIF 
    IF c12 AND NOT SHORTONMARKET THEN   
    SELLSHORT 1 SHARES AT MARKET 
    ENDIF
    ZIGZAG.jpg ZIGZAG.jpg
    #40496 quote
    GraHal
    Participant
    Master

    Haha if only!? Zig Zag ‘repaints’ I think? Also I’m sure the ZigZag is not allowed in Live Trading (due to repaint), but I could be wrong? I’m sure Nicolas will be along shortly to advise.

    There is an Indicator in this site Library that works similar to the default PRT Zig Zag but no repaint.

    https://www.prorealcode.com/prorealtime-indicators/fractals-zigzag/

    And below will save Nicolas repeating himself! 🙂 …

    https://www.prorealcode.com/topic/zig-zag-trader-strategy/

    #40497 quote
    Kenneth Kvistad
    Participant
    Senior

    hehe:) yes I tought it would be too easy.
    PRT did not acsept zigzag code it says.

    But another question, evan if it repaints. Would it not be possible to trade the repaints manually? I just looked at the PRT code in backtest and saw it would migth be possible?

    #40502 quote
    GraHal
    Participant
    Master

    Yeah I think I tried it! I try everything! 🙂 … but if I recall correctly you kinda have to predict if it’s going to zig or zag next! HAHAHHAH

    I’ll take another look tomorrow and report back.

    #40505 quote
    Nicolas
    Keymaster
    Master

    Topic moved to ProOrder support forum.

    ZigZag is not allowed in automatic trading actually, but it could be with the new data engine to come (information still to confirm).

    #40507 quote
    Kenneth Kvistad
    Participant
    Senior

    Grahal: I was looking at the brent crude 5min chart yesterday with the zigzag code and setting/adjusted to myzigzag=zigzag[1] so it gave many signals.

    Signals came short and long and so on many times without drawing arrows(probacktest buy/short signals) but evan if it did so I think it would be proffitable to just follow it and have a 10pip stop or so everytime.

    I will have a look after work today aswell Grahal.

    #40577 quote
    GraHal
    Participant
    Master

    Hi Ken

    I did a few manual trades (with profit) on 1 Min TF using the default PRT Zig Zag. It helps, but you also have to judge market structure etc else you get whip-sawed when price is ranging.  When you look back of course Zig Zag appears the perfect Indicator due to repaint.

    Then I thought .. what’s the point as Zig Zag can’t be used on a Auto-Trade anyway?

    Sooo I spent hours  on various instruments and various TFs with Nicolas Fractals Zig Zag (link above in #40496 ) but even with ‘cp’ same value as the Indicator, Bot trades don’t align with markers on the Indicator. See green vertical dotted lines on attached. I’m sure there’s some simple explanation or tweak required? Nicolas may help us when he passes by! 🙂

    As you can see from the results attached there is scope for Fractals Zig Zag as a basis for a Bot?

    //https://www.prorealcode.com/prorealtime-indicators/fractals-zigzag/
    
    DEFPARAM CUMULATEORDERS = FALSE
    
    //---external parameters
    cp = cp
     
     
    if high[cp] >= highest[2*cp+1](high) then
    LH = 1
    else
    LH = 0
    endif
     
    if low[cp] <= lowest[2*cp+1](low)  then
    LL = -1
    else
    LL = 0
    endif
     
    if LL = -1 then
    Buy 1 Contract at Market
    endif
     
    if LH = 1 then
    SellShort 1 Contract at Market
    endif
     
    
    KenKV.jpg KenKV.jpg
    #40581 quote
    GraHal
    Participant
    Master

    I also made a Bot out of Nicolas Fractal Screener, results attached and code attached.

    Note that rise in equity curve early on and then flattened out. If I optimise over the most recent 10000 bars I can get a good equity rise so a regular / periodic optimisation (every month or so) would result in an upward equity curve over the full 100,000 bars I reckon!?

    GraHal

    PS Ideal one to do a WF optimisation on … results attached, but doesn’t make a massive difference! 🙂

    KenKV2.jpg KenKV2.jpg Fractals-DAX-30M.itf KenKV3.jpg KenKV3.jpg
    #40587 quote
    GraHal
    Participant
    Master

    When I looked closer, there was a £900 increase on above equity curve using WF optimisation over 5 periods and 100,000 bars.

    Attached are WF Opti over the most recent 10,000 bars, note how the variables value change drastically in the last period?

    In 1st sample period (Aug 16 – Jan 17)        lb = 2,  p = 18
    In 5th sample period (Jan 17 – Jun 17)       lb = 14, p = 2

    Anyone (to get discussion going! 🙂 )  … comments appreciated.

    GraHal

    Kenkv4.jpg Kenkv4.jpg
    #40599 quote
    Kenneth Kvistad
    Participant
    Senior

    I dont know how fractal ziigzag from nicolas works, never tried it(dident have the chance today).

    But it seems like the markings are lagging vs the trading order ,I do agree this is a better question for Nicolas:)

    When you traded manually today you used 1 min tf. I guess there will be many/ more signals then compare to the 5 min I have checked.(not too much yet).

    But a friend of mine used it and gained some cash on it.

    He told me that he only used the green arrows and not the other colours that appared as false signals. (Sorry but I cant confirm this myself).

    #40726 quote
    Kenneth Kvistad
    Participant
    Senior

    The zigzag code shared made way to many orders for my taste.

    I was also looking at the initial zigzag code and could not trade too well with it. 🙁

    #40755 quote
    Nicolas
    Keymaster
    Master

    The fractal zigzag codes is not repainting, so that’s why you get the peak and trough later. Nobody will never know in advance if the market is in a peak formation or in trough one.

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

ZIGZAG autotrading


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 11 replies,
has 3 voices, and was last updated by Nicolas
8 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/12/2017
Status: Active
Attachments: 6 files
Logo Logo
Loading...