proscreener da un indicatore
Forums › ProRealTime forum Italiano › Supporto ProScreener › proscreener da un indicatore
- This topic has 5 replies, 2 voices, and was last updated 1 year ago by robertogozzi.
-
-
09/25/2023 at 5:19 PM #221576
Roberto buona sera,
altre volte ti ho chiesto di trasformare un indicatore in screener e tu gentilmente lo hai fatto, adesso é la volta di un indicatore che trovo molto interessante, ma i suoi segnali li vedo in ritardo. Ti ringrazio anticipatamente se mi converti anche questo (allego indicatore).
//—Initialisation
once idx0 = 0
once idx1 = 0
once idx2 = 0
once pos = 0ATR = AverageTrueRange[prd](typicalprice)
IF barindex >= 2*prd+1 then
If high[prd] >= highest[2*prd+1](high) and pos<=0 then
If idx1 <> 0 then
idx2 = idx1
EndifIf idx0 <> 0 then
idx1 = idx0
Endifidx0 = barindex[prd]
pos=1If idx2<>0 then
If showPvts then
If High[barindex-idx0]>=High[barindex-idx2] then
DRAWTEXT(“HH”,idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
else
DRAWTEXT(“LH”,idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
Endif
EndifEndif
EndifIf Low[prd] <= Lowest[2*prd+1](low) and pos>=0 then
If idx1 <> 0 then
idx2 = idx1
EndifIf idx0 <> 0 then
idx1 = idx0
Endifidx0 = barindex[prd]
pos=-1If idx2<>0 then
If showPvts then
If Low[barindex-idx0]>=Low[barindex-idx2] then
DRAWTEXT(“HL”,idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
else
DRAWTEXT(“LL”,idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
Endif
EndifEndif
EndifIf idx2<>0 then
If pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) thenIf showPattern then
DRAWTEXT(“1”,idx2,High[idx2]+ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“2”,idx1,Low[barindex-idx1]-ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“3”,idx0,High[barindex-idx0]+ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWSEGMENT(idx2,High[barindex-idx2],idx1,Low[barindex-idx1]) STYLE(Line,3) coloured(“BLUE”,255)
DRAWSEGMENT(idx1,Low[barindex-idx1],idx0,High[barindex-idx0]) STYLE(Line,3) coloured(“BLUE”,255)
EndifIf showBreak then
DRAWSEGMENT(idx1,Low[barindex-idx1],barindex+1,Low[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured(“BLUE”,255)
DRAWARROWDOWN(barindex,High+ATR/2) coloured(“RED”,255)
EndifEndif
If pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) then
If showPattern then
DRAWTEXT(“1”,idx2,Low[barindex-idx2]-ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“2”,idx1,High[barindex-idx1]+ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWTEXT(“3”,idx0,Low[barindex-idx0]-ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured(“BLUE”,255)
DRAWSEGMENT(idx2,Low[barindex-idx2],idx1,High[barindex-idx1]) STYLE(Line,3) coloured(“BLUE”,255)
DRAWSEGMENT(idx1,High[barindex-idx1],idx0,Low[barindex-idx0]) STYLE(Line,3) coloured(“BLUE”,255)
EndifIf showBreak then
DRAWSEGMENT(idx1,High[barindex-idx1],barindex+1,High[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured(“BLUE”,255)
DRAWARROWUP(barindex,Low-ATR/2) coloured(“GREEN”,255)
EndifEndif
Endif
EndifReturn
09/25/2023 at 5:36 PM #221577Ad un’occhiata veloce mi sembra si di tipo repainting, cioè va a piazzare il segnale su una candela precedente quando ne ha avuta la conferma, tipo lo ZIGZAG e il DPO. Verificherò meglio.
Però ho bisogno di sapere qual’è il segnale che ti deve dare, quando vengono viualizzate le frecce Rosse o Verdi?
09/25/2023 at 6:07 PM #221579Esattamente
Grazie
09/27/2023 at 10:56 AM #221663Eccolo (con le impostazioni puoi visualizzare il segnale come istogramma e selezionare i colori e lo spessore):
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112//https://www.prorealcode.com/topic/proscreener-da-un-indicatore/once prd = 14once showPvts = 1once showPattern = 1once showBreak = 1//—Initialisationonce idx0 = 0once idx1 = 0once idx2 = 0once pos = 0ATR = AverageTrueRange[prd](typicalprice)Segnale = 0IF barindex >= 2*prd+1 thenIf high[prd] >= highest[2*prd+1](high) and pos<=0 thenIf idx1 <> 0 thenidx2 = idx1EndifIf idx0 <> 0 thenidx1 = idx0Endifidx0 = barindex[prd]pos=1If idx2<>0 thenIf showPvts thenIf High[barindex-idx0]>=High[barindex-idx2] then//DRAWTEXT("HH",idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)else//DRAWTEXT("LH",idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)EndifEndifEndifEndifIf Low[prd] <= Lowest[2*prd+1](low) and pos>=0 thenIf idx1 <> 0 thenidx2 = idx1EndifIf idx0 <> 0 thenidx1 = idx0Endifidx0 = barindex[prd]pos=-1If idx2<>0 thenIf showPvts thenIf Low[barindex-idx0]>=Low[barindex-idx2] then//DRAWTEXT("HL",idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)else//DRAWTEXT("LL",idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)EndifEndifEndifEndifIf idx2<>0 thenIf pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) thenIf showPattern then//DRAWTEXT("1",idx2,High[idx2]+ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("2",idx1,Low[barindex-idx1]-ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("3",idx0,High[barindex-idx0]+ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWSEGMENT(idx2,High[barindex-idx2],idx1,Low[barindex-idx1]) STYLE(Line,3) coloured("BLUE",255)//DRAWSEGMENT(idx1,Low[barindex-idx1],idx0,High[barindex-idx0]) STYLE(Line,3) coloured("BLUE",255)EndifIf showBreak then//DRAWSEGMENT(idx1,Low[barindex-idx1],barindex+1,Low[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured("BLUE",255)//DRAWARROWDOWN(barindex,High+ATR/2) coloured("RED",255)Segnale = -1EndifEndifIf pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) thenIf showPattern then//DRAWTEXT("1",idx2,Low[barindex-idx2]-ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("2",idx1,High[barindex-idx1]+ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("3",idx0,Low[barindex-idx0]-ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWSEGMENT(idx2,Low[barindex-idx2],idx1,High[barindex-idx1]) STYLE(Line,3) coloured("BLUE",255)//DRAWSEGMENT(idx1,High[barindex-idx1],idx0,Low[barindex-idx0]) STYLE(Line,3) coloured("BLUE",255)EndifIf showBreak then//DRAWSEGMENT(idx1,High[barindex-idx1],barindex+1,High[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured("BLUE",255)DRAWARROWUP(barindex,Low-ATR/2) coloured("GREEN",255)Segnale = 1EndifEndifEndifEndifReturn Segnale AS "Segnale"09/28/2023 at 9:58 AM #221723GRAZIE sempre gentile, ma io veramente volevo un vaglio.
09/28/2023 at 10:52 AM #221728Scusami, avevo modificato l’indicatore per vedere come appariva con le sole frecce e ho poi dimenticato di convertirlo.
Eccolo:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112//https://www.prorealcode.com/topic/proscreener-da-un-indicatore/once prd = 14once showPvts = 1once showPattern = 1once showBreak = 1//—Initialisationonce idx0 = 0once idx1 = 0once idx2 = 0once pos = 0//ATR = AverageTrueRange[prd](typicalprice)Segnale = 0IF barindex >= 2*prd+1 thenIf high[prd] >= highest[2*prd+1](high) and pos<=0 thenIf idx1 <> 0 thenidx2 = idx1EndifIf idx0 <> 0 thenidx1 = idx0Endifidx0 = barindex[prd]pos=1If idx2<>0 thenIf showPvts thenIf High[barindex-idx0]>=High[barindex-idx2] then//DRAWTEXT("HH",idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)else//DRAWTEXT("LH",idx0,High[barindex-idx0]+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)EndifEndifEndifEndifIf Low[prd] <= Lowest[2*prd+1](low) and pos>=0 thenIf idx1 <> 0 thenidx2 = idx1EndifIf idx0 <> 0 thenidx1 = idx0Endifidx0 = barindex[prd]pos=-1If idx2<>0 thenIf showPvts thenIf Low[barindex-idx0]>=Low[barindex-idx2] then//DRAWTEXT("HL",idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)else//DRAWTEXT("LL",idx0,Low[barindex-idx0]-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)EndifEndifEndifEndifIf idx2<>0 thenIf pos=1 and High[barindex-idx0]>Low[barindex-idx1] and High[barindex-idx0]<High[barindex-idx2] and (Close<Low[barindex-idx1] and open>Low[barindex-idx1]) thenIf showPattern then//DRAWTEXT("1",idx2,High[idx2]+ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("2",idx1,Low[barindex-idx1]-ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("3",idx0,High[barindex-idx0]+ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWSEGMENT(idx2,High[barindex-idx2],idx1,Low[barindex-idx1]) STYLE(Line,3) coloured("BLUE",255)//DRAWSEGMENT(idx1,Low[barindex-idx1],idx0,High[barindex-idx0]) STYLE(Line,3) coloured("BLUE",255)EndifIf showBreak then//DRAWSEGMENT(idx1,Low[barindex-idx1],barindex+1,Low[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured("BLUE",255)//DRAWARROWDOWN(barindex,High+ATR/2) coloured("RED",255)Segnale = 2EndifEndifIf pos=-1 and Low[barindex-idx0]<High[barindex-idx1] and Low[barindex-idx0]>Low[barindex-idx2] and (Close>High[barindex-idx1] and open<High[barindex-idx1]) thenIf showPattern then//DRAWTEXT("1",idx2,Low[barindex-idx2]-ATR[Barindex-Idx2]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("2",idx1,High[barindex-idx1]+ATR[Barindex-Idx1]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWTEXT("3",idx0,Low[barindex-idx0]-ATR[Barindex-Idx0]/2,Dialog,Bold,20) coloured("BLUE",255)//DRAWSEGMENT(idx2,Low[barindex-idx2],idx1,High[barindex-idx1]) STYLE(Line,3) coloured("BLUE",255)//DRAWSEGMENT(idx1,High[barindex-idx1],idx0,Low[barindex-idx0]) STYLE(Line,3) coloured("BLUE",255)EndifIf showBreak then//DRAWSEGMENT(idx1,High[barindex-idx1],barindex+1,High[barindex-idx1]) STYLE(DOTTEDLINE2,2) coloured("BLUE",255)//DRAWARROWUP(barindex,Low-ATR/2) coloured("GREEN",255)Segnale = 1EndifEndifEndifEndifSCREENER[Segnale](Segnale AS "1=↑, 2=↓") -
AuthorPosts
Find exclusive trading pro-tools on