Relative Volume for MC - EasyLanguage Programming | futures io social trading
futures io futures trading


Relative Volume for MC
Updated: Views / Replies:353 / 6
Created: by bmtrading9 Attachments:0

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


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, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

Relative Volume for MC

  #1 (permalink)
Elite Member
Dallas, TX, USA
 
Futures Experience: Advanced
Platform: TOS
Broker/Data: IB
Favorite Futures: ES, YM, TF, CL, GC and ETF's
 
Posts: 1,679 since Mar 2013
Thanks: 2,733 given, 1,872 received

Relative Volume for MC

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;

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,328 since Apr 2013
Thanks: 211 given, 753 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

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Elite Member
Dallas, TX, USA
 
Futures Experience: Advanced
Platform: TOS
Broker/Data: IB
Favorite Futures: ES, YM, TF, CL, GC and ETF's
 
Posts: 1,679 since Mar 2013
Thanks: 2,733 given, 1,872 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

Reply With Quote
 
  #5 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: -
 
Jura's Avatar
 
Posts: 766 since Apr 2010
Thanks: 2,347 given, 653 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:
 
  #6 (permalink)
Elite Member
Dallas, TX, USA
 
Futures Experience: Advanced
Platform: TOS
Broker/Data: IB
Favorite Futures: ES, YM, TF, CL, GC and ETF's
 
Posts: 1,679 since Mar 2013
Thanks: 2,733 given, 1,872 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

Reply With Quote
 
  #7 (permalink)
Elite Member
Dallas, TX, USA
 
Futures Experience: Advanced
Platform: TOS
Broker/Data: IB
Favorite Futures: ES, YM, TF, CL, GC and ETF's
 
Posts: 1,679 since Mar 2013
Thanks: 2,733 given, 1,872 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

Reply With Quote

Reply



futures io > > > > > Relative Volume for MC

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

FIO Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

May
 

Portfolio Diversification w/Brendon Delate @ Diversify Portfolio

Elite only

An overview of volumetric analytical tools w/Sergey Sokolov @ PTMC

Elite only

John Hoagland (TBA)

Elite only

FuturesTrader71 Extended Ask Me Anything (AMA)

Elite only

Pete @ Jigsaw Trading (TBA)

Elite only

John @ No BS Day Trading (TBA)

Elite only

An Afternoon with FIO member Softsoap (being rescheduled)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative Volume Indicator soulartist NinjaTrader 98 August 21st, 2016 03:51 PM
Relative Volume for Sierra Chart Big Mike Sierra Chart 38 April 19th, 2016 02:59 PM
Relative Volume steve2222 Terms (Glossary) 0 February 13th, 2016 02:12 AM
Using Relative Volume halperin Emini Index Futures Trading 2 August 19th, 2015 05:07 PM
A little help with Marney Volume Indicator for MC Laurus12 EasyLanguage Programming 6 November 2nd, 2011 06:57 PM


All times are GMT -4. The time now is 12:28 PM.

Copyright © 2017 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
Page generated 2017-05-25 in 0.12 seconds with 19 queries on phoenix via your IP 54.198.118.102