how to reset this indicator for every candle ??
Posted: Sep 16 2016
[img]Univers%20bourse.png[/img][spoiler=][/spoiler]
hello every one
i have a little problem with this code
for ES i need the last high + .25 and the last low -.25 of high[1] and low [1]
all is running perfect but when i have a new candle i cannot reset the screen and i have tha last value + new values ...and so on...
how to rest these values to have only on screen high[1] +.25 and low [1] -.25???
see screenshot...
and my code
[/code]
inputs: HL_OFFSET(3), DECIMALS(2), Text_Attr(2), HIGH_TEXT("High "),
LOW_TEXT("Low "), Texts("Calibri"), Texts_Size(12), LEFT_RIGHT(" "),Bars.Back(2);
vars: Hid(0), Lid(0), RID(0), bar2.h(0),bar2.l(0);
If LastBarOnChart then begin ;
bar2.h = high[1]+(0.25);
bar2.l = low[1]-(0.25);
Hid=text_new(date,time,high+HL_OFFSET,LEFT_RIGHT+HIGH_TEXT+(NumToStr(bar2.h,DECIMALS)));
text_setstyle(Hid,0,1);
text_setfontname(Hid,texts);
text_setsize(Hid,texts_size);
text_setcolor(Hid,green);
text_setattribute(Hid,Text_Attr,true);
Lid=text_new(date,time,low-HL_OFFSET,LEFT_RIGHT+LOW_TEXT+NumToStr( bar2.l,DECIMALS));
text_setstyle(Lid,0,0);
text_setfontname(Lid,texts);
text_setsize(Lid,texts_size);
text_setcolor(Lid,red);
text_setattribute(Lid,Text_Attr,true);
end;
hello every one
i have a little problem with this code
for ES i need the last high + .25 and the last low -.25 of high[1] and low [1]
all is running perfect but when i have a new candle i cannot reset the screen and i have tha last value + new values ...and so on...
how to rest these values to have only on screen high[1] +.25 and low [1] -.25???
see screenshot...
and my code
[/code]
inputs: HL_OFFSET(3), DECIMALS(2), Text_Attr(2), HIGH_TEXT("High "),
LOW_TEXT("Low "), Texts("Calibri"), Texts_Size(12), LEFT_RIGHT(" "),Bars.Back(2);
vars: Hid(0), Lid(0), RID(0), bar2.h(0),bar2.l(0);
If LastBarOnChart then begin ;
bar2.h = high[1]+(0.25);
bar2.l = low[1]-(0.25);
Hid=text_new(date,time,high+HL_OFFSET,LEFT_RIGHT+HIGH_TEXT+(NumToStr(bar2.h,DECIMALS)));
text_setstyle(Hid,0,1);
text_setfontname(Hid,texts);
text_setsize(Hid,texts_size);
text_setcolor(Hid,green);
text_setattribute(Hid,Text_Attr,true);
Lid=text_new(date,time,low-HL_OFFSET,LEFT_RIGHT+LOW_TEXT+NumToStr( bar2.l,DECIMALS));
text_setstyle(Lid,0,0);
text_setfontname(Lid,texts);
text_setsize(Lid,texts_size);
text_setcolor(Lid,red);
text_setattribute(Lid,Text_Attr,true);
end;
Code: Select all
thx for help
regards