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
T&S and DOM
Collapse
X
-
T&S and DOM
Why are the time and sales last buys and sells different than the DOM's last buys and sales? Note: T&S doesn't have a size filter. -
Hello mlprice12,
Thank you for the message.
Who are you connecting to for Market Data?
What instrument are you looking at?
Please take a screenshot that includes both the SuperDOM and T & S Window so we may see what the windows look like.- If you are unsure of how to take a screenshot, I recommend using the Windows Snipping tool.
- Click on the Windows Icon at the bottom of your screen and type the word "Snip"
- Click on the Snipping tool, click New, then click and drag around the area you want to screenshot
- Click File > Save As > Save the screenshot where you can find it
- Please click here for a video demonstration
Clayton G.NinjaTrader Customer Service
-
Thanks Clayton,
Connected through Ninjatrader Continuum.
Looking at the ES.
Here is some code to show how last buy vol is calculated on DOM
Code:if (aggressor == TradeAggressor.BUYER) { Trade oldTrade; bool gotOldTrade = SlidingWindowBuys.TryGetValue(close, out oldTrade); Trade trade = new Trade(); trade.Ask = ask; trade.Time = time; if (gotOldTrade) { trade.Size = oldTrade.Size + volume; } else { trade.Size = volume; } if (updateSlidingWindow) { SlidingWindowBuys.AddOrUpdate(close, trade, (price, existingTrade) => existingTrade = trade); } TotalBuys.AddOrUpdate(close, volume, (price, oldVolume) => oldVolume + volume); }
Code:internal long GetBuysInSlidingWindow() { long total = 0; foreach (Trade trade in SlidingWindowBuys.Values) { total += trade.Size; } return total; }
Comment
-
Hello mlprice12,
Thank you for the update.
Could you please provide more information on the Windows you are using from NinjaTrader and if these are default NinjaTrader Windows and Indicators or if they are 3rd party NinjaScripts or from another program?- The windows within the screenshots you provided do not look like Default NinjaTrader Windows.
- Here is what the SuperDOM and T & S window look like within NinjaTrader for comparison
Are the windows in your screenshot windows provided by the Default NinjaTrader platform? Are these a 3rd party add-on? Are these another trading platform?
As well, you have provided some code with your last response to show how something is calculated. Is this a NinjaScript you are working on for NinjaTrader?
Clayton G.NinjaTrader Customer Service
Comment
-
Hello mlprice12,
Thank you for the update.
Within the NinjaTrader platform, we would expect for the Default NinjaTrader SuperDOM and T & S Window to line up like my previously submitted screenshot.
Providing us screenshots of another program that has some odd behavior similar to what you are seeing in NinjaTrader does not help us provide further information on what is happening within NinjaTrader.- We would need a screenshot of this behavior happening within NinjaTrader windows specifically
- The NinjaTrader Platform Support Team only has documentation on NinjaTrader and we \have no documentation on why another trading platform could look the way it does in your screenshot
If you are comparing the values of a 3rd party add-on to something within NinjaTrader and it is not lining up as expected, you would need to reach out to the developer of the add-on and ask them why it is behaving that way and what needs to be done.- If you are working on creating a NinjaScript Strategy yourself, please let us know so we may provide more information. If you got this NinjaScript from someone else, please reach out to them for further information on the NinjaScript
If you open a NinjaTrader SuperDOM window and NinjaTrader T & S Window set to the same instrument, do they line up? If not, please take a screenshot of them and include that in your response.Clayton G.NinjaTrader Customer Service
Comment
-
Does time and sales record all trade data or is some trade data hidden from T&S?
Why would my ninjascript that's set to print last trade volume on the bid and last trade volume on the ask be different than the T&S buy sell data?
Or is the last traded volume from my ninjascript printing a value of combined trade volume if multiple trades are hitting at the same price at the same second?
Code:internal Trade GetBuysInSlidingWindow(double price) { Trade trade = null; SlidingWindowBuys.TryGetValue(price, out trade); return trade; } internal Trade GetSellsInSlidingWindow(double price) { Trade trade = null; SlidingWindowSells.TryGetValue(price, out trade); return trade; } internal long GetLastBuySize(double price) { long lastSize = 0; Trade current = GetBuysInSlidingWindow(price); if (current != null && current.Size > 0) { long prevSize; if (LastBuy.TryGetValue(price, out prevSize)) { lastSize = current.Size - prevSize; } long oldValue; LastBuy.TryRemove(price, out oldValue); LastBuy.TryAdd(price, current.Size); } return lastSize; } internal long GetLastSellSize(double price) { long lastSize = 0; Trade current = GetSellsInSlidingWindow(price); if (current != null && current.Size > 0) { long prevSize; if (LastSell.TryGetValue(price, out prevSize)) { lastSize = current.Size - prevSize; } long oldValue; LastSell.TryRemove(price, out oldValue); LastSell.TryAdd(price, current.Size); } return lastSize; }
Last edited by mlprice12; 01-25-2022, 06:54 PM.
Comment
-
Hello mlprice,
We have moved this thread to our NinjaScript Development forums since it sounds like you are talking about your own DOM NinjaScript being out of sync with NinjaTrader Time and Sales reports.
I cannot give much comment on why your results are showing differently with what is available, but I would like to make the following points:- Different windows have different refresh intervals, What you are looking at in a Time and Sales window may not be the same as what you see in the SuperDOM
- Before splitting trades Last ticks into buys and sells, are you looking at the same report of Bid/Ask and Last prices when reading the level 1 data? If Identifying buys/sells, the bid/ask associated with the Last tick should be used
We look forward to assisting.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 02:34 AM | ||
Started by IanS00, 03-27-2024, 11:24 AM
|
2 responses
12 views
0 likes
|
Last Post Today, 02:00 AM | ||
Started by Mariawilcoxi, Today, 01:32 AM
|
0 responses
4 views
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
5 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
46 views
0 likes
|
Last Post Today, 12:28 AM |
Comment