Remplacement de la fonction zigzag dans mon système de trading

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #242465 quote
    ver.chr
    Participant
    New

    Bonjour,

    Je viens de découvrir que la fonction Zigzag provoque une erreur dans mon système de trading, je ne sais pas par quoi la remplacer dans mon code.

    Avez-vous une solution simple pour continuer la détection des pics et des creux utilisée dans la validation séquentielle de mon indicateur maison basé sur MACD?

    Merci d’avance

    #242492 quote
    fifi743
    Participant
    Master

    il y a celui ci

    Zig-Zag Donchian indicator


    ou

    Fractals ZigZag

    Iván González thanked this post
    #242514 quote
    LucasBest
    Participant
    Average
    DEFPARAM DRAWONLASTBARONLY=TRUE
    
    MaxSegments2show=max(0,Segments2show-2) //points top/low back to store
    
    // initialisation
    once LastZigZag = 1
    once ZigZagIndex = 0
    once $ZigZagX[ZigZagIndex]=barindex
    once $ZigZagY[ZigZagIndex]=High
    
    // Variation de prix en fonction de l'ATD et de la déviation standart
    DeltaY=max(7,(AverageTrueRange[period](close)+STD[period](close))*facteur)
    
    // Vague haussière en cours
    if LastZigZag=1 then
    if High>$ZigZagY[ZigZagIndex] then
    $ZigZagY[ZigZagIndex]=High
    $ZigZagX[ZigZagIndex]=barindex
    elsif Low<=($ZigZagY[ZigZagIndex]-DeltaY) then // New ZigZag, changement de vague
    ZigZagIndex=ZigZagIndex+1
    $ZigZagY[ZigZagIndex]=Low
    $ZigZagX[ZigZagIndex]=barindex
    LastZigZag=-1
    endif
    endif
    
    // Vague baissière en cours
    if LastZigZag=-1 then //lastpoint was a low
    if Low<$ZigZagY[ZigZagIndex] then
    $ZigZagY[ZigZagIndex]=low
    $ZigZagX[ZigZagIndex]=barindex
    elsif High>=($ZigZagY[ZigZagIndex]+DeltaY) then // New ZigZag, changement de vague
    ZigZagIndex=ZigZagIndex+1
    $ZigZagY[ZigZagIndex]=High
    $ZigZagX[ZigZagIndex]=barindex
    LastZigZag=1
    endif
    endif
    
    FirstSegment=max(1,ZigZagIndex-MaxSegments2show)
    
    // Zigzag Drawing
    If LastZigZag=1 then
    drawsegment (barindex,Low,$ZigZagX[ZigZagIndex],$ZigZagY[ZigZagIndex]) style(dottedline,2) COLOURED ("tomato",200) //segment in progress
    If ZigZagIndex>1 then
    For i= ZigZagIndex downto FirstSegment do
    If $ZigZagY[i]>$ZigZagY[i-1] then
    drawsegment($ZigZagX[i],$ZigZagY[i],$ZigZagX[i-1],$ZigZagY[i-1]) style(line,2) COLOURED("dodgerblue",200)
    Else
    drawsegment($ZigZagX[i],$ZigZagY[i],$ZigZagX[i-1],$ZigZagY[i-1]) style(line,2) COLOURED("tomato",200)
    Endif
    Next
    Endif
    Endif
    
    If LastZigZag=-1 then
    drawsegment (barindex,High,$ZigZagX[ZigZagIndex],$ZigZagY[ZigZagIndex]) style (dottedline,2) COLOURED ("dodgerblue",200) //segment in progress
    If ZigZagIndex>1 then
    For i= ZigZagIndex downto FirstSegment do
    If $ZigZagY[i]>$ZigZagY[i-1] then
    drawsegment($ZigZagX[i],$ZigZagY[i],$ZigZagX[i-1],$ZigZagY[i-1]) style(line,2) COLOURED("dodgerblue",200)
    Else
    drawsegment($ZigZagX[i],$ZigZagY[i],$ZigZagX[i-1],$ZigZagY[i-1]) style(line,2) COLOURED("tomato",200)
    Endif
    Next
    Endif
    Endif
    
    return
    fifi743 and Iván González thanked this post
    Adaptative-ZigZag.itf
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Remplacement de la fonction zigzag dans mon système de trading


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
ver.chr @ver-chr Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by LucasBest
1 year, 1 month ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 01/12/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...