NexusFi: Find Your Edge


Home Menu

 





Cumulative Volume Study


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one omni72 with 12 posts (5 thanks)
    2. looks_two vegasfoster with 7 posts (7 thanks)
    3. looks_3 FGBL07 with 3 posts (6 thanks)
    4. looks_4 ChrisTinaBruce with 3 posts (1 thanks)
      Best Posters
    1. looks_one Jigsaw Trading with 3.5 thanks per post
    2. looks_two FGBL07 with 2 thanks per post
    3. looks_3 vegasfoster with 1 thanks per post
    4. looks_4 omni72 with 0.4 thanks per post
    1. trending_up 15,500 views
    2. thumb_up 36 thanks given
    3. group 13 followers
    1. forum 37 posts
    2. attach_file 8 attachments




 
Search this Thread

Cumulative Volume Study

  #21 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624


vegasfoster View Post
I'm making some progress with @ktrader idea, it's doing something, unfortunately just not what I want yet.

That's awesome that you're seeing progress! Looking forward to your updates

I stumbled across this thread, but have not had a chance to check it out to see if it does what I'm looking for:

WishList - [AUTOLINK]Relative Volume[/AUTOLINK] Indicator / table - Sierra Chart

Here is the code JackW provided:

 
Code
#include "sierrachart.h"
SCDLLName("RelativeVolume") 

int RVCalc(SCDateTimeArrayRef DateTimeIn, SCBaseDataRef DataIn, c_ArrayWrapper<s_SCSubgraph_260> SgOut, int position, int lookback);

SCSFExport scsf_RelativeVolume(SCStudyGraphRef sc) 
{ 
    if (sc.SetDefaults) 
    { 
        sc.GraphName = "Relative Volume";
        sc.ValueFormat = 0;
        sc.Subgraph[0].Name = "Volume";
        sc.Subgraph[0].DrawStyle = DRAWSTYLE_BAR;
        sc.Subgraph[0].LineWidth = 2;
        sc.Subgraph[0].PrimaryColor = RGB(0,134,77);
        sc.Subgraph[0].SecondaryColor = RGB(192,0,0);
        sc.Subgraph[0].SecondaryColorUsed = 1;
        sc.Subgraph[0].AutoColoring = AUTOCOLOR_POSNEG;
        sc.Subgraph[1].Name = "Zero Line";
        sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;
        sc.Subgraph[1].LineWidth = 1;
        sc.Subgraph[1].PrimaryColor = RGB(0,0,0);
        sc.Input[0].Name = "Lookback (>=5)";
        sc.Input[0].SetInt(5);
        sc.Input[0].SetIntLimits(5,10000);
        sc.DrawZeros = 0;
        sc.FreeDLL = 0;
        return; 
    } 

    int position, lookback = sc.Input[0].GetInt();

    if (sc.Index != 0)
    {
        position = sc.Index - 1;
       while (++position < sc.ArraySize) RVCalc(sc.BaseDateTimeIn, sc.BaseData, sc.Subgraph, position, lookback);
    }
    else
    {
        position = sc.ArraySize;
        while (--position > 0)
        {
            if (RVCalc(sc.BaseDateTimeIn, sc.BaseData, sc.Subgraph, position, lookback) == 1)
            {
                if (position == sc.ArraySize - 1) sc.AddMessageToLog("ERROR: Insufficient Bars Loaded to Run Study.",1);
                break;
            }
        }   
    }
    return;
}

int RVCalc(SCDateTimeArrayRef DateTimeIn, SCBaseDataRef DataIn, c_ArrayWrapper<s_SCSubgraph_260> SgOut, int position, int lookback)
{
    double cumvol = 0;
    int counter = 0, offset = position;
    while (--offset >= 0 && counter < lookback)
    {
        if (DateTimeIn.TimeAt(position)*1  == DateTimeIn.TimeAt(offset)*1)
        {
            counter++;
            cumvol += DataIn[SC_VOLUME][offset];
        }
    }
    if (counter == lookback)
    {
        SgOut[0][position] = (100 * DataIn[SC_VOLUME][position] / (cumvol / lookback)) - 100;
        SgOut[1][position] = 0;
        return(0);
    }
    return(1);
}
I included the code for RelativeVolume instead of RelativeVolume2 because the second version streams updates from the study to the message log. It's my understanding that was the only update.

Hope that is helpful and thanks again for looking into this stuff

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
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
  #22 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

I'm not making progress. The sc.GetNearestMatchForSCDateTime function returns zero for an exact match or 1 for the closest match, as far as I can figure it doesn't not return the correlated sc.index number, which is what I need for my remedial train of thought. I will look at the code you referenced, but he said it only works on time bars though, which I really would like this to work on any type of bars, since I don't use time bars. It may give me some more ideas and hopefully we can knock this out before New Years.......................2014.

