hi there,
I'm using this code to add an ATR value to my daily chart which updates on each tic:
if LastBarOnChart then begin
value30 = text_new(date,time,highest(high,50),"Yesterday's 5 Day ATR = " + printText);
value31 = text_setColor(value30,white);
end
else begin
value32 = text_delete(value30);
end;
Every now and then the text is not deleted and I get multiple texts all mushed over the top of each other... Do I need to alter my code?
Thanks,
Anthony
On chart text not deleting [SOLVED]
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: On chart text not deleting
hi there,
I'm using this code to add an ATR value to my daily chart which updates on each tic:
if LastBarOnChart then begin
value30 = text_new(date,time,highest(high,50),"Yesterday's 5 Day ATR = " + printText);
value31 = text_setColor(value30,white);
end
else begin
value32 = text_delete(value30);
end;
Every now and then the text is not deleted and I get multiple texts all mushed over the top of each other... Do I need to alter my code?
Thanks,
Anthony
Try this
Code: Select all
var:
text.atr(-1);
if LastBarOnChart then begin
text.atr = text_new(date,time,highest(high,50),"Yesterday's 5 Day ATR = " + printText);
text_setColor( text.atr ,white);
if barstatus = 2 then text_delete( text.atr );
end;
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: On chart text not deleting
ps. See post #1 & #2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713