Outside Volume indicator - EasyLanguage Programming | futures io social day trading
futures io futures trading


Outside Volume indicator
Updated: Views / Replies:4,172 / 19
Created: by Big Mike Attachments:4

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 4  
 
Thread Tools Search this Thread
 

Outside Volume indicator

  #1 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,355 given, 83,237 received

Outside Volume indicator

I wanted to build an indicator that would visualize the volume of the current bar relative to the prior bar, in this way:

- how much volume of current bar is above the prior bar high?
- how much volume of current bar is below the prior bar low?
- how much volume of current bar remains as 'inside' volume relative to prior bar?

But I admit I am having a hard time getting the logic right to do this.

// current price higher than prior bar high
if C > H[1] then begin

outside_volume = ???;

end;

My issue is with tracking the outside volume amount. I'm using intrabarpersist on the var: definition, but the values are coming out as cumulative which is not what I want. So then I tried adding a BarStatus(1) = 2 check to reset the value at the close of each bar, but again desired effect is not happening.

Maybe someone can see an easier way.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
  #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)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,355 given, 83,237 received


Here is code and a screen shot. Doesn't work as-is, I need to step away and think apparently

 
Code
vars:

	IntraBarPersist outsidev	( 0 ),
	IntraBarPersist outsideupv	( 0 ),
	IntraBarPersist outsidednv	( 0 );
	
//if BarStatus(1) = 2 then outsidev = V;
outsidev = iff(C > H[1] or C < L[1], outsidev[1] - outsidev + V, outsidev);
//outsideupv = iff(C > H[1], outsidev - V, outsideupv);
//outsidednv = iff(C < L[1], V - outsidev, outsidednv);

Plot1(outsidev, "Outside Volume");
//Plot1(outsideupv, "Outside Up Volume");
//Plot2(outsidednv, "Outside Dn Volume");
You can see the couple different ways I've tried it.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Attached Thumbnails
Outside Volume indicator-6-27-2011-6-39-47-pm.png  

Last edited by Big Mike; October 3rd, 2011 at 05:53 AM.
Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
  #4 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


Big Mike View Post
I wanted to build an indicator that would visualize the volume of the current bar relative to the prior bar, in this way:

- how much volume of current bar is above the prior bar high?
- how much volume of current bar is below the prior bar low?
- how much volume of current bar remains as 'inside' volume relative to prior bar?

[..]

....the values are coming out as cumulative which is not what I want.

This is a great idea Mike. I've tried to make it work, but ironically I can't get the right cumulative values. My problem is that the first tick of the bar seems to get missed, though I've no idea why. If you, or someone else, can spot the error in my code, that would be a great help (and potentially 'solving' this problem).

