tick counter not working

Questions about MultiCharts and user contributed studies.
gdm-glen
Posts: 5
Joined: 03 Aug 2006

tick counter not working

Postby gdm-glen » 16 Jan 2007

hi guys

I have a code for a tick counter for TS.
It will compile but doesn't seem to do anything on the chart.
Can somebody help me with this as a tick counter will be very beneficial to everybody.

Thanks
Glen
Attachments
TEXT_COUNTER_DWN.ELD
(6.01 KiB) Downloaded 171 times

momentum
Posts: 315
Joined: 23 Nov 2005
Has thanked: 8 times
Been thanked: 14 times

Postby momentum » 16 Jan 2007

Try one of these.
Attachments
cOUNTdOWNS.xml
(28.25 KiB) Downloaded 187 times

Guest

Postby Guest » 24 Jan 2007

ok..finally got a tick counter that works..
Here is the code guys.
It works a treat!!


Input: Offset(1), bDrawClose(false), ClosePriceDigits(2), BarsBeforeClose(5);
input: soundFile("c:\WINDOWS\Media\ding.wav"), soundTrigger(1000);

VAR:
IntrabarPersist Bar_Number( 0 ),
IntrabarPersist Bar_Ticks ( 0 ),
TextID(0),
txt(""), snd_ret(true);

//***** Accumulate Intrabar Ticks *****
Bar_Ticks = Bar_Ticks + 1;

// ***** Reset Tick Count Each Bar *****
if BarNumber <> Bar_Number then
begin
Bar_Number = BarNumber;
Bar_Ticks = 0 ;
end; // reset each bar

value1 = BarInterval - Bar_Ticks;

if BarNumber = 1 then
TextID = Text_New(Date, Time, Close, NumToStr(value1, 0))
else
begin
txt = "< " + NumToStr(value1, 0);
if bDrawClose = true then txt = txt + ", " + NumToStr(close, ClosePriceDigits);
Text_SetString(TextID, txt);
Text_SetLocation(TextID, Date, Time + Offset, Close);
Text_SetStyle(TextID, 0, 2);

if value1 <= BarsBeforeClose then
Text_SetColor(TextID, Green)
else
if value1 < BarInterval/3 then
Text_SetColor(TextID, Yellow)
else
if value1 < 2*BarInterval/3 then
Text_SetColor(TextID, LightGray)
else
Text_SetColor(TextID, DarkGray);

if value1 = soundTrigger and soundFile <> "" then snd_ret = PlaySound(soundFile);
end;

User avatar
futurestrader019
Posts: 73
Joined: 14 Apr 2007

Postby futurestrader019 » 17 Apr 2007

I tried that tick counter posted by guest and it displays the counter correctly but it puts the counter on the actual candle being formed sometimes. Seems like towards the end of a candle / start of a new one that the counter is displayed on top of the candle.

Any ideas or suggestions?

I'd like a counter that is just right of the current candle being formed and stays there!

Thanks!

User avatar
ABC
Posts: 516
Joined: 16 Dec 2006
Has thanked: 110 times
Been thanked: 290 times
Contact:

Postby ABC » 17 Apr 2007

Change the Text plot commands to the text commands with seconds resolution.
Text_New_s for example etc.
This might cause the problem in this case, that sometimes there are more than one bar for the minute.

Regards,

ABC


Return to “MultiCharts”