Trendline : Une approche du trading
Forums › ProRealTime forum Français › Discussions générales sur le Trading › Trendline : Une approche du trading
- This topic has 100 replies, 11 voices, and was last updated 2 years ago by JJ Tec.
-
-
10/30/2021 at 5:40 PM #18061510/30/2021 at 5:43 PM #18061710/30/2021 at 5:50 PM #180618
Malgré la saisie show S/R en début de code, pas d’affichage graphique !?
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859defparam drawonlastbaronly = truedefparam calculateonlastbars = 500showSR = 1//fractalscp = lookbackif high[cp] >= highest[(cp)*2+1](high) thenLLH = 1elseLLH = 0endifif low[cp] <= lowest[(cp)*2+1](low) thenLLL = -1elseLLL = 0endifif LLH = 1 thenoldLTOPy = LTOPy[1]oldLTOPx = LTOPx[1]LTOPy = high[cp]LTOPx = barindex[cp]endifif LLL = -1 thenoldLBOTy = LBOTy[1]oldLBOTx = LBOTx[1]LBOTy = low[cp]LBOTx = barindex[cp]endif//trend lineDRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)//support/resistanceif showSR thenDRAWHLINE(LTOPy) COLOURED(207,215,199,100)DRAWHLINE(LBOTy) COLOURED(207,215,199,100)endifbarelapsedTOP=barindex-LTOPXbarelapsedBOTTOM=barindex-LBOTXfactorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)//drawtext("#factor#",barindex,low-10*pipsize,Dialog,Bold,20)nowTOP = LTOPy+(barelapsedTOP*factorTOP)drawtext("X",barindex,nowTOP,Dialog,Bold,20) coloured(112,169,161)nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)drawtext("X",barindex,nowBOTTOM,Dialog,Bold,20) coloured(211,78,36)RETURN nowTOP coloured(110,0,0,0), nowBOTTOM coloured(110,0,0,0)10/30/2021 at 5:51 PM #18061910/30/2021 at 6:03 PM #18062011/04/2021 at 2:50 PM #18095811/08/2021 at 10:01 PM #181268ça ne fonctionne pas !? 🙁
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859defparam drawonlastbaronly = truedefparam calculateonlastbars = 500lookback = 10showSR = 1//fractalscp = lookbackif high[cp] >= highest[(cp)*2+1](high) thenLLH = 1elseLLH = 0endifif low[cp] <= lowest[(cp)*2+1](low) thenLLL = -1elseLLL = 0endifif LLH = 1 thenoldLTOPy = LTOPy[1]oldLTOPx = LTOPx[1]LTOPy = high[cp]LTOPx = barindex[cp]endifif LLL = -1 thenoldLBOTy = LBOTy[1]oldLBOTx = LBOTx[1]LBOTy = low[cp]LBOTx = barindex[cp]endif//trend lineDRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)//support/resistanceif showSR thenDRAWHLINE(LTOPy) COLOURED(207,215,199,100)DRAWHLINE(LBOTy) COLOURED(207,215,199,100)endifbarelapsedTOP=barindex-LTOPXbarelapsedBOTTOM=barindex-LBOTXfactorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)//drawtext("#factor#",barindex,low-10*pipsize,Dialog,Bold,20)nowTOP = LTOPy+(barelapsedTOP*factorTOP)drawtext("X",barindex,nowTOP,Dialog,Bold,20) coloured(112,169,161)nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)drawtext("X",barindex,nowBOTTOM,Dialog,Bold,20) coloured(211,78,36)RETURN nowTOP coloured(110,0,0,0), nowBOTTOM coloured(110,0,0,0)11/09/2021 at 9:12 AM #18127911/17/2021 at 9:00 AM #18171411/17/2021 at 9:55 AM #181722Le code ci-dessous trace les lignes de trendline sur l’indicateur RSI. On peut changer l’indicateur avec n’importe quel autre dans la variable “source”.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061defparam drawonlastbaronly = truedefparam calculateonlastbars = 500lookback = 20showSR = 0source = rsi[14]//fractalscp = lookbackif source[cp] >= highest[(cp)*2+1](source) thenLLH = 1elseLLH = 0endifif source[cp] <= lowest[(cp)*2+1](source) thenLLL = -1elseLLL = 0endifif LLH = 1 thenoldLTOPy = LTOPy[1]oldLTOPx = LTOPx[1]LTOPy = source[cp]LTOPx = barindex[cp]endifif LLL = -1 thenoldLBOTy = LBOTy[1]oldLBOTx = LBOTx[1]LBOTy = source[cp]LBOTx = barindex[cp]endif//trend lineDRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)//support/resistanceif showSR thenDRAWHLINE(LTOPy) COLOURED(207,215,199,100)DRAWHLINE(LBOTy) COLOURED(207,215,199,100)endifbarelapsedTOP=barindex-LTOPXbarelapsedBOTTOM=barindex-LBOTXfactorTOP = (LTOPy-oldLTOPy)/(LTOPx-oldLTOPx)factorBOTTOM = (LBOTy-oldLBOTy)/(LBOTx-oldLBOTx)//drawtext("#factor#",barindex,low-10*pipsize,Dialog,Bold,20)nowTOP = LTOPy+(barelapsedTOP*factorTOP)drawtext("X",barindex,nowTOP,Dialog,Bold,20) coloured(112,169,161)nowBOTTOM = LBOTy+(barelapsedBOTTOM*factorBOTTOM)drawtext("X",barindex,nowBOTTOM,Dialog,Bold,20) coloured(211,78,36)RETURN source as "indicator", nowTOP coloured(110,0,0,0), nowBOTTOM coloured(110,0,0,0)11/17/2021 at 11:21 AM #181733Bonjour, Merci pour la réponse, je teste avec ce code d’un partenaire.
Et j’aimerais savoir comment je pourrais faire un dépistage en petits groupes avec cet indicaur.
Merci encore.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104//parthapersonal Fractals v1.2//PRT v11//By Vonasi//Date: 20201217defparam drawonlastbaronly = true//SettingsBarsBefore = 3BarsAfter = 3Support = 3Resistance = 3Points = 3T=rsi[9](totalprice)//Make sure all settings are valid onesBarsBefore = max(BarsBefore,1)BarsAfter = max(BarsAfter,1)StartBack = max(0,startback)if barindex >= barsbefore + barsafter then//Look for a low fractalBarLookBack = BarsAfter + 1if t[BarsAfter] < lowest[BarsBefore](t)[BarLookBack] THENif t[BarsAfter] = lowest[BarLookBack](t) THENa = a + 1$supportbar[a] = barindex[barsafter]$supportvalue[a] = t[barsafter]endifendif//Look for a high fractalif t[BarsAfter] > highest[BarsBefore](t)[BarLookBack] THENif t[BarsAfter] = highest[BarLookBack](t) THENb = b + 1$resistancebar[b] = barindex[barsafter]$resistancevalue[b] = t[barsafter]endifendifif islastbarupdate then//support lineif a >= 2 thenif support thenflag = 0zz = 0for z = a-zz downto 1for xx = 1 to aif z-xx < 1 thenbreakendifif $supportvalue[z] > $supportvalue[z-xx] thendrawsegment($supportbar[z-xx],$supportvalue[z-xx],$supportbar[z],$supportvalue[z],barindex+5) coloured(128,0,0)style(line,2)if points thendrawpoint($supportbar[z],$supportvalue[z],2) coloured(128,0,0)drawpoint($supportbar[z-xx],$supportvalue[z-xx],2) coloured(128,0,0)endifflag = 1breakendifzz = zz + 1nextif flag = 1 thenbreakendifzz = 0nextendifendif//resistance lineif b >= 2 thenif resistance thenflag = 0zz = 0for z = b-zz downto 1for xx = 1 to bif z-xx < 1 thenbreakendifif $resistancevalue[z] < $resistancevalue[z-xx] thenDRAWSEGMENT($resistancebar[z-xx],$resistancevalue[z-xx],$resistancebar[z],$resistancevalue[z],barindex+5) coloured(100,200,100)style(line,2)if points thendrawpoint($resistancebar[z],$resistancevalue[z],2) coloured(0,128,0)drawpoint($resistancebar[z-xx],$resistancevalue[z-xx],2) coloured(0,128,0)endifflag = 1breakendifzz = zz + 1nextif flag = 1 thenbreakendifzz = 0nextendifendifendifendifreturn T as "r" -
AuthorPosts
Find exclusive trading pro-tools on
Similar topics: