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
DOM data
Collapse
X
-
Thanks.
What's the different between last and ask/bid? Is last either a price hit at the bid or ask?
protected override void OnMarketData(MarketDataEventArgs e)
{
// Print some data to the Output window
if (e.MarketDataType == MarketDataType.Last)
Print("Last = " + e.Price + " " + e.Volume);
else if (e.MarketDataType == MarketDataType.Ask)
Print("Ask = " + e.Price + " " + e.Volume);
else if (e.MarketDataType == MarketDataType.Bid)
Print("Bid = " + e.Price + " " + e.Volume);
}
So, if I want to know how many contracts sold at ask, then I will do
if MarketDataType.Ask
then Volume is the contracts sold at ask ?
If I want to detect the price has moved one level of depth, then I will do:
if MarketDataType.Ask is greater than previous MarketDataType.Ask, then
price has move one level up
How do I know how many asks at current level?
Above is just pseudo code. If you can confirm my analysis, it'll be appreciated
Comment
-
Perhaps this reference sample will be more helpful: http://www.ninjatrader-support2.com/...ead.php?t=3478
Last is the last traded price. Bid/ask are just the bid and ask price. Also, consider using GetCurrentBid() and GetCurrentAsk(). For volume you can also use GetCurrentBidVolume()/GetCurrentAskVolume().Josh P.NinjaTrader Customer Service
Comment
-
Could you help to explain this section?
// Checks to see if the action taken by the Ask data was an insertion into the ladder
if (e.Operation == Operation.Insert)
rows.Insert(e.Position, new LadderRow(e.Price, e.Volume, e.MarketMaker));
/* Checks to see if the action taken by the Ask data was a removal of itself from the ladder
Note: Due to the multi threaded architecture of the NT core, race conditions could occur
-> check if e.Position is within valid range */
else if (e.Operation == Operation.Remove && e.Position < rows.Count)
rows.RemoveAt(e.Position);
Comment
-
I tried on FESX just now, and it shows a lot of updates. What does UPDATE mean? There are many updates not only at current price neigbors, but also far away in the depth.
Bid Update 2353 846 2355
Depth: Ask Update 2355 735 2355
Depth: Bid Update 2354 178 2355
Depth: Bid Update 2352 708 2355
Depth: Bid Update 2351 871 2355
Depth: Ask Update 2355 737 2355
Depth: Bid Update 2354 181 2355
Depth: Ask Update 2358 780 2355
Depth: Bid Update 2352 735 2355
Depth: Bid Update 2351 851 2355
Depth: Ask Update 2355 716 2355
Depth: Ask Update 2355 737 2355
Depth: Bid Update 2354 171 2355
Depth: Ask Update 2358 779 2355
Depth: Bid Update 2350 679 2355
Depth: Ask Update 2355 716 2355
Depth: Bid Update 2354 181 2355
Depth: Ask Update 2362 523 2355
Depth: Bid Update 2350 669 2355
Depth: Bid Update 2346 746 2355
Depth: Ask Update 2355 717 2355
Depth: Ask Update 2355 738 2355
Depth: Ask Update 2355 717 2355
Depth: Ask Update 2355 738 2355
Depth: Ask Update 2358 829 2355
Depth: Ask Update 2355 737 2355
Depth: Bid Update 2354 182 2355
Depth: Bid Update 2353 867 2355
Depth: Bid Update 2348 593 2355
Depth: Bid Update 2354 181 2354
Depth: Bid Update 2353 865 2354
Depth: Bid Update 2352 737 2354
Depth: Bid Update 2354 171 2354
Depth: Bid Update 2354 172 2354
Depth: Ask Update 2358 838 2354
Depth: Bid Update 2351 841 2354
Depth: Ask Update 2355 708 2354
Depth: Bid Update 2353 869 2354
Depth: Ask Update 2355 738 2354
Depth: Ask Update 2359 749 2354
Depth: Bid Update 2353 895 2354
Depth: Ask Update 2355 717 2354
Depth: Ask Update 2360 823 2354
Depth: Ask Update 2364 685 2354
Depth: Ask Update 2355 705 2354
Depth: Bid Update 2354 173 2354
Depth: A
Comment
-
I meant we have:
- update
-insert
- remove
update is basically $x (t) - $x (t-1). So, if we get "update" event at time t at price $x = 100 and at time (t-1), it was 90, then we get insertion of 10. Right?
It is the same as "insert" event = 10 at $x
Am I thinking the right way?
Basically, right now, I am trying to make an indicator to calculate net bids lifted and bids inserted at current bid level (minus) contracts sold at that level. The same for asks.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PhillT, 04-19-2024, 02:16 PM
|
3 responses
14 views
0 likes
|
Last Post
by mangel2000
Today, 03:04 AM
|
||
Started by TraderBCL, Today, 02:37 AM
|
0 responses
1 view
0 likes
|
Last Post
by TraderBCL
Today, 02:37 AM
|
||
Started by mangel2000, Today, 02:23 AM
|
0 responses
5 views
0 likes
|
Last Post
by mangel2000
Today, 02:23 AM
|
||
Started by mangel2000, Today, 01:30 AM
|
0 responses
13 views
0 likes
|
Last Post
by mangel2000
Today, 01:30 AM
|
||
Started by Doxxxx, Today, 01:24 AM
|
0 responses
5 views
0 likes
|
Last Post
by Doxxxx
Today, 01:24 AM
|
Comment