Here's the output, note the line with error:

 
Code
1110516 100155 Price: 107.445 prevBarClose:107.435 UPvolume: 1 totalUpVolBar: 30518 volThisBar: 31358
1110516 100155 Price: 107.445 prevBarClose:107.435 UPvolume: 0 totalUpVolBar: 30518 volThisBar: 31358
 -8770      0 Price: 107.450 prevBarClose:107.445 UPvolume: 0 totalUpVolBar: 0 volThisBar: 0
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 0 totalUpVolBar: 0 volThisBar: 0
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 1 volThisBar: 1
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 4 totalDownVolBar: 4 volThisBar: 5
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 2 volThisBar: 6
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 3 volThisBar: 7
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 250 totalUpVolBar: 253 volThisBar: 257
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 254 volThisBar: 258
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1000 totalUpVolBar: 1254 volThisBar: 1258
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 50 totalUpVolBar: 1304 volThisBar: 1308
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 12 totalUpVolBar: 1316 volThisBar: 1320
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 15 totalUpVolBar: 1331 volThisBar: 1335
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 1332 volThisBar: 1336
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 1333 volThisBar: 1337
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 10 totalUpVolBar: 1343 volThisBar: 1347
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 1344 volThisBar: 1348
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 1345 volThisBar: 1349
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 2 totalUpVolBar: 1347 volThisBar: 1351
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 2 totalUpVolBar: 1349 volThisBar: 1353
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 19 totalUpVolBar: 1368 volThisBar: 1372
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 5 totalUpVolBar: 1373 volThisBar: 1377
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 5 totalUpVolBar: 1378 volThisBar: 1382
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 5 totalUpVolBar: 1383 volThisBar: 1387
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 10 totalUpVolBar: 1393 volThisBar: 1397
1110516 102043 Price: 107.450 prevBarClose:107.445 UPvolume: 1 totalUpVolBar: 1394 volThisBar: 1398
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 50 totalDownVolBar: 54 volThisBar: 1448
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 70 totalDownVolBar: 124 volThisBar: 1518
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 131 totalDownVolBar: 255 volThisBar: 1649
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 10 totalDownVolBar: 265 volThisBar: 1659
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 3 totalDownVolBar: 268 volThisBar: 1662
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 269 volThisBar: 1663
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 270 volThisBar: 1664
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 271 volThisBar: 1665
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 272 volThisBar: 1666
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 273 volThisBar: 1667
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 274 volThisBar: 1668
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 275 volThisBar: 1669
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 276 volThisBar: 1670
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 2 totalDownVolBar: 278 volThisBar: 1672
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 75 totalDownVolBar: 353 volThisBar: 1747
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 2 totalDownVolBar: 355 volThisBar: 1749
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 2 totalDownVolBar: 357 volThisBar: 1751
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 16 totalDownVolBar: 373 volThisBar: 1767
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 25 totalDownVolBar: 398 volThisBar: 1792
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 24 totalDownVolBar: 422 volThisBar: 1816
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 5 totalDownVolBar: 427 volThisBar: 1821
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 7 totalDownVolBar: 434 volThisBar: 1828
1110516 102043 Price: 107.445  prevBarClose: 107.445 DOWNvolume: 1 totalDownVolBar: 435 volThisBar: 1829
Note the volume in the variable 'volThisBar' of 1829... the volume in MultiCharts playback is 1828. One (!) missing tick makes this code incorrect. I don't mean that obsessive - if that one trade had a volume of 200 contracts the difference would be quite huge, so this error needs to be corrected.

Btw, I know that I can use 'volume' instead of custom calculating the volume of the bar (in the 'volThisBar' variable), but there shouldn't be any difference between the 'Up volume this bar' and 'Down volume this bar', given the conditional statements in the code.

Btw: I haven't incorporated your idea yet in the code Mike, since this version is a test to see if the underlying calculations/assumptions are correct. If they are, the logic can be easily changed to any condition.

And the code:
 
Code
                            
vars
    
intrabarpersist thisBarVolume(0),
    
intrabarpersist volumeUp(0),
    
intrabarpersist totalUpVolBar(0),
    
intrabarpersist volumeDown(0),
    
intrabarpersist totalDownVolBar(0),
    
intrabarpersist prevCloseBar(0),
    
intrabarpersist volumeLastUpdate(0)
    ;
        
if 
BarStatus(1) = 0 then begin        // save prev close on opening tick
    
prevCloseBar Close[1];
end;

if 
prevCloseBar <> 0 then begin         // wait till there is a prevClose value
    
    // Calculate volume if close is higher than previous close
    
if Close prevCloseBar then begin            // latest tick is higher then close of previous bar
    
        // Get volume of latest trade
        
if totalUpVolBar 1 then                        // checks for invalid values if tick is first of bar
            
volumeUp volume
        
else
            
volumeUp volume volumeLastUpdate// totalUpVolBar; // volumeLastUpdate;
            
        // Total up volume for this bar
        
totalUpVolBar totalUpVolBar volumeUp;
        
        
// Total volume for bar
        
