Créer une Alerte sur test IFVG
Forums › ProRealTime forum Français › Support ProBuilder › Créer une Alerte sur test IFVG
- This topic has 4 replies, 2 voices, and was last updated 1 week ago by
Alai-n.
-
-
06/17/2025 at 9:18 AM #248317
Bonjour, comment serait-il possible de créer une alerte du type (+1/-1) lors du test du point médian de l’IFVG dans le code joint?
Du genre low[1] <= MedianIFVG and high[1]>=MedianIFVG (OU) low[1] <= MedianIFVG and close[1]>MedianIFVG
Merci
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116defparam drawonlastbaronly=true//dispNum=7//atrMult=0.25//showbrokenFvg=0//-----------------------------------------------//// Atr calculation//-----------------------------------------------//if barindex<=200 and barindex>1 thenatr=averagetruerange[barindex](close)*atrMultelseatr=averagetruerange[200](close)*atrMultendif//-----------------------------------------------//// FVG Detection//-----------------------------------------------//fvgUp=low>high[2] and close[1]>high[2]fvgDown=high<low[2] and close[1]<low[2]ctop=max(close,open)cbot=min(close,open)if fvgUp and abs(low-high[2])>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low$fvgRight[n+1]=barindex$fvgBot[n+1]=high[2]$fvgMid[n+1]=(low+high[2])/2$fvgDir[n+1]=1$State[n+1]=0n=n+1endifif fvgDown and abs(low[2]-high)>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low[2]$fvgRight[n+1]=barindex$fvgBot[n+1]=high$fvgMid[n+1]=(low[2]+high)/2$fvgDir[n+1]=-1$State[n+1]=0n=n+1endifif islastbarupdate thent1=0FOR i = n DOWNTO 0 DOt1=$fvgLeft[i]+1if t1<barindex thenfor j=barindex-t1 downto 0 doIF $fvgDir[i] = 1 AND cbot[j] < $fvgBot[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFIF $fvgDir[i] = -1 AND ctop[j] > $fvgTop[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFnextendifNEXTcount2=0t2=0for i=n downto 0 dot2=$invRight[i]+1if t2<barindex thenfor j=barindex-t2 downto 0 doif $fvgDir[i] = 1 and $State[i] = 1 and close[j] > $invTop[i] THENif count2<dispNum and showbrokenFvg thendrawrectangle($invLeft[i],$invTop[i],$invRight[i],$invBot[i])coloured("green",0)fillcolor("green",10)drawsegment($invRight[i],$invTop[i],barindex[j],$invTop[i])coloured("yellow",100)style(dottedline)endifcount2=count2+1$State[i] = -1breakendifif $fvgDir[i] = -1 and $State[i] = 1 and close[j] < $invBot[i] THENif count2<dispNum and showbrokenFvg thendrawrectangle($invLeft[i],$invTop[i],$invRight[i],$invBot[i])coloured("red",0)fillcolor("red",10)drawsegment($invRight[i],$invTop[i],barindex[j],$invTop[i])coloured("yellow",100)style(dottedline)endifcount2=count2+1$State[i] = -1breakendifnextendifnextcount=0for i=n downto 0 doif $State[i] = 1 and count < dispNum thencount=count+1if $fvgDir[i]=1 then//drawrectangle($invLeft[i],$invTop[i],$invRight[i],$invBot[i])coloured("green",0)fillcolor("green",50)drawrectangle($invRight[i],$invTop[i],barindex+10,$invBot[i])coloured("red",0)fillcolor("red",50)drawsegment($invLeft[i],($invBot[i]+$invTop[i])/2,barindex+10,($invBot[i]+$invTop[i])/2)coloured("white",150)style(dottedline3)elsif $fvgDir[i]=-1 then//drawrectangle($invLeft[i],$invTop[i],$invRight[i],$invBot[i])coloured("red",0)fillcolor("red",50)drawrectangle($invRight[i],$invTop[i],barindex+10,$invBot[i])coloured("green",0)fillcolor("green",50)drawsegment($invLeft[i],($invBot[i]+$invTop[i])/2,barindex+10,($invBot[i]+$invTop[i])/2)coloured("white",150)style(dottedline3)endifendifnextendif//-----------------------------------------------//return06/19/2025 at 3:39 PM #248403Bonjour. Voici un exemple de screener.
J’ai créé un niveau de référence et l’ai stocké dans un tableau.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107dispNum=7atrMult=0.25//-----------------------------------------------//// Atr calculation//-----------------------------------------------//if barindex<=200 and barindex>1 thenatr=averagetruerange[barindex](close)*atrMultelseatr=averagetruerange[200](close)*atrMultendif//-----------------------------------------------//// FVG Detection//-----------------------------------------------//fvgUp=low>high[2] and close[1]>high[2]fvgDown=high<low[2] and close[1]<low[2]ctop=max(close,open)cbot=min(close,open)// detectamos y almacenamos los fvg válidos alcistasif fvgUp and abs(low-high[2])>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low$fvgRight[n+1]=barindex$fvgBot[n+1]=high[2]$fvgMid[n+1]=(low+high[2])/2$fvgDir[n+1]=1$State[n+1]=0n=n+1endif// detectamos y almacenamos los fvg válidos bajistasif fvgDown and abs(low[2]-high)>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low[2]$fvgRight[n+1]=barindex$fvgBot[n+1]=high$fvgMid[n+1]=(low[2]+high)/2$fvgDir[n+1]=-1$State[n+1]=0n=n+1endifif islastbarupdate thent1=0FOR i = n DOWNTO 0 DOt1=$fvgLeft[i]+1if t1<barindex thenfor j=barindex-t1 downto 0 doIF $fvgDir[i] = 1 AND cbot[j] < $fvgBot[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFIF $fvgDir[i] = -1 AND ctop[j] > $fvgTop[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFnextendifNEXTcount2=0t2=0for i=n downto 0 dot2=$invRight[i]+1if t2<barindex and $State[i] = 1 thenfor j=barindex-t2 downto 0 doif $fvgDir[i] = 1 and close[j] > $invTop[i] THENcount2=count2+1$State[i] = -1breakendifif $fvgDir[i] = -1 and close[j] < $invBot[i] THENcount2=count2+1$State[i] = -1breakendifnextendifnextcount=0for i=n downto 0 doif $State[i] = 1 and count < dispNum then$levelPriceRef[count]=($invBot[i]+$invTop[i])/2$levelIdxRef[count]=$invRight[i]$DirRef[count]=$fvgDir[i]count=count+1endifnextsetup=0for i=count downto 0 dot3=$levelIdxRef[i]if t3<barindex thenif high>$levelPriceRef[i] and low<$levelPriceRef[i] thensetup=1dir=$DirRef[i]breakendifendifnextendifscreener[setup ](dir)1 user thanked author for this post.
06/20/2025 at 9:40 AM #248425Bonjour Iván
Super le Screener, un outil vraiment très bien…!
Mais ma demande initiale portait sur un déclenchement d’ALERTE SONORE (+1/-1) sur un Indicateur dans une fenêtre sous le prix comme sur la photo jointe. Je viens de tenter quelque chose en m’inspirant de ton Screener, mais le résultat n’est pas satisfaisant.
Du coup si tu avais une idée?
(Il s’agirait de déclencher sur le CLOSE[1], pour éviter de nombreux déclenchements d’ALERTE durant la vie de le bougie en cours)
06/20/2025 at 11:09 AM #248437Vous pouvez utiliser cet indicateur pour détecter des signaux dans le prix :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113defparam drawonlastbaronly=truedispNum=7atrMult=0.25showbrokenFvg=0//-----------------------------------------------//// Atr calculation//-----------------------------------------------//if barindex<=200 and barindex>1 thenatr=averagetruerange[barindex](close)*atrMultelseatr=averagetruerange[200](close)*atrMultendif//-----------------------------------------------//// FVG Detection//-----------------------------------------------//fvgUp=low>high[2] and close[1]>high[2]fvgDown=high<low[2] and close[1]<low[2]ctop=max(close,open)cbot=min(close,open)if fvgUp and abs(low-high[2])>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low$fvgRight[n+1]=barindex$fvgBot[n+1]=high[2]$fvgMid[n+1]=(low+high[2])/2$fvgDir[n+1]=1$State[n+1]=0n=n+1endifif fvgDown and abs(low[2]-high)>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low[2]$fvgRight[n+1]=barindex$fvgBot[n+1]=high$fvgMid[n+1]=(low[2]+high)/2$fvgDir[n+1]=-1$State[n+1]=0n=n+1endifif islastbarupdate thent1=0FOR i = n DOWNTO 0 DOt1=$fvgLeft[i]+1if t1<barindex thenfor j=barindex-t1 downto 0 doIF $fvgDir[i] = 1 AND cbot[j] < $fvgBot[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFIF $fvgDir[i] = -1 AND ctop[j] > $fvgTop[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFnextendifNEXTcount2=0t2=0for i=n downto 0 dot2=$invRight[i]+1if t2<barindex thenfor j=barindex-t2 downto 0 doif $fvgDir[i] = 1 and $State[i] = 1 and close[j] > $invTop[i] THENcount2=count2+1$State[i] = -1breakendifif $fvgDir[i] = -1 and $State[i] = 1 and close[j] < $invBot[i] THENcount2=count2+1$State[i] = -1breakendifnextendifnextcount=0for i=n downto 0 doif $State[i] = 1 and count < dispNum then$levelPriceRef[count]=($invBot[i]+$invTop[i])/2$levelIdxRef[count]=$invRight[i]$DirRef[count]=$fvgDir[i]count=count+1endifnextsetup=0for i=count downto 0 dot3=$levelIdxRef[i]if t3<barindex thenfor j=barindex-(t3+1) downto 0 doif high[j]>$levelPriceRef[i] and low[j]<$levelPriceRef[i] and $DirRef[i]=1 thendrawarrowdown(barindex[j],high[j])elsif high[j]>$levelPriceRef[i] and low[j]<$levelPriceRef[i] and $DirRef[i]=-1 thendrawarrowup(barindex[j],low[j])endifnextendifnextendif//-----------------------------------------------//returnEt celui-ci pour créer une variable de configuration. Le seul problème est que seul le dernier jour est calculé.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115defparam drawonlastbaronly=truedispNum=7atrMult=0.25showbrokenFvg=0//-----------------------------------------------//// Atr calculation//-----------------------------------------------//if barindex<=200 and barindex>1 thenatr=averagetruerange[barindex](close)*atrMultelseatr=averagetruerange[200](close)*atrMultendif//-----------------------------------------------//// FVG Detection//-----------------------------------------------//fvgUp=low>high[2] and close[1]>high[2]fvgDown=high<low[2] and close[1]<low[2]ctop=max(close,open)cbot=min(close,open)if fvgUp and abs(low-high[2])>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low$fvgRight[n+1]=barindex$fvgBot[n+1]=high[2]$fvgMid[n+1]=(low+high[2])/2$fvgDir[n+1]=1$State[n+1]=0n=n+1endifif fvgDown and abs(low[2]-high)>atr then$fvgLeft[n+1]=barindex[1]$fvgTop[n+1]=low[2]$fvgRight[n+1]=barindex$fvgBot[n+1]=high$fvgMid[n+1]=(low[2]+high)/2$fvgDir[n+1]=-1$State[n+1]=0n=n+1endifif islastbarupdate thent1=0FOR i = n DOWNTO 0 DOt1=$fvgLeft[i]+1if t1<barindex thenfor j=barindex-t1 downto 0 doIF $fvgDir[i] = 1 AND cbot[j] < $fvgBot[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFIF $fvgDir[i] = -1 AND ctop[j] > $fvgTop[i] THEN$invLeft[i] = $fvgLeft[i]$invTop[i] = $fvgTop[i]$invRight[i] = barindex[j]$invBot[i] = $fvgBot[i]$State[i] = 1breakENDIFnextendifNEXTcount2=0t2=0for i=n downto 0 dot2=$invRight[i]+1if t2<barindex thenfor j=barindex-t2 downto 0 doif $fvgDir[i] = 1 and $State[i] = 1 and close[j] > $invTop[i] THENcount2=count2+1$State[i] = -1breakendifif $fvgDir[i] = -1 and $State[i] = 1 and close[j] < $invBot[i] THENcount2=count2+1$State[i] = -1breakendifnextendifnextcount=0for i=n downto 0 doif $State[i] = 1 and count < dispNum then$levelPriceRef[count]=($invBot[i]+$invTop[i])/2$levelIdxRef[count]=$invRight[i]$DirRef[count]=$fvgDir[i]count=count+1endifnextsetup=0for i=count downto 0 dot3=$levelIdxRef[i]if t3<barindex thenfor j=barindex-(t3+1) downto 0 doif high[j]>$levelPriceRef[i] and low[j]<$levelPriceRef[i] and $DirRef[i]=1 thensetup=-1elsif high[j]>$levelPriceRef[i] and low[j]<$levelPriceRef[i] and $DirRef[i]=-1 thensetup=1elsesetup=0endifnextendifnextendif//-----------------------------------------------//return 0 as "zero", setup1 user thanked author for this post.
06/20/2025 at 11:51 AM #248443Tout a l’air de fonctionner parfaitement comme tu le décris.
Mais en effet c’est un problème que le deuxième code ne déclenche seulement que sûr le dernier IFVG. J’imagine que tu n’as pas d’autres solutions, sinon tu l’aurais mise en place. Encore merci
-
AuthorPosts
Find exclusive trading pro-tools on