Multicharts Cursor  [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

Multicharts Cursor

Postby chipeur_le_renard » 13 Jul 2014

hi all

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 );
you can see the value of high and low of mini dow..i try to have only the four last digits for this instrument...like 884 and not 16884...like 882 and not 16882...
i used rightstr(keyword from easylangage) to do that but it s impossible to code this idea

thx for your help

regards

michael
Attachments
PRO AT.png
(10.72 KiB) Downloaded 604 times

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

Re: Multicharts Cursor

Postby TJ » 13 Jul 2014

hi all

i try to have only 4 digits of YM symbol (see screenshot)

::
thx for your help
regards
michael
try this:

Code: Select all

Last4Digits = FracPortion( price / 10000 ) *10000 ;

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

Re: Multicharts Cursor

Postby chipeur_le_renard » 13 Jul 2014

thx tj but i don t understand your answer

where to put this answer ?? in my code ??

regards

michael

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

Re: Multicharts Cursor

Postby chipeur_le_renard » 13 Jul 2014

good news

terrific tj....you give me the answer !!!!!!!

look to screeshot !!!!!!!!!

i post all code when he finish to write it

thx tj thx thx thx
Attachments
PRO AT.png
(14.2 KiB) Downloaded 609 times

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

Re: Multicharts Cursor

Postby chipeur_le_renard » 13 Jul 2014

here is new code

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),mic(0),mic2(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;

mic=highest(h,Bars.Back);
mic2= lowest(l,Bars.Back);

bar2.h =mic;
[b]bar2.h = FracPortion(mic / 10000 ) *10000 ;[/b]

bar2.l =mic2;
[b]bar2.l = FracPortion(mic2 / 10000 ) *10000 ;[/b]

Text_setstring(id.txt.h, " " + NumToStr(bar2.h, decimal));
Text_setlocation_s(id.txt.h, date,time_s + offset, mic );

Text_setstring(id.txt.L, " " + NumToStr(bar2.l, decimal));
Text_setlocation_s(id.txt.L, date,time_s + offset, mic2);

Text_setstring(id.arw.H, "< ");
Text_setlocation_s(id.arw.H, date,time_s + offset, mic );

Text_setstring(id.arw.L, "< ");
Text_setlocation_s(id.arw.L, date,time_s + offset, mic2);
---------------------------------------------------------------------------------

my goal is to have 884 and not 6884..i try to play the value of fraction but impossible to see the last three digits from righ side

thx for help

regards
michael
Attachments
PRO AT.png
(7.92 KiB) Downloaded 597 times

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

Re: Multicharts Cursor  [SOLVED]

Postby chipeur_le_renard » 13 Jul 2014

see screenshot

wonderful tj
Attachments
PRO AT.png
(72.75 KiB) Downloaded 601 times

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

Re: Multicharts Cursor

Postby TJ » 13 Jul 2014

see screenshot
wonderful tj
You are welcome. I am glad you have it working.

ps.
[FAQ] How to Post Codes (that people can read)
viewtopic.php?f=16&t=11713


pps.
When you copy codes from the web, you should retain the header, so that you can give credit to the original author.


Return to “MultiCharts”