protected override void OnBarUpdate() { if (CurrentBar < activeBar || CurrentBar <= BarsRequiredToPlot) return; // New Bar has been formed // - Assign last volume counted to the prior bar // - Reset volume count for new bar if (CurrentBar != activeBar) { Sells[1] = sells; Buys[1] = buys + sells; buys = 0; sells = 0; activeBar = CurrentBar; } Sells[0] = sells; Buys[0] = buys + sells; }
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
why is BuyVolume buys+sells
Collapse
X
-
why is BuyVolume buys+sells
In the official BuySellVolume, the Buy volume is buys+sells, but why ? Normally buys+sells is the entire volume and BuyVolume should be buys only right ?
Code:Tags: None
-
Hello alanlopen,
Because that indicator uses two plots that overlay as bars the buys would not be visible if only the buy data was included in that plot. This indicator is for visual only purposes. You can use similar logic to that in your own script if you wanted to accumulate data from OnMarketData and did not need to visualize it, you would in that case use just the buy volume for buys.JesseNinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by RaddiFX, Today, 10:15 AM
|
2 responses
14 views
0 likes
|
Last Post
by RaddiFX
Today, 09:33 PM
|
||
Started by patrickmlee007, Today, 09:33 AM
|
2 responses
17 views
0 likes
|
Last Post Today, 08:56 PM | ||
Started by magnatauren, 08-15-2020, 02:12 PM
|
5 responses
206 views
0 likes
|
Last Post
by RaddiFX
Today, 08:46 PM
|
||
Started by rene69851, 05-02-2024, 03:25 PM
|
1 response
22 views
0 likes
|
Last Post
by rene69851
Today, 08:20 PM
|
||
Started by ETFVoyageur, Yesterday, 07:05 PM
|
5 responses
45 views
0 likes
|
Last Post
by ETFVoyageur
Today, 08:08 PM
|
Comment