thisBarVolume totalUpVolBar totalDownVolBar;
        
        Print(
date:6:0" "time_s:6:0" Price: "Close:0:3" prevBarClose:"prevCloseBar:0:3" UPvolume: ",
            
volumeUp:0:0" totalUpVolBar: "totalUpVolBar:0:0" volThisBar: "thisBarVolume:0:0);
            
    
end else begin

        
// Get volume of latest trade
        
if totalDownVolBar 1 then
            volumeDown 
volume
        
else
            
volumeDown volume volumeLastUpdate//totalDownVolBar; // volumeLastUpdate;
        
        // Total down volume for this bar
        
totalDownVolBar totalDownVolBar volumeDown;
        
        
// Total volume for bar
        
thisBarVolume totalUpVolBar totalDownVolBar;
        
        Print(
date:6:0" "time_s:6:0" Price: "Close:0:3"  prevBarClose: "prevCloseBar:0:3,
            
" DOWNvolume: "volumeDown:0:0" totalDownVolBar: "totalDownVolBar:0:0" volThisBar: "thisBarVolume:0:0);
            
    
end;
    
    
// save total volume of this tick
    
volumeLastUpdate volume;
end;
    
if 
BarStatus(1) = 2 then begin
    Plot1
(thisBarVolume"Volume");
    
Plot2(volumeUp" UpVol");
    
Plot3(-volumeDown"DownVolume");
    
    
// Reset variables
    
thisBarVolume 0;
    
volumeUp 0;
    
volumeDown 0;
    
totalDownVolBar 0;
    
totalUpVolBar 0;
    
volumeLastUpdate 0;
end

Reply With Quote
The following user says Thank You to Jura for this post:
 
  #5 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,355 given, 83,237 received

Thanks for your help, I will take a look this weekend and get back to you.



Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
 
  #6 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received

Thanks Mike, have a great 4th July weekend.

Reply With Quote
 
  #7 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received

I think I've got it fixed (will need to do more testing to know for sure).

I've added the following in the BarStatus(1) = 2 section:
 
Code
                            
    Print(date:6:0" "time_s:6:0" upVol: "totalUpVolBar:0:0" downVol: "totalDownVolBar:0:0
        
" volumeOfBar: "thisBarVolume:0:0" defaultVolume: "Volume:0:0); 
If the code should be correct, the 'volumeOfBar' should equal the 'defaultVolume', which uses the volume provided by MultiCharts.

Here's the output of that statement:
 
