Cycles

Questions about MultiCharts and user contributed studies.
Jojojo
Posts: 5
Joined: 01 Dec 2023
Been thanked: 1 time

Cycles

Postby Jojojo » 10 May 2024

Hello
a coding question : How can I plot vertical lines every 20 seconds ? Starting with a StartTime(Input) in a while loop ?
The time-format is HH:MM:SS .My problem is adding seconds .It adds up in the 100er format instead of 60er .
kind regs
:?:
A step further .If I use
inputs:
XTime_S( 80900 ) ;

var: var0(0),var1(0),var2(0),TimeToSec(0);

var0 = IntPortion ( XTime_S/10000 );
var1 = Intportion ( (XTime_S - var0*10000)/100);
var2 = IntPortion ( FracPortion(XTime_S/100) * 100 );

TimeToSec = 60*60*var0 + 60*var1 + var2;
Print(XTime_S," ",TimeToSec);

Jojojo
Posts: 5
Joined: 01 Dec 2023
Been thanked: 1 time

Re: Cycles

Postby Jojojo » 10 May 2024

I get Print-Output 80900.00 29340.00
Divide this by 60 = 489 by 60 = 8.15 . Somehow wrong

OZ Trade
Posts: 42
Joined: 08 Nov 2013
Has thanked: 11 times
Been thanked: 19 times

Re: Cycles

Postby OZ Trade » 13 May 2024

Code: Select all

[ProcessMouseEvents= True] //REDRAW ON MOUSECLICK If mouseclickprice <> 0 then recalculate; //MODULAR ARITHMETIC Condition1= mod(SecondsFromDateTime(0),20) = 0; Condition2= datetime >= GetAppInfo(aileftdispdatetime); if Condition1 AND Condition2 then begin // ROUTINE TO DRAW TRENDLINES tl_new_bn(currentbar, getappinfo(ailowestdispvalue), currentbar, getappinfo(aihighestdispvalue)); End;
Modify to suit your taste and enjoy :)


Return to “MultiCharts”