convertir indicateur 2b pattern en stratégie

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #250281 quote
    Ptitlilou87
    Participant
    Average

    Bonjour à tous,

    je souhaiterai transformer un indicateur qui est “2b reversal pattern indicator ”  en stratégie proorder pour voir les résultats sur plusieurs mois.

    Voici le lien de l’indicateur: https://www.prorealcode.com/prorealtime-indicators/2b-reversal-pattern-indicator

    Mais je n’arrive a remplacer les flèches rouges par des sell et les flèches vertes par des buy, quelqu’un peut il me venir en aide?

    Je souhaiterai le faire avec un capital de 100 000€, un risque de 1% par trade, et un sl placé sous la bougie qui casse quand il y à la flèche verte et sur la bougie qui casse quand il y à la flèche rouge.

    Merci par avance.

    Voici le code

    //-------------------------------------------------------------------//
    //PRC_2B Reversarl Pattern
    //version = 0
    //27.06.2024
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-------------------------------------------------------------------//
    //-----Inputs--------------------------------------------------------//
    prd=20
    maxi=10
    mini=3
    src1 = low
    src2 = high
    //-------------------------------------------------------------------//
    //-----Pivot Point Calculation---------------------------------------//
    //-----pivots low
    if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
    pl=low[prd]
    plL=barindex[prd]
    drawpoint(barindex[prd],low[prd],2)coloured("red",90)
    endif
    //-----pivots high
    if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
    ph=high[prd]
    phL=barindex[prd]
    drawpoint(barindex[prd],high[prd],2)coloured("blue",90)
    endif
    //-------------------------------------------------------------------//
    //-----Pattern Detection---------------------------------------------//
    //-----Calculate price level to check breakout down
    if close crosses over ph then
    bomin=low
    bominL=barindex
    drawsegment(phL,ph,bominL,ph)style(dottedline)
    drawpoint(phL,ph,1)coloured("white")
    ph=undefined
    endif
    //-----Calculate price level to check breakout up
    if close crosses under pl then
    bomax=high
    bomaxL=barindex
    drawsegment(plL,pl,bomaxL,pl)style(dottedline)
    drawpoint(plL,pl,1)coloured("white")
    pl=undefined
    endif
    //-----Breakout down confirmation
    atr=averagetruerange[14](close)
    if close crosses under bomin and barindex-bominL<=maxi and barindex-bominL>=mini then
    drawsegment(bominL,bomin,barindex,bomin)coloured(242,54,69)style(line,2)
    drawtext("▼",barindex,high+atr*0.5)coloured(242,54,69)
    bomin=0
    endif
    //-----Breakout up confirmation
    if close crosses over bomax and barindex-bomaxL<=maxi and barindex-bomaxL>=mini then
    drawsegment(bomaxL,bomax,barindex,bomax)coloured(108,229,160)style(line,2)
    drawtext("▲",barindex,low-atr*0.5)coloured(108,229,160)
    bomax=0
    endif
    //-----Restart price level y cross is to late/soon
    if close crosses over bomax then
    bomax=0
    elsif close crosses under bomin then
    bomin=0
    endif
    //-------------------------------------------------------------------//
    return
    #250284 quote
    robertogozzi
    Moderator
    Master

    J’ai déplacé votre demande sur le forum ProOrder, car il s’agit d’une stratégie.

    Il s’agit de l’indicateur modifié de manière à n’imprimer que les flèches ROUGE et VERTE. J’ai également joint le fichier PRC_2B Reversal Pattern(1).itf. :

    //-------------------------------------------------------------------//
    //PRC_2B Reversarl Pattern(1)
    //version = 0
    //27.06.2024
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-------------------------------------------------------------------//
    //-----Inputs--------------------------------------------------------//
    //prd=20
    //maxi=10
    //mini=3
    src1 = low
    src2 = high
    //-------------------------------------------------------------------//
    //-----Pivot Point Calculation---------------------------------------//
    //-----pivots low
    if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
    pl=low[prd]
    plL=barindex[prd]
    //drawpoint(barindex[prd],low[prd],2)coloured("red",90)
    endif
    //-----pivots high
    if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
    ph=high[prd]
    phL=barindex[prd]
    //drawpoint(barindex[prd],high[prd],2)coloured("blue",90)
    endif
    //-------------------------------------------------------------------//
    //-----Pattern Detection---------------------------------------------//
    //-----Calculate price level to check breakout down
    if close crosses over ph then
    bomin=low
    bominL=barindex
    //drawsegment(phL,ph,bominL,ph)style(dottedline)
    //drawpoint(phL,ph,1)coloured("white")
    ph=undefined
    endif
    //-----Calculate price level to check breakout up
    if close crosses under pl then
    bomax=high
    bomaxL=barindex
    //drawsegment(plL,pl,bomaxL,pl)style(dottedline)
    //drawpoint(plL,pl,1)coloured("white")
    pl=undefined
    endif
    //-----Breakout down confirmation
    atr=averagetruerange[14](close)
    if close crosses under bomin and barindex-bominL<=maxi and barindex-bominL>=mini then
    //drawsegment(bominL,bomin,barindex,bomin)coloured(242,54,69)style(line,2)
    drawtext("▼",barindex,high+atr*0.999,dialog,bold,20)coloured("Red")
    bomin=0
    endif
    //-----Breakout up confirmation
    if close crosses over bomax and barindex-bomaxL<=maxi and barindex-bomaxL>=mini then
    //drawsegment(bomaxL,bomax,barindex,bomax)coloured(108,229,160)style(line,2)
    drawtext("▲",barindex,low-atr*0.999,dialog,bold,20)coloured("Green")
    bomax=0
    endif
    //-----Restart price level y cross is to late/soon
    if close crosses over bomax then
    bomax=0
    elsif close crosses under bomin then
    bomin=0
    endif
    //-------------------------------------------------------------------//
    return

    Voici la stratégie que vous avez demandée (avec le code simplement appelé strategie2b.itf) :

    //-------------------------------------------------------------------//
    //PRC_2B Reversarl Pattern
    //version = 0
    //27.06.2024
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-------------------------------------------------------------------//
    //-----Inputs--------------------------------------------------------//
    ONCE Capital = 100000
    ONCE LotSize = 1
    ONCE prd     = 20
    ONCE maxi    = 10
    ONCE mini    = 3
    Risk         = Capital / 100       // 1%  risk
    SL           = Risk / PipValue / PipSize / LotSize
    src1         = low
    src2         = high
    //-------------------------------------------------------------------//
    //-----Pivot Point Calculation---------------------------------------//
    //-----pivots low
    if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
    pl=low[prd]
    plL=barindex[prd]
    //drawpoint(barindex[prd],low[prd],2)coloured("red",90)
    endif
    //-----pivots high
    if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
    ph=high[prd]
    phL=barindex[prd]
    //drawpoint(barindex[prd],high[prd],2)coloured("blue",90)
    endif
    //-------------------------------------------------------------------//
    //-----Pattern Detection---------------------------------------------//
    //-----Calculate price level to check breakout down
    if close crosses over ph then
    bomin=low
    bominL=barindex
    //drawsegment(phL,ph,bominL,ph)style(dottedline)
    //drawpoint(phL,ph,1)coloured("white")
    ph=undefined
    endif
    //-----Calculate price level to check breakout up
    if close crosses under pl then
    bomax=high
    bomaxL=barindex
    //drawsegment(plL,pl,bomaxL,pl)style(dottedline)
    //drawpoint(plL,pl,1)coloured("white")
    pl=undefined
    endif
    //-----Breakout down confirmation
    atr=averagetruerange[14](close)
    if close crosses under bomin and barindex-bominL<=maxi and barindex-bominL>=mini then
    //drawsegment(bominL,bomin,barindex,bomin)coloured(242,54,69)style(line,2)
    //drawtext("▼",barindex,high+atr*0.999,dialog,bold,20)coloured("Red")
    IF Not ShortOnMarket  THEN
    SELLSHORT LotSize CONTRACTS AT MARKET
    StopPrice = high[1] + SL
    SET STOP PRICE StopPrice
    bomin=0
    ENDIF
    endif
    //-----Breakout up confirmation
    if close crosses over bomax and barindex-bomaxL<=maxi and barindex-bomaxL>=mini then
    //drawsegment(bomaxL,bomax,barindex,bomax)coloured(108,229,160)style(line,2)
    //drawtext("▲",barindex,low-atr*0.999,dialog,bold,20)coloured("Green")
    IF Not LongOnMarket  THEN
    BUY LotSize CONTRACTS AT MARKET
    StopPrice = low[1] - SL
    SET STOP PRICE StopPrice
    bomax=0
    ENDIF
    endif
    //-----Restart price level y cross is to late/soon
    if close crosses over bomax then
    bomax=0
    elsif close crosses under bomin then
    bomin=0
    endif
    //-------------------------------------------------------------------//
    //return
    graph        SL
    graphOnPrice StopPrice
    Iván González thanked this post
    PRC_2B-Reversal-Pattern1.itf Strategie2b.itf
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

convertir indicateur 2b pattern en stratégie


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
6 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 09/02/2025
Status: Active
Attachments: 2 files
Logo Logo
Loading...