Ciao a tutti,
mi piacerebbe avere visibile sui grafici da h1 in giù, un rettangolo che mi indichi massimo e minimo fatto tra la 1 di notte e le 8 del mattino.
E’ possibile?
Grazie a tutti
JSParticipant
Senior
Ciao @figu92
Prova questo…
StartTime=010000
EndTime=080000
if IntraDayBarIndex=0 then
hh=0
ll=0
Draw=0
endif
if OpenTime=StartTime then
StartBar=BarIndex
endif
if OpenTime=EndTime then
EndBar=BarIndex
endif
if Time>=StartTime and Time<=EndTime then
if High>hh then
hh=High
endif
if Low<ll or ll=0 then
ll=Low
endif
endif
n=Round(SQRT(GetTimeFrame))/4 //Only for style
if Time>endtime and Draw=0 then
drawrectangle(StartBar,hh,EndBar,ll)Coloured("Red")
DrawText("High=#HH#",(StartBar+EndBar)/2,HH+n,SansSerif,Bold,16)Coloured("Green")
DrawText("Low=#LL#",(StartBar+EndBar)/2,LL-n,SansSerif,Bold,16)Coloured("Red")
Draw=1
endif
RETURN
Ottimo, grazie.
Sarebbe perfetto se il rettangolo fosse riempito di colore giallo molto chiaro (quasi trasparente) e il font massimo minimo fosse più piccolo oppure toglierlo proprio.
Grazie ancora 🙏
JSParticipant
Senior
Ciao @figu92
Ecco la versione modificata…
È possibile regolare la dimensione del testo aumentando o diminuendo il numero 16:
DrawText(“High=#HH#”,(StartBar+EndBar)/2,HH+n,SansSerif,Bold,16)Coloured(“Green”)
È possibile disabilitare del tutto i testi mettendo un “//” davanti ad essi:
//DrawText(“High=#HH#”,(StartBar+EndBar)/2,HH+n,SansSerif,Bold,16)Coloured(“Green”)
StartTime=010000
EndTime=080000
if IntraDayBarIndex=0 then
hh=0
ll=0
Draw=0
endif
if OpenTime=StartTime then
StartBar=BarIndex
endif
if OpenTime=EndTime then
EndBar=BarIndex
endif
if Time>=StartTime and Time<=EndTime then
if High>hh then
hh=High
endif
if Low<ll or ll=0 then
ll=Low
endif
endif
n=Round(SQRT(GetTimeFrame))/4 //Only for style
if Time>endtime and Draw=0 then
drawrectangle(StartBar,hh,EndBar,ll) FillColor(255,255,0,20)
DrawText("High=#HH#",(StartBar+EndBar)/2,HH+n,SansSerif,Bold,12)Coloured("Green")
DrawText("Low=#LL#",(StartBar+EndBar)/2,LL-n,SansSerif,Bold,12)Coloured("Red")
Draw=1
endif
RETURN
JSParticipant
Senior
Se si desidera impostare ulteriormente la trasparenza, è possibile modificare l’ultima cifra di FillColor(255,255,0,20)…
Così è perfetto.
Grazie infinite 🙏🙂
Ultima richiesta: è possibile visualizzare questo indicatore solo nei timeframe da m1 a h1? Evitando così la confusione su timeframe alti.
Grazie ancora
JSParticipant
Senior
I tempi nell’indicatore sono in ore (010000 e 080000), quindi l’intervallo di tempo utilizzato deve essere di almeno 1 ora e tutti gli intervalli di tempo inferiori a 1 ora… (ad esempio: 1 secondo, 1 minuto, 5 minuti, …)
Intanto ti ringrazio per la spiegazione e il codice che mi aiuta tantissimo.
Riguardo quello che ti volevo dire, se con l’indicatore attivato vado su timeframe come h4 (quindi maggiore di h1) il grafico diventa confusionario (ti mando l’immagine qui in allegato).
Quindi quello che ti chiedo è: è possibile visualizzare la sessione asiatica solo su timeframe uguali o minori a h1?
Grazie ancora
JSParticipant
Senior
Esatto, puoi utilizzare l’indicatore solo con un intervallo di tempo di 1 ora e tutti gli intervalli di tempo inferiori a 1 ora…