counter ticks location in corner of windows  [SOLVED]

Questions about MultiCharts and user contributed studies.
chipeur_le_renard
Posts: 32
Joined: 13 Jul 2014
Has thanked: 12 times
Been thanked: 4 times

counter ticks location in corner of windows

Postby chipeur_le_renard » 16 Oct 2016

hello all

can anyone help me to always have a contdown timer in the corner of my MC windoxs ..

like screenshot

impossible to me to do that

thx for help

regards
Attachments
Univers Bourse.png
Univers Bourse.png (38.72 KiB) Viewed 301 times

User avatar
bensat
Posts: 332
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 103 times

Re: counter ticks location in corner of windows

Postby bensat » 17 Oct 2016

Not tested but may you can try it .... I assume you have the code for the tick counter so I do not include it here.

Code: Select all

Input: TicksFromScreenHL(10), Price(close), Txt1("Test");

var: txtvar1(-1);

If txtvar1<0 then
   begin
      txtvar1=Text_New(Date,Time,Price,Txt1);
   end
   else
      begin
         Text_SetLocation(txtvar1, Date, Tie, GetAppInfo(aiHighestDispValue) - (TicksFromScreenHL * tick));
         Text_SetColor(txtvar1, black);
      end;


Tick - Function

Code: Select all

tick = MinMove * Reciprocal(PriceScale);


You could go further and measure where your current closed is placed in regards to the position on the chart, so you could move the counter related to it for better visibility. Some feedback would be nice.

Kind Regards.

Ben
These users thanked the author bensat for the post (total 2):
sptraderchipeur_le_renard

User avatar
CrazyNasdaq
Posts: 262
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 77 times
Been thanked: 80 times

Re: counter ticks location in corner of windows  [SOLVED]

Postby CrazyNasdaq » 17 Oct 2016

Code: Select all

//CrazyNasdaq tick countdown counter
//october 17th 2016
inputs:
TXT.dimension(18),
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)));


You can set the position at your choice increasing or decreasing the "position.Vert" and the "position.oriz".
If you want you can position it near the last close if you set "near.close" = true.
this way the orizzontal or vertical position moves on last Datetime - N minutes (Txt.position.oriz) and last close +/- N ticks (txt.position.vert in ticks)
You have also to unflag the "Skip identical ticks" and "Build Volume on tick Count" in the settings of the instrument

Image
Image

video
https://sendvid.com/kfkk05e8
Attachments
2016-10-17_19-47-11.jpg
2016-10-17_19-47-11.jpg (47.92 KiB) Viewed 272 times
2016-10-17_19-15-59.jpg
2016-10-17_19-15-59.jpg (147 KiB) Viewed 268 times
These users thanked the author CrazyNasdaq for the post (total 2):
bensatsptrader

chipeur_le_renard
Posts: 32
Joined: 13 Jul 2014
Has thanked: 12 times
Been thanked: 4 times

Re: counter ticks location in corner of windows

Postby chipeur_le_renard » 19 Oct 2016

great thx to ben and crazynasdaq

very good education from both you two

kind regards
These users thanked the author chipeur_le_renard for the post (total 2):
bensatCrazyNasdaq

chipeur_le_renard
Posts: 32
Joined: 13 Jul 2014
Has thanked: 12 times
Been thanked: 4 times

Re: counter ticks location in corner of windows

Postby chipeur_le_renard » 19 Oct 2016

great job !!!!!!!!!!!!!!!!!!!!!!!!!!
Attachments
Univers Bourse.png
Univers Bourse.png (42.08 KiB) Viewed 281 times
These users thanked the author chipeur_le_renard for the post:
CrazyNasdaq


Return to “MultiCharts”