chandelier multi timeframe
Forums › ProRealTime forum Français › Support ProBuilder › chandelier multi timeframe
- This topic has 4 replies, 2 voices, and was last updated 2 years ago by
Armand2020.
-
-
09/08/2022 at 8:05 PM #200390
bonjour , j aimerai pouvoir avoir des chandelier de 5 minute sur du 1 minute, mais avec ce code je n ai reussi qu a avoir des chandelier de 1 heure, quelqu un aurai des piste
merci
mtf candle123456789101112131415161718192021222324252627282930313233343536373839404142434445464748TIMEFRAME (60 MINUTE)TwoUp = high > high[1] and low > low[1]TwoDown = low < low[1] and high < high[1]InsideBar = high =< high[1] and low >= low[1]OutsideBar = high > high[1] and low < low[1]TIMEFRAME (DEFAULT)IF Dy thenif MINUTE[1]>MINUTE thenjhh = Highest[BarIndex - lastdaybarindex](High)[0]jll = Lowest[BarIndex - lastdaybarindex](Low)[0]lastdaybarindex = BarIndexjstartbar = barindex+1jo = open[BarIndex - lastdaybarindex]jc = close[1]jbmid = ((barindex-1)+jstartbar[1])/2IF INSIDEBAR THENDRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(255,255,250,30)BORDERCOLOR(255,255,250,130)endifIF TWOUP THENDRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(0,200,250,30)BORDERCOLOR(0,200,250,130)endif/////////////////////////////////////////////////////////////////////////////////////////IF TWODOWN THENDRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(255,0,0,30)BORDERCOLOR(255,0,0,100)endifIF OUTSIDEBAR THENDRAWRECTANGLE(jstartbar[1],jHH,barindex+1,jLL)coloured(255,0,250,30)BORDERCOLOR(255,0,250,100)endifENDIFENDIF/////////////////////////////////////////////////////////////////////////////////////////return09/09/2022 at 10:30 AM #200409Pour obtenir les valeurs OHLC des bougies 5 minutes, tu peux faire comme ceci:
123456789timeframe(5 minutes)open5 = openhigh5 = highlow5 = lowclose5 = closetimeframe(default)return open5,high5,low5,close5ici ça retournera des lignes, mais on pourrait tracer tout cela autrement avec ces variables.
1 user thanked author for this post.
09/09/2022 at 11:17 AM #20041912345if MINUTE[1]>MINUTE thenjhh = Highest[BarIndex - lastdaybarindex](High)[0]jll = Lowest[BarIndex - lastdaybarindex](Low)[0]lastdaybarindex = BarIndexjstartbar = barindex+1en fait c est cette partie de code que je ne sais pas faire, comment definir le debut (jstartbar) et la fin de la periode de 5min pour pouvoir tracer le rectangle?
09/09/2022 at 12:03 PM #200423Cette version rapide trace les chandeliers en cours de construction:
12345678910111213141516171819202122232425timeframe(5 minutes)open5 = openhigh5 = highlow5 = lowclose5 = closetimeframe(default)if open5<>lastopen thenlastopen=open5startbar=barindexendifif open5<close5 thenr=0g=255elser=255g=0endifdrawrectangle(startbar,open5,barindex,close5) coloured(r,g,0,50) bordercolor(0,0,0,0)drawsegment(startbar+3,max(open5,close5),startbar+3,high5) style(line,2)drawsegment(startbar+3,min(open5,close5),startbar+3,low5)style(line,2)return //open5,high5,low5,close51 user thanked author for this post.
09/09/2022 at 1:28 PM #200430J’ai trouver le code sur le forum que j ai un peu tranformer pour qu il colle l ancien , je le poste pour si ca peut aider quelqu un.
thestrat mtf candle m1/m512345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455TIMEFRAME (5 MINUTE)TwoUp = high > high[1] and low > low[1]TwoDown = low < low[1] and high < high[1]InsideBar = high =< high[1] and low >= low[1]OutsideBar = high > high[1] and low < low[1]TIMEFRAME(DEFAULT)C5 = closeIf OpenMinute MOD 5 = 0 Then //Reset variables each new 5-minute barO5 = openH5 = highL5 = lowElseH5 = max(H5,high)L5 = min(L5,low)EndifIf c5<o5 thenr=255g=0b=0elser=0g=255b=0endifIf OpenMinute MOD 5 = 4 Then //plot only when the 5-minute bar closes//Drawrectangle(BarIndex - 4,H5,BarIndex,L5) Coloured(r,g,b,255) //Body//DrawRectangle(BarIndex - 2,max(O5,C5),BarIndex - 2,H5) Coloured(r,g,b,255) //Upper Wick//DrawRectangle(BarIndex - 2,min(O5,C5),BarIndex - 2,L5) Coloured(r,g,b,255) //Lower WickIF INSIDEBAR THENDrawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(255,255,250,30)BORDERCOLOR(255,255,250,130)endifIF TWOUP THENDrawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(0,200,250,30)BORDERCOLOR(0,200,250,130)endif/////////////////////////////////////////////////////////////////////////////////////////IF TWODOWN THENDrawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(255,0,0,30)BORDERCOLOR(255,0,0,100)endifIF OUTSIDEBAR THENDrawrectangle(BarIndex - 4,H5,BarIndex,L5)coloured(255,0,250,30)BORDERCOLOR(255,0,250,100)endifENDIFReturn -
AuthorPosts
Find exclusive trading pro-tools on