how to reset this indicator for every candle ??  [SOLVED]

Questions about MultiCharts and user contributed studies.
chipeur_le_renard
Posts: 50
Joined: 13 Jul 2014
Has thanked: 15 times
Been thanked: 5 times

how to reset this indicator for every candle ??

Postby chipeur_le_renard » 16 Sep 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;

Code: Select all



thx for help

regards
Attachments
Univers bourse.png
(13.56 KiB) Downloaded 567 times
Last edited by chipeur_le_renard on 16 Sep 2016, edited 2 times in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: how to reset this indicator for every candle ??

Postby TJ » 16 Sep 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
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;
thx for help
regards

Look up the following keywords:

BARSTATUS=2
TEXT_DELETE

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: how to reset this indicator for every candle ??

Postby TJ » 16 Sep 2016

See post #1 & #2
[FAQ] How to Post Codes (... so that people can read)
viewtopic.php?f=16&t=11713

chipeur_le_renard
Posts: 50
Joined: 13 Jul 2014
Has thanked: 15 times
Been thanked: 5 times

Re: how to reset this indicator for every candle ??

Postby chipeur_le_renard » 16 Sep 2016

i add code in my first meassage but nothing happen !!!!

regards

chipeur_le_renard
Posts: 50
Joined: 13 Jul 2014
Has thanked: 15 times
Been thanked: 5 times

Re: how to reset this indicator for every candle ??  [SOLVED]

Postby chipeur_le_renard » 16 Sep 2016

Code: Select all

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 and BarStatus = 1 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;
here is the code needed ...work very well

i added the statement barstatus

thx and have a nice day


Return to “MultiCharts”