NexusFi: Find Your Edge


Home Menu

 





Cumulative/summation reset on new session


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one Big Mike with 3 posts (1 thanks)
    2. looks_two Neo1 with 1 posts (0 thanks)
    3. looks_3 slickiam with 1 posts (4 thanks)
    4. looks_4 crazybears with 1 posts (1 thanks)
    1. trending_up 1,897 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 1 attachments




 
Search this Thread

Cumulative/summation reset on new session

  #1 (permalink)
 
Big Mike's Avatar
 Big Mike 
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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
43 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #2 (permalink)
 crazybears 
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115

Hi Mike

take a look to :
Technical Studies Reference - Sierra Chart

Reply With Quote
Thanked by:
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
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 View Post

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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
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

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
slickiam's Avatar
 slickiam 
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
Reply With Quote
Thanked by:
  #6 (permalink)
 
Neo1's Avatar
 Neo1 
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 View Post
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"
Reply With Quote




Last Updated on May 28, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts