Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
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)
Cumulative/summation reset on new session
Updated May 28, 2017
Top Posters
looks_one
Big Mike
with 3 posts (1 thanks)
looks_two
Neo1
with 1 posts (0 thanks)
looks_3
slickiam
with 1 posts (4 thanks)
looks_4
crazybears
with 1 posts (1 thanks)
trending_up
1,897 views
thumb_up
6 thanks given
group
3 followers
forum
5 posts
attach_file
1 attachments
Cumulative/summation reset on new session
October 17th, 2014, 03:49 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608
I want to do a summation of a ticker price series, but reset it on a new session. Is there a built-in study that will do this?
Mike
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
October 17th, 2014, 05:03 PM
Alesia E.U.
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115
October 17th, 2014, 05:08 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608
crazybears
LOL how embarrassing. I found Summation but didn't see the Cumulative one, and then when I created the thread title I thought I would be more descriptive by saying cumulative but didn't bother looking at Sierra for an indicator that started with that. It seems like the two studies are identical, except one can reset on new session. I'm not sure why there needs to be two studies, instead of just one with the reset option. (Cumulative Sum of Study vs Summation).
Works great.
Mike
October 17th, 2014, 05:18 PM
Manta, Ecuador
Site Administrator Developer Swing Trader
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608
And now I have a cumulative tick reset on new session.
Mike
October 17th, 2014, 05:47 PM
Tomsk, Russia
Experience: Beginner
Platform: custom
Trading: gold
Posts: 273 since Dec 2010
Thanks Given: 133
Thanks Received: 435
Hi All
This is my 2 cents for someone who might be interested in.
Code
#include "sierrachart.h"
SCDLLName("bm_cv6u");
SCSFExport scsf_bm_cv6u(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.Input[0].Name = "Source #1 to summ ";
sc.Input[0].SetChartStudySubgraphValues(1,0,4);
sc.GraphName = "bm_cv6u";
sc.StudyDescription = "bm_cv6u @ganz ";
sc.Subgraph[0].Name = "summ";
sc.GraphRegion = 1;
sc.ValueFormat = 2;
sc.AutoLoop = 1;
sc.FreeDLL = 0;
return;
}
SCGraphData src1Array;
int src1Chart = sc.Input[0].GetChartNumber();
int src1Study = sc.Input[0].GetStudyID();
int src1StudySubgraph = sc.Input[0].GetSubgraphIndex();
sc.GetStudyArraysFromChartUsingID(src1Chart, src1Study, src1Array);
SCFloatArrayRef src1ArrayData = src1Array[src1StudySubgraph];
double& CumulativeSummation = sc.PersistVars->d1;
SCDateTime StartDateTimeOfDay;
StartDateTimeOfDay.SetTime(sc.StartTimeOfDay);
StartDateTimeOfDay.SetDate(sc.BaseDateTimeIn[sc.Index].GetDate());
if(sc.BaseDateTimeIn[sc.Index] == StartDateTimeOfDay || (sc.BaseDateTimeIn[sc.Index-1] < StartDateTimeOfDay && sc.BaseDateTimeIn[sc.Index] > StartDateTimeOfDay)) CumulativeSummation = src1ArrayData[sc.Index];
else CumulativeSummation += src1ArrayData[sc.Index];
sc.Subgraph[0][sc.Index] = CumulativeSummation;
return;
}
Scientia Libertas Prosperitas
May 28th, 2017, 01:35 AM
Christchurch, New Zealand
Experience: Beginner
Platform: SC
Broker: IB, BC, Dx Feed
Trading: US Equities
Posts: 428 since Jul 2014
Thanks Given: 471
Thanks Received: 531
slickiam
Hi All
This is my 2 cents for someone who might be interested in.
Code
#include "sierrachart.h"
SCDLLName("bm_cv6u");
SCSFExport scsf_bm_cv6u(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.Input[0].Name = "Source #1 to summ ";
sc.Input[0].SetChartStudySubgraphValues(1,0,4);
sc.GraphName = "bm_cv6u";
sc.StudyDescription = "bm_cv6u @ganz ";
sc.Subgraph[0].Name = "summ";
sc.GraphRegion = 1;
sc.ValueFormat = 2;
sc.AutoLoop = 1;
sc.FreeDLL = 0;
return;
}
SCGraphData src1Array;
int src1Chart = sc.Input[0].GetChartNumber();
int src1Study = sc.Input[0].GetStudyID();
int src1StudySubgraph = sc.Input[0].GetSubgraphIndex();
sc.GetStudyArraysFromChartUsingID(src1Chart, src1Study, src1Array);
SCFloatArrayRef src1ArrayData = src1Array[src1StudySubgraph];
double& CumulativeSummation = sc.PersistVars->d1;
SCDateTime StartDateTimeOfDay;
StartDateTimeOfDay.SetTime(sc.StartTimeOfDay);
StartDateTimeOfDay.SetDate(sc.BaseDateTimeIn[sc.Index].GetDate());
if(sc.BaseDateTimeIn[sc.Index] == StartDateTimeOfDay || (sc.BaseDateTimeIn[sc.Index-1] < StartDateTimeOfDay && sc.BaseDateTimeIn[sc.Index] > StartDateTimeOfDay)) CumulativeSummation = src1ArrayData[sc.Index];
else CumulativeSummation += src1ArrayData[sc.Index];
sc.Subgraph[0][sc.Index] = CumulativeSummation;
return;
}
Hi @slickiam
Have you coded anything that calculates the relative cumulative summation over X days? So you could examine at each time stamp how much % a subgraph has done of its cumulative average over x days.
Similar to the "Cumulative Volume Ratio",https://www.sierrachart.com/index.php?page=doc/StudiesReference.php&ID=356
So it would become the Cumulative Summation ratio.
eg
CurrentDayCumulativeSummationToTime / PriorDayAverageCumulativeSummationToTime
"Free markets work because they allow people to be lucky, thanks to aggressive trial and error, not by giving rewards or incentives for skill. The strategy is, then, to tinker as much as possible and try to collect as many Black Swan opportunities as you can"
Last Updated on May 28, 2017