Code
1110516 100155 upVol: 30518 downVol: 740 volumeOfBar: 31258 defaultVolume: 31258
1110516 102043 upVol: 1471 downVol: 1969 volumeOfBar: 3440 defaultVolume: 3440
1110516 102543 upVol: 0 downVol: 4074 volumeOfBar: 4074 defaultVolume: 4074
1110516 102755 upVol: 2634 downVol: 2982 volumeOfBar: 5616 defaultVolume: 5616
1110516 104122 upVol: 507 downVol: 16874 volumeOfBar: 17381 defaultVolume: 17381
1110516 110041 upVol: 1958 downVol: 1371 volumeOfBar: 3329 defaultVolume: 3329
1110516 110236 upVol: 1631 downVol: 1028 volumeOfBar: 2659 defaultVolume: 2659
1110516 110403 upVol: 2 downVol: 4039 volumeOfBar: 4041 defaultVolume: 4041
1110516 110624 upVol: 987 downVol: 2357 volumeOfBar: 3344 defaultVolume: 3344
1110516 110744 upVol: 478 downVol: 1119 volumeOfBar: 1597 defaultVolume: 1597
1110516 110937 upVol: 2575 downVol: 19429 volumeOfBar: 22004 defaultVolume: 22004
1110516 112639 upVol: 215 downVol: 7829 volumeOfBar: 8044 defaultVolume: 8044
1110516 113901 upVol: 625 downVol: 1847 volumeOfBar: 2472 defaultVolume: 2472
1110516 114657 upVol: 3912 downVol: 869 volumeOfBar: 4781 defaultVolume: 4781
1110516 115645 upVol: 1600 downVol: 6211 volumeOfBar: 7811 defaultVolume: 7811
1110516 122043 upVol: 1 downVol: 3156 volumeOfBar: 3157 defaultVolume: 3157
1110516 122937 upVol: 3177 downVol: 3497 volumeOfBar: 6674 defaultVolume: 6674
1110516 124401 upVol: 3555 downVol: 96 volumeOfBar: 3651 defaultVolume: 3651
1110516 124926 upVol: 1072 downVol: 1549 volumeOfBar: 2621 defaultVolume: 2621
1110516 125943 upVol: 1177 downVol: 2019 volumeOfBar: 3196 defaultVolume: 3196
1110516 130334 upVol: 61 downVol: 2098 volumeOfBar: 2159 defaultVolume: 2159
1110516 130817 upVol: 472 downVol: 810 volumeOfBar: 1282 defaultVolume: 1282
1110516 131308 upVol: 2651 downVol: 3105 volumeOfBar: 5756 defaultVolume: 5756
1110516 133135 upVol: 1 downVol: 1641 volumeOfBar: 1642 defaultVolume: 1642
1110516 133627 upVol: 36 downVol: 3535 volumeOfBar: 3571 defaultVolume: 3571
1110516 135455 upVol: 1557 downVol: 7531 volumeOfBar: 9088 defaultVolume: 9088
1110516 141112 upVol: 0 downVol: 3968 volumeOfBar: 3968 defaultVolume: 3968
1110516 142108 upVol: 0 downVol: 1914 volumeOfBar: 1914 defaultVolume: 1914
1110516 142314 upVol: 1 downVol: 1293 volumeOfBar: 1294 defaultVolume: 1294
1110516 142629 upVol: 0 downVol: 3018 volumeOfBar: 3018 defaultVolume: 3018
1110516 142815 upVol: 3375 downVol: 59 volumeOfBar: 3434 defaultVolume: 3434
1110516 143019 upVol: 1119 downVol: 2048 volumeOfBar: 3167 defaultVolume: 3167
1110516 143349 upVol: 1285 downVol: 1319 volumeOfBar: 2604 defaultVolume: 2604
1110516 143822 upVol: 28 downVol: 6772 volumeOfBar: 6800 defaultVolume: 6800
1110516 144914 upVol: 28 downVol: 4808 volumeOfBar: 4836 defaultVolume: 4836
No differences anymore!

And the code:
 
Code
                            
vars
    
intrabarpersist thisBarVolume(0),
    
intrabarpersist volumeUp(0),
    
intrabarpersist totalUpVolBar(0),
    
intrabarpersist volumeDown(0),
    
intrabarpersist totalDownVolBar(0),
    
intrabarpersist prevCloseBar(0),
    
intrabarpersist volumeLastUpdate(0)
    ;
        
if 
BarStatus(1) = 0 then begin        // save prev close on opening tick
    
prevCloseBar Close[1];
end;

if 
prevCloseBar <> 0 then begin         // wait till there is a prevClose value
    
    // Calculate volume if close is higher than previous close
    
if Close prevCloseBar then begin            // latest tick is higher then close of previous bar
        
volumeUp volume volumeLastUpdate
            
        
// Total up volume for this bar
        
totalUpVolBar totalUpVolBar volumeUp;
        
        
// Total volume for bar
        
thisBarVolume totalUpVolBar totalDownVolBar;

{        
        Print(
date:6:0" "time_s:6:0" Price: "Close:0:3" prevBarClose:"prevCloseBar:0:3" UPvolume: ",
            
volumeUp:0:0" totalUpVolBar: "totalUpVolBar:0:0" volThisBar: "thisBarVolume:0:0);
}
            
    
end else begin
        volumeDown 
