countdown for contrats resolution  [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

countdown for contrats resolution

Postby chipeur_le_renard » 20 Jun 2018

hi

a few months ago i find a solution to have this on screen (ticks resolution)..all credits to crazynasdaq

Image

and the code :

Code: Select all


//CrazyNasdaq tick countdown counter
//october 17th 2016
inputs:
TXT.dimension(22),
TXT.color(black),
TXT.Background(yellow),
TXT.Position.Vert(10),
TXT.Position.Oriz(10),
Near.close(false);

vars:
Mytick(0),
MyBar(0), countdown(0),
HH(0), LL(0), RR(0), SS(0);

MyBar = Barinterval;
MyTick = ticks;

HH = getappinfo(aihighestdispvalue);
LL = getappinfo(ailowestdispvalue);
RR = getappinfo(airightdispdatetime);
SS = getappinfo(aileftdispdatetime);

value1 = (HH - LL)/100;
value2 = (RR - SS)/100;

countdown = MyBar - Mytick;

text_delete(value3);

value3 = Text_new_dt(RR - (TXT.Position.oriz*value2), HH - (TXT.Position.vert*value1), " "+ numtostr(countdown,0)+" ");
text_setcolor(value3, TXT.color);
text_setsize(value3, TXT.dimension);
text_setbgcolor(value3, TXT.Background);
text_setborder(value3,true);
if near.close = true then
Text_setlocation_dt(value3, (datetime-(txt.position.oriz*0.000694444444)), close + (txt.position.vert*(minmove/pricescale)));


so my code for countdown for contrats resolution

Code: Select all


inputs:
TXT.dimension(22),
TXT.color(black),
TXT.Background(yellow),
TXT.Position.Vert(10),
TXT.Position.Oriz(10),
Near.close(false);

vars:
Mytick(0),
MyBar(0), countdown(0),
HH(0), LL(0), RR(0), SS(0);

MyBar = Barinterval;
MyTick = [b]Volume;[/b]

HH = getappinfo(aihighestdispvalue);
LL = getappinfo(ailowestdispvalue);
RR = getappinfo(airightdispdatetime);
SS = getappinfo(aileftdispdatetime);

value1 = (HH - LL)/100;
value2 = (RR - SS)/100;

countdown = MyBar - Mytick;

text_delete(value3);

value3 = Text_new_dt(RR - (TXT.Position.oriz*value2), HH - (TXT.Position.vert*value1), " "+ numtostr(countdown,0)+" ");
text_setcolor(value3, TXT.color);
text_setsize(value3, TXT.dimension);
text_setbgcolor(value3, TXT.Background);
text_setborder(value3,true);
if near.close = true then
Text_setlocation_dt(value3, (datetime-(txt.position.oriz*0.000694444444)), close + (txt.position.vert*(minmove/pricescale)));
but wrong result

Image

any idea for a solution ??

thx

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

Re: countdown for contrats resolution

Postby TJ » 20 Jun 2018

Who is your data provider?

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

Re: countdown for contrats resolution

Postby chipeur_le_renard » 20 Jun 2018

Hello tj

Interactive brokers

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

Re: countdown for contrats resolution

Postby TJ » 20 Jun 2018

Hello tj

Interactive brokers

The ticks provided by IB are not real ticks; they are aggregated ticks.
I don't know if this is the cause of your discrepancy. This is something you need to put in mind during your debugging.

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

Re: countdown for contrats resolution

Postby chipeur_le_renard » 20 Jun 2018

Counter contrats in MC use same datafeed so it s my code which is wrong

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

Re: countdown for contrats resolution

Postby TJ » 20 Jun 2018

Lots of EasyLanguage counter codes on the internet; I would download a few and make comparisons.

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: countdown for contrats resolution

Postby rrams » 21 Jun 2018

chipeur le renard is there any reason why you can't just use the original code from crazynasdaq and set Build Volume On: Trade Volume ?
counter.png
(3.79 KiB) Downloaded 611 times

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

Re: countdown for contrats resolution  [SOLVED]

Postby chipeur_le_renard » 21 Jun 2018

Image

with original code of crazynasdaq and set build volume on : trade volume ...all run fine

thx @rrams


Return to “MultiCharts”