Bollinger band with text display

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Bollinger band with text display

Postby Strauss.c.m » Wed Apr 21, 2021 1:13 pm

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
Strauss.c.m
 
Posts: 9
Joined: Mon Jan 02, 2012 4:29 am

Re: Bollinger band with text display

Postby Apprentice » Fri Apr 23, 2021 3:41 am

Your request is added to the development list.
Development reference 400.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 29698
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Re: Bollinger band with text display

Postby Strauss.c.m » Fri Apr 23, 2021 8:34 am

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
Strauss.c.m
 
Posts: 9
Joined: Mon Jan 02, 2012 4:29 am


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: No registered users and 6 guests