i try to have only 4 digits of YM symbol (see screenshot)
here is the code to do this:
Code: Select all
inputs:Bars.Back(1),Color(white),Font.Size(10),Decimal(4);
variables:
id.txt.h(0),id.txt.L(0),id.arw.H(-1),id.arw.L(-1),bar2.h(0),bar2.l(0),offset(0);
if bartype_ex = 2 then offset = barinterval * 100
else
if bartype_ex = 3 then offset = barinterval * 10000
else
if bartype_ex = 1 or bartype_ex = 8 or bartype_ex = 11 or bartype_ex = 13 then offset = 1
else
offset = barinterval;
if currentbar = 1 then
begin
id.txt.h = Text_New_s(date,time_s, InsideAsk, "<");
id.txt.L = Text_New_s(date,time_s, InsideBid, "<");
id.arw.H = Text_New_s(date,time_s, InsideAsk, "<");
id.arw.L = Text_New_s(date,time_s, InsideBid, "<");
text_setcolor(id.txt.h, Color);
text_setstyle(id.txt.h, 0, 1);
text_setSize(id.txt.h, Font.Size);
text_setcolor(id.txt.L, Color);
text_setstyle(id.txt.L, 0, 0);
text_setSize(id.txt.L, Font.Size);
text_setcolor(id.arw.H, Color);
text_setstyle(id.arw.H, 0, 2);
text_setSize(id.arw.H, Font.Size);
text_setcolor(id.arw.L, Color);
text_setstyle(id.arw.L, 0, 2);
text_setSize(id.arw.L, Font.Size);
end;
bar2.h =highest(h,Bars.Back);
bar2.l = lowest(l,Bars.Back);
Text_setstring(id.txt.h, " " + NumToStr(bar2.h, decimal));
Text_setlocation_s(id.txt.h, date,time_s + offset, bar2.h );
Text_setstring(id.txt.L, " " + NumToStr(bar2.l, decimal));
Text_setlocation_s(id.txt.L, date,time_s + offset, bar2.l);
Text_setstring(id.arw.H, "<");
Text_setlocation_s(id.arw.H, date,time_s + offset, bar2.h );
Text_setstring(id.arw.L, "<");
Text_setlocation_s(id.arw.L, date,time_s + offset, bar2.l );
i used rightstr(keyword from easylangage) to do that but it s impossible to code this idea
thx for your help
regards
michael