Hello dear sirs,
How can I change the Tooltip, so that in addition to "change", the difference in pips will also be displayed.
In Tooltip "change" indicates the difference in values from start until the end of the line. I also need to see the difference in pips.
Is it possible?
Tomasz
March 14, 2020, 12:00pm
#2
Trendline tooltips are internally generated. You can't modify them.
As AFL workaround you can get change in pips via Study function.
(The value is shown in tooltip of price chart then in addition to Title)
/// @link https://forum.amibroker.com/t/addition-value-in-trendline-study-tooltip/17719/3
function StudyLinePipChg(ID) {
line = Study(ID, GetChartID());
last_idx = BarCount-1;
idx1 = Min(last_idx, NullCount(line));
idx2 = last_idx-Min(last_idx, NullCount(line, 2));
chg = line[idx2] - line[idx1];
result = chg/TickSize;
return result;
}
chg = StudyLinePipChg("RE");
Plot( C, "Price", colorDefault, styleBar );
Plot(chg, "StudyLine Change in Pips", colorRed, styleNoDraw | styleOwnScale);
3 Likes
Since Tomasz says the issue may not appear in the tooltip, the solution you have proposed is acceptable and thank you very much for your help and your kindness. Thanks again.