Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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
Can you help answer these questions from other members on NexusFi?
I am answering in relation to Multicharts Power Language:
will NOT work -------------- cumupTicks += Upticks else cumupTicks = 0;
will work -------------------- cumupTicks = Upticks + cumupTicks[1] else cumupTicks = 0;
Now, in regards to your question of date vs session start, they both should work but which one is more efficient is unknown to me.
I have always wondered if there is a way to catch how fast an indicator executes - something similar to Excel VBA where you can actually measure the execution time.
I would be very happy if someone knows how to do this.
Thanks a lot for taking the time to answer, Appreciate ur help. Just 1 more thing, wouldn't ur code cumupTicks = Upticks + cumupTicks[1] only sum the prev's bar tick instead of accumulating the values from count of 0? or have I misunderstood the logic?