NexusFi: Find Your Edge


Home Menu

 





A little help with Marney Volume Indicator for MC


Discussion in EasyLanguage Programming

Updated
    1. trending_up 4,727 views
    2. thumb_up 4 thanks given
    3. group 1 followers
    1. forum 6 posts
    2. attach_file 5 attachments




 
Search this Thread
  #1 (permalink)
 
Laurus12's Avatar
 Laurus12 
Norway
 
Experience: Advanced
Platform: MultiCharts, CQG, NinjaTrader
Broker: CQG, DTN IQFeed
Trading: EURO
Posts: 376 since Nov 2010
Thanks Given: 566
Thanks Received: 364

I am wondering if someone could please help me with the layer order of the volume bars and time adjusted moving average in Marney's volume indicator. With the original code and MC the time adjusted moving average is in the back of the volume bars, but I would like to have it in the front.

I am aware that TS and MC has opposite layer order from which order the plotting is set up in the code, but with this indicator I am not able to figure out how to reverse it.

Another thing is that it is not possible to change the weight of the time adjusted average line. If this could be done something with, that would have been nice.

I have only added RGB color control to the code, which is not in the original code:

 
Code
{***********************************************}
{Marney Indicator(TM) - Marney Volume Indicator(TM)
Copyright Caspar Marney, Marney Capital 2010(C)} 
{***********************************************}

input: avgLen(25), mins.in.session(1440), autobars(False), upcolor(RGB(0, 140, 0)), dncolor(RGB(230, 0, 0));
var: start(0), end1(0), end2(0), x(0), p(-1), count(0), avg(0), barsinday(0), DayNumber(0); 
array: xv[199,1440](0);  
 
if bartype < 2 then begin 
 
start= (sessionstarttime(1,1)); 
end1= (sessionendtime(1,1)); 
end2= (sessionendtime(1,2)); 
 
value1 = timetominutes(start); 
value2 = timetominutes(end2); 
if start > end2 then 
value3 = 1440+(value2-value1); 
 
if start < end2 then 
	value3 = -(value1-value2); 
if autobars = false then value3 = mins.in.session; 
	 
barsinday = ceiling(value3/barinterval); 
 
 
if d<>d[1] then begin  
    if count=barsinday then begin  
        p=iff(p<avgLen-1,p+1,0);  
        for x=1 to barsinday begin  
            xv[p,x]=ticks[barsinday+1-x];  
        end;  
    end;  
    count=1;  
end else count=count+1;  

if xv[avgLen-1,count]>0 then begin  
    avg=0;  
    for x=0 to avgLen-1 begin  
        avg=avg+xv[x,count];  
    end;  
    avg=avg/avgLen;
   plot2(ticks,"ticks",default,1);
   plot1(avg,"avg",yellow,default,1);
end; 

if close > open then setplotcolor(2,upcolor); 
if close < open then setplotcolor(2,dncolor); 
 
end; 
 
if bartype > 1 then begin 
    avg = averagefc(v,avglen); 
    plot2(v,"ticks",default,1); 
    plot1(avg,"avg",yellow,default,1);
     
    if close > open then setplotcolor(2,upcolor); 
    if close < open then setplotcolor(2,dncolor); 
end;
Thanks,
Laurus


“If you wish to see the truth, then hold no opinions for or against anything.” - Hsin Hsin Ming
Attached Thumbnails
Click image for larger version

Name:	moving average to the front.png
Views:	404
Size:	6.3 KB
ID:	53607  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
ATFX Suspends Prop Trading Unit ATFunded -- Full Review …
Funded Trading Evaluation Firms
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583


Maybe I am not understanding.... but if Plot2 is "on top of" Plot1, then why not just make Plot2 -> Plot1, and Plot1 -> Plot2.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
Laurus12's Avatar
 Laurus12 
Norway
 
Experience: Advanced
Platform: MultiCharts, CQG, NinjaTrader
Broker: CQG, DTN IQFeed
Trading: EURO
Posts: 376 since Nov 2010
Thanks Given: 566
Thanks Received: 364

Thank you for the reply Mike.

I have tried the normal layer order procedure, but for some reason I do not understand the coloring becomes wrong.

When I do like in the code below the average is on top and both the volume and the average displays correct values as shown in the attached picture, but as one can see the coloring is somewhat reversed. The insert settings is correct.

 
Code
avg=avg/avgLen; 
   plot1(ticks,"ticks",default,1);
   plot2(avg,"avg",black,default,1); 
end;
 
 
if close > open then setplotcolor(2,upcolor);
if close < open then setplotcolor(2,dncolor);
 
end;
 
if bartype > 1 then begin
       avg = averagefc(v,avglen);
       plot1(v,"ticks",default,1);
       plot2(avg,"avg",black,default,1);
               
if close > open then setplotcolor(2,upcolor);
if close < open then setplotcolor(2,dncolor);
 
end;
Laurus


“If you wish to see the truth, then hold no opinions for or against anything.” - Hsin Hsin Ming
Attached Thumbnails
Click image for larger version

Name:	average ok, but colors wrong.png
Views:	287
Size:	6.7 KB
ID:	53705  
Started this thread Reply With Quote
  #5 (permalink)
 
Laurus12's Avatar
 Laurus12 
Norway
 
Experience: Advanced
Platform: MultiCharts, CQG, NinjaTrader
Broker: CQG, DTN IQFeed
Trading: EURO
Posts: 376 since Nov 2010
Thanks Given: 566
Thanks Received: 364

For those interested in knowing some more about Caspar Marney's Volume and Range indicators I would recommend starting here.

Caspar Marney's website with more articles are here.

Note that Mr. Marney is mainly going into the relationship between actual trade volume and tick volume for Spot FX, but his indicators and the principle behind them can be used with other markets and volatility also.


Laurus


“If you wish to see the truth, then hold no opinions for or against anything.” - Hsin Hsin Ming
Started this thread Reply With Quote
  #6 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,583

the SetPlotColor() code would need to be updated to the new plots (2 --> 1, 1 --> 2). Also you need to be removing the indicator and re-adding it to MultiCharts, as changing Plots without doing so doesn't always work.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
 
Laurus12's Avatar
 Laurus12 
Norway
 
Experience: Advanced
Platform: MultiCharts, CQG, NinjaTrader
Broker: CQG, DTN IQFeed
Trading: EURO
Posts: 376 since Nov 2010
Thanks Given: 566
Thanks Received: 364

Great! That's more like it. Thanks a lot Mike. Learned something new here.


Attaching both the Volume and Range indicators in "MC style" with the time adjusted moving average on top.

With Futures one have to set "autobars" to "true". Then for the FX futures I have set average to 24 periods and "mins.in.session" to 1380.

Unfortunately the indicators are only meant to be used with 60 minute bars. From what I have read Mr. Marney has not come up with a solution for like 15 and 5 minute bars yet.


Laurus


“If you wish to see the truth, then hold no opinions for or against anything.” - Hsin Hsin Ming
Attached Thumbnails
Click image for larger version

Name:	Marney Volume and EURO.png
Views:	308
Size:	11.7 KB
ID:	53928  
Attached Files
Elite Membership required to download: _Marney Volume Indicator.pla
Elite Membership required to download: _Marney Range Indicator.pla
Started this thread Reply With Quote
Thanked by:




Last Updated on November 2, 2011


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