NexusFi: Find Your Edge


Home Menu

 





Help with Cumulative Sum please!


Discussion in Sierra Chart

Updated
    1. trending_up 187 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 deejaynv 
london
 
Experience: Intermediate
Platform: ninjatrader
Trading: YM
Posts: 10 since Jul 2016
Thanks Given: 1
Thanks Received: 4

Hi Community!!

I wonder if you could help me.

I am trying to replicate the cumulative sum study @Big Mike used to use on his Sierra Chart setup to get Cumulative TICK for the week. I have asked him he said he no longer uses Sierra Chart so asking here. Was also told to tag @aslan

I know to get ctick / cumulative tick on a daily basis I use the Cumulative Sum of Study and set the option to Reset at Start of Trading Day to "Yes". All good.

I can't seem to find anything that would "Reset at Start of Trading Week" so it starts summing from 0 every Sunday night or whenever the week opens. I know it is possible as @Big Mike had cum tick starting at zero on his chart every start of week. It would sum till end of week then start at 0 again at the new week.

Anyone that can guide me much appreciated (I have asked Sierra but going round in circles a bit there).

Have a great week!

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
  #2 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 249 since Jun 2011
Thanks Given: 29
Thanks Received: 364

SC has a is weekend method for a date time value. So assuming that your instrument opens on Sunday and does not trades on Saturday this should work.
https://www.sierrachart.com/index.php?page=doc/SCDateTime.html

 
Code
float& SumValue= sc.GetPersistentFloat(0);


if (sc.BaseDateTimeIn[sc.Index].IsSunday() && !sc.BaseDateTimeIn[sc.Index-1].IsSunday())
{
    SumValue = 0;
}

// do your cumulative calculation here to SumValue. Note you will probably want to do this on bar close.

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 Sawtooth 
Prescott AZ USA
 
Experience: Advanced
Platform: SierraChart
Broker: EdgeClear, FCM:Phillip, Data:Denali, Routing:Teton
Trading: YM RTY ES NQ
Posts: 478 since Nov 2009
Thanks Given: 222
Thanks Received: 606



Quoting 
I can't seem to find anything that would "Reset at Start of Trading Week" so it starts summing from 0 every Sunday night or whenever the week opens.

You could do it with the Spreadsheet Formula study, with a formula like this in its Formula field:
=IF(AND(WEEKDAY(BARDATE)=1,HOUR(BARTIME)=18),ID1.SG1,ID1.SG1+ID9.SG1[-1])
where ID1.SG1 is the study and subgraph to cumulatively sum, and ID9 is this Spreadsheet Formula study.

This will begin the cumulative summation every Sunday at 18:00.

https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html

Reply With Quote
Thanked by:
  #4 (permalink)
 deejaynv 
london
 
Experience: Intermediate
Platform: ninjatrader
Trading: YM
Posts: 10 since Jul 2016
Thanks Given: 1
Thanks Received: 4

Thanks so much for all your help!

Started this thread Reply With Quote




Last Updated on December 22, 2024


© 2025 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 - Sitemap - Downloads - Top
no new posts