Hello,
with following code, PRT shows all the occurences in the graph (a lot of dots).
for better visibility, I only want to show the last signal (and not the previous ones). Is there a way to do that please?
Thanks in advance.
My code:
doji = abs(open - close) <= (high - low) * 0.1
IF doji THEN
DRAWTEXT("•",barindex,low - 0.5,monospaced,standard,15) coloured(100,100,100,150)
ENDIF
return doji
Add this line at the beginning, as line 1:
DEFPARAM DrawOnLastBarOnly = True
You have broken one of the rule of this forum:
Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
You had first posted here, then you duplicated your topic in the French forum. This is not allowed as it would shatter info across multiple topics making it difficult to retrieve that info.
I deleted the other one. Please read the basic rules, highlighted in yellow just above the SUBMIT button and stick to them. Thank you 🙂
Hello Roberto,
thanks a lot for your reactivity.
I have not thaught things could be simple like that… This instruction can be very useful. I will test it.
Sorry for the doublon, but it thaught my post was refused in the english forum. Thank you for deleting it to avoid any confusion.
Hello,
The proposed solution does not work and no signal is shown.
I guess because the last signal is not necessarily in the last bar. Any idea to help on this?
DEFPARAM DrawOnLastBarOnly = True
doji = abs(open - close) <= (high - low) * 0.3
IF doji THEN
DRAWTEXT("•",barindex,low,monospaced,standard,20) coloured(230,230,230,200)
DRAWTEXT("•",barindex,high + 0.5,monospaced,standard,20) coloured(230,230,230,200)
ENDIF
return doji
Yes, it’s because it only draws what is drawn on the last bar. Since DOJI occurred several bars before, it will not draw anything.
To work it out, whenever a DOJI pattern occurs, it must save its BarIndex and the price levels where to plot it:
DEFPARAM DrawOnLastBarOnly = True
doji = abs(open - close) <= (high - low) * 0.3
IF doji THEN
DojiBar = BarIndex
DojiPrice1 = low
DojiPrice2 = high + 0.5
ENDIF
DRAWTEXT("•",DojiBar,DojiPrice1,monospaced,standard,20) coloured(230,230,230,200)
DRAWTEXT("•",DojiBar,DojiPrice2,monospaced,standard,20) coloured(230,230,230,200)
return doji
Hello Roberto,
this works perfectly fine.
Thanks for your precious help