Reply With Quote
Thanked by:
  #23 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624



vegasfoster View Post
I'm not making progress. The sc.GetNearestMatchForSCDateTime function returns zero for an exact match or 1 for the closest match, as far as I can figure it doesn't not return the correlated sc.index number, which is what I need for my remedial train of thought. I will look at the code you referenced, but he said it only works on time bars though, which I really would like this to work on any type of bars, since I don't use time bars. It may give me some more ideas and hopefully we can knock this out before New Years.......................2014.

I agree that there may be utility in discerning relative volume for different market quantifications (i.e. range, ticks, etc.), I'm just thinking time buckets would be the the least tricky to deal with. But I could be waaaaaaaaay off on that assumption.

I've got faith in your efforts Fwiw, I've started poking around a bit in the ACSIL stuff. My guess is that my current level redefines remedial

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote
  #24 (permalink)
 
traveller's Avatar
 traveller 
Vancouver, Canada
 
Experience: Beginner
Platform: SC
Trading: Guitar
Posts: 118 since Mar 2012
Thanks Given: 222
Thanks Received: 181

This would be a great study to have with Variable time periods!

I'm not a programmer at all so can't contribute in the least except to sing a little cheer leading song from the sidelines!


"Let's get fired up
Get rough, get tough, get mean
Let's get fired up
and roll right over that team!"

"Train yourself to let go of everything you fear to lose."
-Yoda, Star Wars Episode III Revenge of the Sith
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #25 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624

I'm wondering if there's a chance of porting the logic/effort from @Fat Tails:



and @vvhg:



To echo traveller's sentiments, programming isn't exactly my bag so I'm hoping I can at least stay in harmony with the cheer

Btw, I haven't got to read through the seasonality thread, but just skimming it looked like it is related to the general idea of relative volume and volatility.

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote
Thanked by:
  #26 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624

Came across another seemingly related thread:

Normalized Volume Study. - Sierra Chart

Again, I have not read through it yet so I can't say if there will be transferable concepts. The thread includes CPP and DLL files.

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote
  #27 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

I have the cumulative volume part figured out for the current day, as expected it ended up being very simple, as in 4 lines of code simple, and it will work on any bar type. I think creating the average of prior days will be easy, but I had thought this part was going to be easy as well and we know how that turned out. I also have to work on the single bar logic for time charts, but again I don't think that will be difficult now. The default will be cumulative volume from the specified time, but if set to "No" then it will only compare the current bar's volume to prior days' average of the specified period.

I'm pretty jammed up tomorrow and Friday, but should get back on it Saturday. I will also take a look at the links you provided. We are definitely on schedule for our New Years' 2019 completion date.


Reply With Quote
Thanked by:
  #28 (permalink)
 
omni72's Avatar
 omni72 
Tulsa, OK
 
Posts: 348 since Jan 2012
Thanks Given: 582
Thanks Received: 624


vegasfoster View Post
I have the cumulative volume part figured out for the current day, as expected it ended up being very simple, as in 4 lines of code simple, and it will work on any bar type. I think creating the average of prior days will be easy, but I had thought this part was going to be easy as well and we know how that turned out. I also have to work on the single bar logic for time charts, but again I don't think that will be difficult now. The default will be cumulative volume from the specified time, but if set to "No" then it will only compare the current bar's volume to prior days' average of the specified period.

I'm pretty jammed up tomorrow and Friday, but should get back on it Saturday. I will also take a look at the links you provided. We are definitely on schedule for our New Years' 2019 completion date.


Excellent news and progress @vegasfoster!

That 2019 goal date is well within reach now! Looking forward to the next installment and if there is anything I can do to help, just let me know.

Luck is what happens when preparation meets opportunity. ~ Seneca
Started this thread Reply With Quote
  #29 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

Making progress, but if a good programmer wants to knock this out then it's not too late and I won't be offended, nope.

Reply With Quote
  #30 (permalink)
 dBassFour 
New York, NY
 
Experience: Beginner
Platform: Sierra Charts, NT7, TOS
Trading: Emini, NQ,
Posts: 68 since May 2016
Thanks Given: 33
Thanks Received: 56



vegasfoster View Post
Making progress, but if a good programmer wants to knock this out then it's not too late and I won't be offended, nope.

Hey guys, did anyone ever figure this out for Sierra? I saw it on Peter Davies chart once, and I've been looking for it which is why I stumbled on this thread.

Follow me on Twitter Reply With Quote




Last Updated on August 13, 2018


© 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