volume volumeLastUpdate;
                
        
// Total down volume for this bar
        
totalDownVolBar totalDownVolBar volumeDown;
        
        
// Total volume for bar
        
thisBarVolume totalUpVolBar totalDownVolBar;
{        
        Print(
date:6:0" "time_s:6:0" Price: "Close:0:3"  prevBarClose: "prevCloseBar:0:3,
            
" DOWNvolume: "volumeDown:0:0" totalDownVolBar: "totalDownVolBar:0:0" volThisBar: "thisBarVolume:0:0);
}
    
end;
    
    
// save total volume of this tick
    
volumeLastUpdate volume;
end;
    
if 
BarStatus(1) = 2 then begin

    
// Print data to verify
    
Print(date:6:0" "time_s:6:0" upVol: "totalUpVolBar:0:0" downVol: "totalDownVolBar:0:0
        
" volumeOfBar: "thisBarVolume:0:0" defaultVolume: "Volume:0:0);

    
//Plot1(thisBarVolume, "Volume");
    
Plot2(totalUpVolBar" UpVol");
    
Plot3(-totalDownVolBar"DownVolume");
    
    
// Reset variables
    
thisBarVolume 0;
    
volumeUp 0;
    
volumeDown 0;
    
totalDownVolBar 0;
    
totalUpVolBar 0;
    
volumeLastUpdate 0;
end
I'm wondering how this might be added for historical charts - the current version only works on real-time data or Playback. Adding a data series with a 1 tick resolution messes up the layout of the primary data series, which makes this not a viable solution. Anyone got an idea?

Regards,

Reply With Quote
The following user says Thank You to Jura for this post:
 
  #8 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received

See attached futures.io (formerly BMT) Outside Volume indicator. Usable on real-time data or PlayBack data.

Perhaps the plot style can use some further styling (I'm not sure this is the most clearly visible style). Any other feedback is off course highly welcomed.

Regards,


---
Code:
 
Code
                            
futures.io (formerly BMTOutside Volume Indicator
    Based on an idea from BigMike

    
https://futures.io/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)
    ;
    
// Save the values from the previous bar
if BarStatus(1) = 0 then begin
    highPrevBar 
High[1];
    
lowPrevBar Low[1];
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

Attached Thumbnails
Outside Volume indicator-bmtoutsidevolumeexample.png  
Attached Files
Register to download File Type: pla BMT Outside Volume.pla (7.6 KB, 35 views)
Reply With Quote
The following 3 users say Thank You to Jura for this post:
 
  #9 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,355 given, 83,237 received

Very nice, Jura. Sorry I've had no time to do any more with it. I have been so busy lately, and today I just kind of zoned out and watched TV and tried to relax. But I'll look at your indicator shortly and appreciate your help.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #10 (permalink)
Trading's simple not easy
Adelaide Australia
 
Futures Experience: Intermediate
Platform: Ninja > MC
Broker/Data: AMPs
Favorite Futures: ES
 
Angelo1's Avatar
 
Posts: 99 since May 2011
Thanks: 1,425 given, 53 received

Outside Volume Ind


Hey Mike Jura

Happy anniversary & 4th

Not quite sure what the function of this ind represents, any way 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?

Angelo1

Reply With Quote

Reply



futures io > > > > > Outside Volume indicator

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Volume alert indicator gain247 The Elite Circle 160 September 11th, 2015 07:46 PM
Volume Profile indicator Zsolt NinjaTrader 5 August 15th, 2011 11:10 AM
Volume count indicator. hector24 NinjaTrader 6 April 15th, 2011 02:50 AM
Volume breakdown indicator mysthars The Elite Circle 107 December 13th, 2010 03:16 PM
Where can I can get volume break down indicator s250643 NinjaTrader 2 March 20th, 2010 12:11 PM


All times are GMT -4. The time now is 05:52 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-12-17 in 0.15 seconds with 20 queries on phoenix via your IP 54.163.210.170