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)
Relative Volume for MC
Updated February 22, 2020
Top Posters
looks_one
bmtrading9
with 4 posts (0 thanks)
looks_two
ABCTG
with 2 posts (1 thanks)
looks_3
Jura
with 1 posts (2 thanks)
looks_4
rolandw85
with 1 posts (0 thanks)
trending_up
4,461 views
thumb_up
3 thanks given
group
3 followers
forum
9 posts
attach_file
0 attachments
Relative Volume for MC
September 15th, 2016, 02:55 PM
Atlanta, GA, USA
Market Wizard
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
Posts: 1,833 since Mar 2013
Thanks Given: 3,001
Thanks Received: 2,159
Would anyone please take a look at this code, this code seems to work properly on historical data but not in real time. This is relative volume indicator works on min chart only.
@ABCTG any help?
Code
// __RACumVol - Average Cumulative Volume at this time for the last X days.
// Must be used on minute-type intraday charts
Inputs:
DaysToAvg(14);
Variables:
BarInDay(0),
BarsToday(0),
CumVolToday(0),
DayNumber(-99),
BarsPerDay(26),
TotCumVol(0),
AvgCumVol(0),
VolPercentile(0);
// Declare the array. Rows = number of days to average; columns = number of bars per day.
// Add one to rows to avoid using row 0.
IF BarType = 1 then
BEGIN
value1 = TimeToMinutes(SessionEndTime(0,1)) - TimeToMinutes(SessionStartTime(0,1));
value1 = value1/BarInterval;
If FracPortion(value1) = 0 then
BarsPerDay = value1
else
BarsPerDay = value1 + 1 - FracPortion(value1);
//Arrays: VolArray[22,405] (0); // Note max bars of 405 ( 1 minute 9:30 - 16:15 )
Arrays: VolArray[22,495] (0); // Note max bars of 495 ( 1 minute 8:00 - 16:15 )
If Date<>Date[1] THEN
BEGIN
//If we've passed day 20, then move everybody back a seat.
// All of day 2's data in the array goes into day 1, day 3 into day 2, etc, up through 21 into day 20.
IF DayNumber+1 > DaysToAvg +1 THEN
BEGIN
For Value1=1 to DaysToAvg Begin; {Outer loop - one for each day, 1-20 + current day }
For Value2 = 1 to BarsPerDay Begin; {Inner Loop - one for each bar in a day, 1-26}
VolArray[Value1,Value2] = Volarray[Value1+1 ,Value2];
End;
End;
END;
// Start/Increment Day Counter. It never goes above 21.
IF Daynumber = -99 THEN DayNumber = 1 {Start of first full day on the chart}
ELSE DayNumber = MinList(DayNumber+1,DaysToAvg+1) ; {Start of a subsequent day, never goes above 21}
// Reset cumulative daily bar and volume counters, since on first bar of a new day.
CumVolToday = 0;
BarsToday = 0;
// Clear out array row number (days to average + 1) for today's data. Previously moved it into day 20 in the array.
IF DayNumber >= DaysToAvg + 1 THEN
For Value2 = 1 to BarsPerDay Begin
VolArray[DaysToAvg + 1, Value2] = 0;
End;
END; {tasks for first bar of each day}
IF Daynumber <> -99 THEN
BEGIN
// Increment bar and volume counters.
BarsToday = BarsToday + 1;
CumVolToday = CumVolToday + Volume;
// Store today's cumulative volume into the array, in the column for this bar.
VolArray[DayNumber, BarsToday] = CumVolToday;
END;
// Now calculate the 20-day cumulative average volume through this bar, if we have enough data.
If Daynumber > DaysToAvg THEN
BEGIN
TotCumVol = 0;
// Add up the cumulative volume through this time for each of the past 20 days.
For Value3 = 1 To DaysToAvg Begin
TotCumVol = TotCumVol + VolArray[Value3, BarsToday];
End;
// And divide it by the number of days to get the average cumulative daily volume through this time of day.
AvgCumVol = IntPortion(TotCumVol / DaysToAvg);
// Now compare today's ccumulative volume to the average.
VolPercentile = IFF(AvgCumVol > 0, CumVolToday *100 / AvgCumVol, 0);
Plot1(VolPercentile-100,"VPctAvg");
Plot2(0,"100%");
//plot1(value1, "TotalCumVol");
//plot1(VolPercentile, "AvgCumVol");
//plot1((TotCumVol-CumVolToday)/AvgCumVol, "CumVolToday");
END;
END;
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
September 16th, 2016, 02:48 AM
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623
bmtrading9,
what does your debugging show i.e. what happens within the code on realtime bars versus live data? Looking into this will be the first step in tracking the problem down.
Regards,
ABCTG
The following user says Thank You to ABCTG for this post:
September 16th, 2016, 02:40 PM
Atlanta, GA, USA
Market Wizard
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
Posts: 1,833 since Mar 2013
Thanks Given: 3,001
Thanks Received: 2,159
ABCTG
bmtrading9,
what does your debugging show i.e. what happens within the code on realtime bars versus live data? Looking into this will be the first step in tracking the problem down.
Regards,
ABCTG
I have to find it out how to debug in MC, If you plot it it will plot perfectly on historical min data but if you watch this indicator real time, plot is way different worst part is I don't even remember where I got this code, it looks like TS code.
Sent from my SAMSUNG-SM-G900A using Tapatalk
September 17th, 2016, 01:49 AM
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690
bmtrading9
I have to find it out how to debug in MC, If you plot it it will plot perfectly on historical min data but if you watch this indicator real time, plot is way different worst part is I don't even remember where I got this code, it looks like TS code.
It may be TS code, but none of the statements contain something that isn't possible in MultiCharts .
What are your indicator settings in real time? From your description, I suspect you're using the 'Update on every tick' setting enabled. With that option, the indicator processes every real time tick. Since MultiCharts indicators only calculate on the close of each bar on historical data, in effect your indicator will calculate differently on historical data (once per bar) than on real-time data (numerous times per bar).
I would disable the 'Update on every tick' option and then see how the behaviour in real time is. Here's more on that setting: Wiki: Update on every tick .
The following 2 users say Thank You to Jura for this post:
September 17th, 2016, 07:24 AM
Atlanta, GA, USA
Market Wizard
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
Posts: 1,833 since Mar 2013
Thanks Given: 3,001
Thanks Received: 2,159
Jura
It may be TS code, but none of the statements contain something that isn't possible in
MultiCharts .
What are your indicator settings in real time? From your description, I suspect you're using the 'Update on every tick' setting enabled. With that option, the indicator processes every real time tick. Since MultiCharts indicators only calculate on the close of each bar on historical data, in effect your indicator will calculate differently on historical data (once per bar) than on real-time data (numerous times per bar).
I would disable the 'Update on every tick' option and then see how the behaviour in real time is. Here's more on that setting:
Wiki: Update on every tick .
Thanks, that might be it I will verify it on Monday
Sent from my SAMSUNG-SM-G900A using Tapatalk
September 20th, 2016, 07:36 AM
Atlanta, GA, USA
Market Wizard
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
Posts: 1,833 since Mar 2013
Thanks Given: 3,001
Thanks Received: 2,159
Jura
It may be TS code, but none of the statements contain something that isn't possible in
MultiCharts .
What are your indicator settings in real time? From your description, I suspect you're using the 'Update on every tick' setting enabled. With that option, the indicator processes every real time tick. Since MultiCharts indicators only calculate on the close of each bar on historical data, in effect your indicator will calculate differently on historical data (once per bar) than on real-time data (numerous times per bar).
I would disable the 'Update on every tick' option and then see how the behaviour in real time is. Here's more on that setting:
Wiki: Update on every tick .
Nope, didn't solve it. Same issue.
Sent from my SAMSUNG-SM-G900A using Tapatalk
January 30th, 2019, 09:14 PM
Singapore
Experience: Advanced
Platform: Multicharts
Trading: ES
Posts: 2 since Jul 2014
Thanks Given: 0
Thanks Received: 0
I have the same issue. Ticking off update every tick does not help. Can anyone help here?
January 31st, 2019, 03:13 AM
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623
sage08,
please describe the exact issue you are having and the explain the chart setup you are applying this indicator to (i.e. symbol, interval, amount of history etc. everything that would be required to reproduce what you are seeing).
Regards,
ABCTG
sage08
I have the same issue. Ticking off update every tick does not help. Can anyone help here?
February 21st, 2020, 09:55 PM
London
Experience: Intermediate
Platform: Tradestation
Trading: equities, options
Posts: 12 since Nov 2019
Thanks Given: 0
Thanks Received: 6
hey did you ever get a working RVOL ?
Last Updated on February 21, 2020