Page 1 of 1

Bollinger band with text display

PostPosted: Wed Apr 21, 2021 1:13 pm
by Strauss.c.m
Hi
Would somebody please help me
I am trying to display text on a Bollinger band such as "TL" for top line whenever the top band is crossed
I would like to display TL above the band and a few candles before the breach but I do not know how to display text on a chart and at a specific period and price
I have 3 global variables that contain:
G_TL_LITERAL, contains the literal as I may want to change it to just "T" depending on what it looks like. I may also want to alter the text type, size and font
G_TL_PRIOR_PRDS contains the number of periods before the current period to start the text display
G_TL_PIP_GAP contains the number of pips above the current price that TL must be displayed at

My code is as follows:
----------------------------------------------------------------------------------
-- Check if the TL is breaching
----------------------------------------------------------------------------------
if source:tick(-1) > TL:tick(-1) and -- The Top Line is being breached
G_TL_DISPLAYED ~= period then -- and not yet displayed this candle
G_TL_DISPLAYED = period; -- Set the "displayed" indicator for this candle
--------------------------------------------------------------------------------
-- calculate the position to display the literal and display it
--------------------------------------------------------------------------------

end
As I understand it:
1. the period to start the display should be "period - G_TL_PRIOR_PRDS" and
2. the price to display it at should be "source:tick(-1) + (G_TL_PIP_GAP/10000)"

but after that I am stuck
Assistance would be greatly appreciated

Re: Bollinger band with text display

PostPosted: Fri Apr 23, 2021 3:41 am
by Apprentice
Your request is added to the development list.
Development reference 400.

Re: Bollinger band with text display

PostPosted: Fri Apr 23, 2021 5:05 am
by Apprentice

Re: Bollinger band with text display

PostPosted: Fri Apr 23, 2021 8:34 am
by Strauss.c.m
Hi
You can close this one
I have found a way to display it without any overhead to the system
I will post the full code under the https://fxcodebase.com/code/viewtopic.p ... ae#p141661 link as I now have one more problem when it initially loads the chart
Sorry for the inconvenience