Relative Volume for MC - futures io
futures io futures trading



Relative Volume for MC


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one bmtrading9 with 4 posts (0 thanks)
    2. looks_two ABCTG with 2 posts (1 thanks)
    3. looks_3 Jura with 1 posts (2 thanks)
    4. looks_4 rolandw85 with 1 posts (0 thanks)
    1. trending_up 3,166 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 9 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Relative Volume for MC

(login for full post details)
  #1 (permalink)
Atlanta, GA, USA
 
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
 
Posts: 1,834 since Mar 2013
Thanks: 3,000 given, 2,153 received

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;

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on futures io?
Cross border fund flows / fx correlations
Treasury Notes and Bonds
Which kind of Blockvolume is visible? - order processing
Emini and Emicro Index
MACD line not plotting after change of plot order
NinjaTrader
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Selling Options on Futures?
108 thanks
Battlestations: Show us your trading desks!
99 thanks
Rank your Futures vs Stocks trading priority
54 thanks
Want your NinjaTrader indicator created, free?
26 thanks
Whats this confusion with margins?
23 thanks
 
(login for full post details)
  #3 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received


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

Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
 
(login for full post details)
  #4 (permalink)
Atlanta, GA, USA
 
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
 
Posts: 1,834 since Mar 2013
Thanks: 3,000 given, 2,153 received


ABCTG View Post
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

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
The Netherlands
 
Experience: None
Platform: MultiCharts, TradingView
Trading: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 688 received


bmtrading9 View Post
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.

Reply With Quote
The following 2 users say Thank You to Jura for this post:
 
(login for full post details)
  #6 (permalink)
Atlanta, GA, USA
 
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
 
Posts: 1,834 since Mar 2013
Thanks: 3,000 given, 2,153 received


Jura View Post
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

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
Atlanta, GA, USA
 
Experience: Advanced
Platform: MC and Jigsaw
Trading: ES, MES
 
Posts: 1,834 since Mar 2013
Thanks: 3,000 given, 2,153 received


Jura View Post
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

Follow me on Twitter Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
Singapore
 
Experience: Advanced
Platform: Multicharts
Trading: ES
 
Posts: 2 since Jul 2014
Thanks: 0 given, 0 received

I have the same issue. Ticking off update every tick does not help. Can anyone help here?

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 
 
Posts: 2,230 since Apr 2013
Thanks: 409 given, 1,471 received

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 View Post
I have the same issue. Ticking off update every tick does not help. Can anyone help here?


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #10 (permalink)
London
 
Experience: Intermediate
Platform: Tradestation
Trading: equities, options
 
Posts: 7 since Nov 2019
Thanks: 0 given, 1 received


hey did you ever get a working RVOL?

Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Relative Volume for MC


Last Updated on February 21, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts