NexusFi: Find Your Edge


Home Menu

 





Outside Volume indicator


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 9 posts (6 thanks)
    2. looks_two Jura with 7 posts (5 thanks)
    3. looks_3 SPTrading with 2 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 8,094 views
    2. thumb_up 13 thanks given
    3. group 2 followers
    1. forum 19 posts
    2. attach_file 4 attachments




 
Search this Thread

Outside Volume indicator

  #11 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690


Angelo1 View Post
I've been wondering about an indicator or script where volume would affect the actual price bar body in a way that if there was say a >500% volume increase then the actual Bar would expand relative to the chart to show this, no need for another viewing pane, is there such an indicator already or is this even possible?

Hi Angelo1,

As far as I know, it's not possible to conditionally change the width/size of the current (candlestick) bar.

If you don't want another viewing pane, an alternative might be to colour the candles (with PlotPaintBar) based on the volume increase or decrease. Let's say the candle closes lower than the previous low (i.e. is red), than you might use different graduations of red to display the volume of that bar. For example, a down bar on high volume can be plotted deep red, signalling excessive selling. A down bar with moderate volume might be given a 'softer' red colour, etc.

Regards,

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #12 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

I took a look at the code and am a bit confused as to why it requires real-time data to plot. Maybe I am just too tired right now to focus...

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #13 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690



Big Mike View Post
I took a look at the code and am a bit confused as to why it requires real-time data to plot. Maybe I am just too tired right now to focus...

Mike

It's (probably) a BarStatus thing. See for example this thread, where there were also some troubles with BarStatus. Why it does what it does, I don't know. Perhaps @ MultiCharts can shed some light on this.

---
Btw, if you use CurrentBar instead of BarStatus, the indicator works on historical data, but gives different results then when using BarStatus in real-time/PlayBack.

Current Bar code:
 
Code
                            
nexusfi.com (formerly BMTOutside Volume Indicator
    Based on an idea from BigMike

    
https://nexusfi.com/tradestation-multicharts-easylanguage-programming/11768-outside-volume-indicator.html
}

//Inputs:
    // none yet
    
Variables:
    
// Variables for volume calculations
    
intrabarpersist thisBarVolume(0),
    
intrabarpersist highPrevBar(0),
    
intrabarpersist lowPrevBar(0),
    
intrabarpersist volumeLastUpdate(0),
    
// Variables needed for the volume above prev high, below previous low, and inside
    
intrabarpersist volAbovePrevHigh(0),
    
intrabarpersist totalVolAbove(0),
    
intrabarpersist volBelowPrevLow(0),
    
intrabarpersist totalVolBelow(0),
    
intrabarpersist volInsideHighLow(0),
    
intrabarpersist totalVolInside(0),
    
    
intrabarpersist myCurrentBarNumber(0)
    ;
    
// Save the values from the previous bar
//if BarStatus(1) = 0 then begin
if CurrentBar <> myCurrentBarNumber then begin
    highPrevBar 
High[1];
    
lowPrevBar Low[1];
    
myCurrentBarNumber CurrentBar;
end;

// Start volume calculations 
if highPrevBar <> and lowPrevBar <> 0 then begin            // just to prevent scaling issues on the first (real-time) bar

    // Calculate the volume that's *above* the previous high
    
if Close highPrevBar then begin
        volAbovePrevHigh     
volume volumeLastUpdate;                // Volume on this bar
        
totalVolAbove         volAbovePrevHigh totalVolAbove;        // Total above volume for this bar
    
end else if Close lowPrevBar then begin
        volBelowPrevLow    
volume volumeLastUpdate;
        
totalVolBelow        volBelowPrevLow totalVolBelow;
    
end else    begin    // for inside volume
        
volInsideHighLow     volume volumeLastUpdate;
        
totalVolInside        volInsideHighLow totalVolInside;    
    
end;

    
thisBarVolume        volAbovePrevHigh volBelowPrevLow volInsideHighLow;        // Total volume for this bar    
    
volumeLastUpdate     volume;        // Saves volume of last tick
end;

// Start plotting
//if BarStatus(1) = 2 then begin

    
Plot1(totalVolAbove"Up Volume");            // Total volume of this bar above the previous high
    
Plot2(totalVolBelow"Below Volume");        // Total volume of this bar below previous low
    
Plot3(totalVolInside"Inside volume");    // Total volume of this bar inside the previous low and high

    // Reset the variables
    
thisBarVolume            0;
    
volumeLastUpdate        0;
    
volAbovePrevHigh        0;
    
totalVolAbove            0;
    
volBelowPrevLow        0;
    
totalVolBelow            0;
    
volInsideHighLow        0;
    
totalVolInside            0;
//end; 
See attachment with comparison.

Edit:
I've just noticed the Gom Indicators created by MultiCharts self also don't work on historical data but only on PlayBack/real-time data. Perhaps an analysis of volume can't be done with historical data, without adding data series. Since adding a data series with a 1 tick resolution messes up that chart, even when set to hidden, I'm afraid this can't be done with historical data. Anyone got a thought on this?

Attached Thumbnails
Click image for larger version

Name:	CurrentBarvsBarStatus.png
Views:	273
Size:	24.8 KB
ID:	42519  
Reply With Quote
  #14 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

I never tried the MultiCharts-created CDV indicators. I posted the one I am using in that thread, and it works fine on historical data.

I tried your outside vol indicator, and it is not plotting for me even with live data. I am using it on a volume chart. I haven't had time to do anything with the code, still plan to...

