convertir indicateur 2b pattern en stratégie
Forums › ProRealTime forum Français › Support ProOrder › convertir indicateur 2b pattern en stratégie
- This topic has 1 reply, 2 voices, and was last updated 4 days ago by
robertogozzi.
-
-
09/02/2025 at 4:29 PM #250281
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
2b pattern123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566//-------------------------------------------------------------------////PRC_2B Reversarl Pattern//version = 0//27.06.2024//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-------------------------------------------------------------------////-----Inputs--------------------------------------------------------//prd=20maxi=10mini=3src1 = lowsrc2 = high//-------------------------------------------------------------------////-----Pivot Point Calculation---------------------------------------////-----pivots lowif src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] thenpl=low[prd]plL=barindex[prd]drawpoint(barindex[prd],low[prd],2)coloured("red",90)endif//-----pivots highif src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] thenph=high[prd]phL=barindex[prd]drawpoint(barindex[prd],high[prd],2)coloured("blue",90)endif//-------------------------------------------------------------------////-----Pattern Detection---------------------------------------------////-----Calculate price level to check breakout downif close crosses over ph thenbomin=lowbominL=barindexdrawsegment(phL,ph,bominL,ph)style(dottedline)drawpoint(phL,ph,1)coloured("white")ph=undefinedendif//-----Calculate price level to check breakout upif close crosses under pl thenbomax=highbomaxL=barindexdrawsegment(plL,pl,bomaxL,pl)style(dottedline)drawpoint(plL,pl,1)coloured("white")pl=undefinedendif//-----Breakout down confirmationatr=averagetruerange[14](close)if close crosses under bomin and barindex-bominL<=maxi and barindex-bominL>=mini thendrawsegment(bominL,bomin,barindex,bomin)coloured(242,54,69)style(line,2)drawtext("▼",barindex,high+atr*0.5)coloured(242,54,69)bomin=0endif//-----Breakout up confirmationif close crosses over bomax and barindex-bomaxL<=maxi and barindex-bomaxL>=mini thendrawsegment(bomaxL,bomax,barindex,bomax)coloured(108,229,160)style(line,2)drawtext("▲",barindex,low-atr*0.5)coloured(108,229,160)bomax=0endif//-----Restart price level y cross is to late/soonif close crosses over bomax thenbomax=0elsif close crosses under bomin thenbomin=0endif//-------------------------------------------------------------------//return09/02/2025 at 5:38 PM #250284J’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. :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566//-------------------------------------------------------------------////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=3src1 = lowsrc2 = high//-------------------------------------------------------------------////-----Pivot Point Calculation---------------------------------------////-----pivots lowif src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] thenpl=low[prd]plL=barindex[prd]//drawpoint(barindex[prd],low[prd],2)coloured("red",90)endif//-----pivots highif src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] thenph=high[prd]phL=barindex[prd]//drawpoint(barindex[prd],high[prd],2)coloured("blue",90)endif//-------------------------------------------------------------------////-----Pattern Detection---------------------------------------------////-----Calculate price level to check breakout downif close crosses over ph thenbomin=lowbominL=barindex//drawsegment(phL,ph,bominL,ph)style(dottedline)//drawpoint(phL,ph,1)coloured("white")ph=undefinedendif//-----Calculate price level to check breakout upif close crosses under pl thenbomax=highbomaxL=barindex//drawsegment(plL,pl,bomaxL,pl)style(dottedline)//drawpoint(plL,pl,1)coloured("white")pl=undefinedendif//-----Breakout down confirmationatr=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=0endif//-----Breakout up confirmationif 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=0endif//-----Restart price level y cross is to late/soonif close crosses over bomax thenbomax=0elsif close crosses under bomin thenbomin=0endif//-------------------------------------------------------------------//returnVoici la stratégie que vous avez demandée (avec le code simplement appelé strategie2b.itf) :
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182//-------------------------------------------------------------------////PRC_2B Reversarl Pattern//version = 0//27.06.2024//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//-------------------------------------------------------------------////-----Inputs--------------------------------------------------------//ONCE Capital = 100000ONCE LotSize = 1ONCE prd = 20ONCE maxi = 10ONCE mini = 3Risk = Capital / 100 // 1% riskSL = Risk / PipValue / PipSize / LotSizesrc1 = lowsrc2 = high//-------------------------------------------------------------------////-----Pivot Point Calculation---------------------------------------////-----pivots lowif src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] thenpl=low[prd]plL=barindex[prd]//drawpoint(barindex[prd],low[prd],2)coloured("red",90)endif//-----pivots highif src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] thenph=high[prd]phL=barindex[prd]//drawpoint(barindex[prd],high[prd],2)coloured("blue",90)endif//-------------------------------------------------------------------////-----Pattern Detection---------------------------------------------////-----Calculate price level to check breakout downif close crosses over ph thenbomin=lowbominL=barindex//drawsegment(phL,ph,bominL,ph)style(dottedline)//drawpoint(phL,ph,1)coloured("white")ph=undefinedendif//-----Calculate price level to check breakout upif close crosses under pl thenbomax=highbomaxL=barindex//drawsegment(plL,pl,bomaxL,pl)style(dottedline)//drawpoint(plL,pl,1)coloured("white")pl=undefinedendif//-----Breakout down confirmationatr=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 THENSELLSHORT LotSize CONTRACTS AT MARKETStopPrice = high[1] + SLSET STOP PRICE StopPricebomin=0ENDIFendif//-----Breakout up confirmationif 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 THENBUY LotSize CONTRACTS AT MARKETStopPrice = low[1] - SLSET STOP PRICE StopPricebomax=0ENDIFendif//-----Restart price level y cross is to late/soonif close crosses over bomax thenbomax=0elsif close crosses under bomin thenbomin=0endif//-------------------------------------------------------------------////returngraph SLgraphOnPrice StopPrice1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on