protected override void OnMarketData(MarketDataEventArgs e)
{
if (e.MarketDataType == MarketDataType.Ask)
{
askPrice = e.Price;
return;
}
long askVolume = e.Volume;
if (price >= askPrice)
Ask.Set (askVolume);
}
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
Variable Sum
Collapse
X
-
Variable Sum
I have an indicator which grabs all the trades at ask. It looks like this:
PHP Code:Last edited by dsraider; 01-21-2012, 03:26 PM.Tags: None
-
dsraider,
This looks like its meant to plot volume. Do you mean its meant to display the total volume at the ask price? What is the "price" variable in this example? Is Ask the data series you are attempting to plot:?
Please keep in mind OnMarketData() is updated every new tick, so your data series Ask will be quite large.
I look forward to helping you resolve your issue.Adam P.NinjaTrader Customer Service
-
Hi Adam,
At second glance, it looks as if I can simply customize the BuySellVolume indicator to suit my needs. One question for clarification, though: does that indicator plot ONLY trades that have actually gone through or is it collecting all Bids and all Asks? I can't do the math that quickly in my head.
Thanks,
DS
Comment
-
dsraider,
It looks like its getting the bid and ask volume depending. Its adding the volume between the last tick and the current tick, assigning it to buy volume or sell volume depending on if there was a buy or sell during that volume quote.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
23 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
22 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Comment