I believe that using the GomCD as an example (the version I am using, not MC's version) it is possible to get this to work properly on historical data.

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:
  #15 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

As for your screen shot --- One explanation is the color is being set based on the last tick intrabar vs. close of bar? I can't tell, since mine isn't plotting at all

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #16 (permalink)
 SPTrading 
London, England
 
Experience: Intermediate
Platform: MC, TS, NT
Broker: TradeStation
Trading: ES
Posts: 41 since Oct 2009
Thanks Given: 12
Thanks Received: 21


Jura View Post
It's (probably) a BarStatus thing. See for example this thread, where there were also some troubles with BarStatus. Why it does what it does, I don't know. Perhaps @ MultiCharts can shed some light on this.

I think that indicators in TS and MC don't calculate intrabar on historical data, at least not on a tick-by-tick basis. Only strategies can do that, but then they can't plot data. However, you can cheat by incorporating the code into a strategy that has a dummy buy or sell that can never get triggered. Then send the data using ADE from the strategy to an indicator to plot the data. I know it sounds absurd, but it would then work I believe.

Reply With Quote
Thanked by:
  #17 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


SPTrading View Post
I think that indicators in TS and MC don't calculate intrabar on historical data, at least not on a tick-by-tick basis. Only strategies can do that, but then they can't plot data. However, you can cheat by incorporating the code into a strategy that has a dummy buy or sell that can never get triggered. Then send the data using ADE from the strategy to an indicator to plot the data. I know it sounds absurd, but it would then work I believe.

I can't speak for TradeStation, but MultiCharts calculates tick by tick on historical data using indicators. Now, everything you said is true of NinjaTrader - but not MultiCharts.

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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #18 (permalink)
 SPTrading 
London, England
 
Experience: Intermediate
Platform: MC, TS, NT
Broker: TradeStation
Trading: ES
Posts: 41 since Oct 2009
Thanks Given: 12
Thanks Received: 21


Big Mike View Post
I can't speak for TradeStation, but MultiCharts calculates tick by tick on historical data using indicators. Now, everything you said is true of NinjaTrader - but not MultiCharts.

Mike

Mike,

To calculate indicators historically on a tick by tick basis could take an immense amount of processing time and most indicators (although not the one in question here) would end up with the same result anyway, so I don't see that this can be a default behaviour.

In MultiCharts I can only see intrabar calculations are working on the last bar. I just retested it with debug statements, and only see the intrabar tick by tick calculation occurring on the last bar, therefore realtime only.

There seems no way to change that behaviour, unlike with a strategy where you can change these settings. So I still conclude it is like TradeStation. I would be very interested to know if I am wrong about that as it would enable me to do all sorts of things more easily

Paul

Reply With Quote
Thanked by:
  #19 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690

Been busy with some projects so my response is somewhat late. Sorry for that.


Big Mike View Post
[..]I posted the one I am using in that thread, and it works fine on historical data.

You mean this one? I've imported that version, and you're right, this one works on historical data. However, as far as I can tell, this is only because this Gom version uses the UpTicks and DownTicks reserved words to calculated the delta volume. These are 'supplied' by MultiCharts self and because of that also usable with historical data. Sadly they can't be used for this indicator, since we want the up volume that happens above the previous close, not just the total up volume.


Big Mike View Post
I tried your outside vol indicator, and it is not plotting for me even with live data. I am using it on a volume chart.

That's wierd. I'm also using it on a volume chart and have no problem with PlayBack data. Do other people also experience these problems? Btw, the indicator is written in MC6.0, so it can't be any backward compatibility issues (perhaps forward, but I don't assume that to be the case).


Big Mike View Post
As for your screen shot --- One explanation is the color is being set based on the last tick intrabar vs. close of bar?

True, that might be a explanation. I haven't been able to plot an indicator on historical data tick-by-tick with using PlayBack of that data, so I'm not aware of a way to set the color based on the last tick. Perhaps someone can help us out?


SPTrading View Post
However, you can cheat by incorporating the code into a strategy that has a dummy buy or sell that can never get triggered. Then send the data using ADE from the strategy to an indicator to plot the data. I know it sounds absurd, but it would then work I believe.

Interesting, that could indeed work. Haven’t used ADE before so will need to look in that when I’ve got spare time for it.


Big Mike View Post
I can't speak for TradeStation, but MultiCharts calculates tick by tick on historical data using indicators. Now, everything you said is true of NinjaTrader - but not MultiCharts.


SPTrading View Post
In MultiCharts I can only see intrabar calculations are working on the last bar. I just retested it with debug statements, and only see the intrabar tick by tick calculation occurring on the last bar, therefore realtime only.

There seems no way to change that behaviour, unlike with a strategy where you can change these settings. So I still conclude it is like TradeStation.


SPTrading View Post
I think that indicators in TS and MC don't calculate intrabar on historical data, at least not on a tick-by-tick basis. Only strategies can do that, but then they can't plot data.

Agreed SPTrading, that is in accordance with my experiences.


SPTrading View Post
I would be very interested to know if I am wrong about that as it would enable me to do all sorts of things more easily

That makes two of us.

Does anyone has a MultiCharts indicator or code example that calculates intrabar (instead of only end-of-bar)?

Reply With Quote
  #20 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


Interesting about the intrabar comments. I just don't write many indicators or strategies any more.... but I sure thought for certain it was tick by tick on historical data. I'm calling @MultiCharts so maybe a comment can be made on that.

I haven't had a chance to do any further testing on the indicator. Sorry. Too much going on right now for 'play' time



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 Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on July 15, 2011


© 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