Stockholm, Sweden
Posts: 10 since Feb 2023
Thanks Given: 7
Thanks Received: 0
|
Hi,
is it possible for someone to help me get the cumulative sum from start of the trading session/or if easier from specified starting time?
i will be using it for stocks (so I won't be having issues with different trading session starts). For instance, I just need to get the logic correct so I can use it in my testing.
for instance, if I want the cumulative sum of upticks from start of the session:
HTML Code:
inputs: sessionStart(1530), sessionEnd(2200),length(9);
var: cumupTicks(0);
if Time >= sessionStart and Time <= sessionEnd then
cumupTicks += Upticks else cumupTicks = 0;
plot1( ccumupTicks , "Cumulative Upticks", Green );
or is it better to do:
HTML Code:
inputs: sessionStart(1530), sessionEnd(2200),length(9);
var: cumupTicks(0);
if Date <> Date[1] then
cumupTicks += Upticks else cumupTicks= 0;
plot1( ccumupTicks , "Cumulative Upticks", Green );
Or How should it be? I appreciate any help.
Thanks in advance
|