***VenturerPOCSimple v 1.0***
Ciao ho creato un nuovo indicatore che mostra lo spostamento del POC durante la sessione RTH ed ETH.
il valore del POC viene mostrato con un “+” sul grafico con colori diversi in rth ed eth.
Il calcolo del POC ad inizio sessione, sia rth che eth viene effettuato dalla prima candela di apertura, con l’avanzare della sessione il dato sarà sempre più “solido”.
I parametri di configurazione sono:
SesStart e SesStop; inizio e fine sessione rth (es. DAX 9 – 18)
POCDefinition: Questa è la risoluzione del calcolo del POC (per questo valore accetto volentieri consigli)
SesShow: Mostra la separazione rth/eth (questoserve nel caso in cui lo vogliate utilizzare insieme all’altro mio indicatore VenturerPOCche già segna la sessione)
In allegato un esempio grafico ed il file da importare.
Accetto molto volentieri suggerimenti
//VenturerPOCSimple
//v 1.0
defparam calculateonlastbars=2000
HourStart=SesStart //15
HourStop=SesStop //23
Conteggio=0
once ConteggioPoc=0
once SelEnd=0
once SelStart=0
once SesRTH=0
once SesETH=0
once ColoreSfondo=0
Conteggio=Conteggio+1
OraBarra=openhour[Conteggio]
if OraBarra=HourStart and SelStart=0 then //Inizio sessione
SelStart=1
SelEnd=0
SesRTH=1
SesETH=0
ConteggioPoc=0
if SesShow=1 then
ColoreSfondo=1
DRAWVLINE(Barindex[Conteggio])Coloured(0,100,0)
endif
endif
if OraBarra=HourStop and SelEnd=0 then
SelStart=0
SelEnd=1
SesETH=1
SesRTH=0
ConteggioPoc=0
if SesShow=1 then
ColoreSfondo=0
DRAWVLINE(Barindex[Conteggio])Coloured(0,100,0)
endif
endif
ScaleFactor=3
NbrBars=POCDefinition
if ColoreSfondo=1 then
BACKGROUNDCOLOR(255,0,0,5)
endif
if SesRTH=1 or SesETH=1 then
ConteggioPoc=ConteggioPoc + 1
lookback=ConteggioPoc
hh=highest[lookback](high)
ll=lowest[lookback](low)
div = (hh-ll)/NbrBars
i=0
volsum=summation[lookback](volume)
maxbar = 0
while i<NbrBars do
lrange=ll+div*i
hrange=lrange+div
volbull=0
volbear=0
for j = 1 to lookback do
if close[j]>=lrange and close[j]<=hrange then
if close[j]>open[j] then
volbull=volbull+volume[j]
else
volbear=volbear+volume[j]
endif
endif
next
bullbar = round((volbull*lookback)/volsum)*scalefactor
bearbar = round((volbear*lookback)/volsum)*scalefactor
//VPOC
if(bullbar>maxbar) then
vpoclevel = (lrange+hrange)/2
maxbar=bullbar
endif
if(bearbar>maxbar) then
vpoclevel = (lrange+hrange)/2
maxbar=bearbar
endif
i=i+1
wend
rgbA=0
rgbB=0
rgbC=0
if SesRTH=1 then
rgbA=138
rgbB=43
rgbC=226
else
rgbA=255
rgbB=69
rgbC=0
endif
drawtext("+",barindex,vpoclevel,dialog,bold,15) coloured(rgbA,rgbB,rgbC)
endif
return
Non mi ha allegato i file, lo metto qui.