write number trendline in the visibe chart

Questions about MultiCharts and user contributed studies.
turbofib
Posts: 213
Joined: 11 May 2013
Has thanked: 67 times
Been thanked: 1 time

write number trendline in the visibe chart

Postby turbofib » 22 May 2020

hi, look this pics


how can i write fan number in visible chart?

it'are trendline... i use this code to write it: value1=Text_new(date,time,value1,"...");
but it's impossible to use it if the trendline finish out of chart
Attachments
Immagine.png
(89.68 KiB) Not downloaded yet

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: write number trendline in the visibe chart

Postby Vlada MultiCharts » 24 Aug 2020

Hello turbofib,

Unfortunately, there is no universal solution.
It is not possible to receive info on which part of the chart is visible using the means of PowerLanguage.

If you need to have some value always visible on the chart, you can display this value using the Plot keyword, for example.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: write number trendline in the visibe chart

Postby JoshM » 24 Aug 2020

It is possible to use PowerLanguage to see which part of the chart is currently visible in my view.

`GetAppInfo(aiHighestDispValue)` returns the highest price coordinate in the current chart view. It looks like this is keyword you need to get the price coordinate of where to place the trend line number.

For more on `GetAppInfo()`: https://www.multicharts.com/trading-sof ... GetAppInfo

You'll also need to know which time coordinate the text box needs to have. This is a little more trickier since there's no PowerLanguage function for that.

If I had to implement this myself, I'd try with `TL_GetValue_s()` to get an estimation on which bar the trend line moves off the chart, and then put the text box one bar later.


Return to “MultiCharts”