Hello
To describe my problem briefly, I have shortened to the essential from PopGun-Indicator i coded – see at the bottom
The LIN generated by this code turns backward and ends with the current candle. (screenshot1)
r= 0
b=0
g=0
Support = 0,3*pipsize
Lin = 3
DRAWSEGMENT(barindex,LOW-SUPPORT,barindex-LIN, LOW-SUPPORT )coloured(r,g,b)
I change the code from “barindex-lin” into “barindex+lin” and the lin turns forward.(screenshot2)
r= 0
b=0
g=0
Support = 0,3*pipsize
Lin = 3
DRAWSEGMENT(barindex,LOW-SUPPORT,barindex+LIN, LOW-SUPPORT )coloured(r,g,b)
So far so good.
But: The Lin forward will not displayed before until 3 new candles have been created. (screenshot3, same picture like screenshot1 but the Lin is missing)
How can i program that the lin is already drawn on the current candle before the 3 new candles created.
Kind regards
JohnScher
Translated with http://www.DeepL.com/Translator
// PopGun Indikator
// Coded by JohnScher
PIP = 0.3*pipsize
LIN = 3
Support = (High-Low)*0.5
Resistance = (High-Low)*0.5
r=0
g=0
b=0
//indicator PopGun
PG = High[2]>High[1] and Low[2]<Low[1] and High>High[1] and Low<Low[1]
IF PG Then
DRAWARROWUP(barindex,LOW-PIP)coloured(r,g,b)
DRAWSEGMENT(barindex,LOW-SUPPORT,barindex-LIN, LOW-SUPPORT )coloured(r,g,b)
DRAWARROWDOWN(barindex,HIGH+PIP)coloured(r,g,b)
DRAWSEGMENT(barindex,High+Resistance,barindex-LIN, High+Resistance )coloured(r,g,b)
ENDIF
return