How to draw only the lastest signal
Forums › ProRealTime English forum › ProBuilder support › How to draw only the lastest signal
- This topic has 7 replies, 2 voices, and was last updated 4 years ago by mmichael.
-
-
04/29/2020 at 2:31 AM #128748
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 detection1234567doji = abs(open - close) <= (high - low) * 0.1IF doji THENDRAWTEXT("•",barindex,low - 0.5,monospaced,standard,15) coloured(100,100,100,150)ENDIFreturn doji04/29/2020 at 2:34 AM #128750Add this line at the beginning, as line 1:
1DEFPARAM DrawOnLastBarOnly = True04/29/2020 at 2:44 AM #128752You 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 🙂
1 user thanked author for this post.
04/29/2020 at 2:51 AM #128753Hello 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.
04/29/2020 at 3:02 AM #128754Hello,
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?
12345678910DEFPARAM DrawOnLastBarOnly = Truedoji = abs(open - close) <= (high - low) * 0.3IF doji THENDRAWTEXT("•",barindex,low,monospaced,standard,20) coloured(230,230,230,200)DRAWTEXT("•",barindex,high + 0.5,monospaced,standard,20) coloured(230,230,230,200)ENDIFreturn doji04/29/2020 at 3:10 AM #12875504/29/2020 at 4:05 AM #128757Yes, 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:
12345678910DEFPARAM DrawOnLastBarOnly = Truedoji = abs(open - close) <= (high - low) * 0.3IF doji THENDojiBar = BarIndexDojiPrice1 = lowDojiPrice2 = high + 0.5ENDIFDRAWTEXT("•",DojiBar,DojiPrice1,monospaced,standard,20) coloured(230,230,230,200)DRAWTEXT("•",DojiBar,DojiPrice2,monospaced,standard,20) coloured(230,230,230,200)return doji1 user thanked author for this post.
04/29/2020 at 12:45 PM #128809Hello Roberto,
this works perfectly fine.
Thanks for your precious help
2 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on