Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
time and sales script
Collapse
X
-
Tags: None
-
time and sales
thank you for the reply austin,
I am looking for the ninja trader script ( code ) that creates the time and sales
Comment
-
There isn't a specific script that prints out the time and sales, but this would do the trick:
Code:protected override void OnMarketData(MarketDataEventArgs e) { // Print some data to the Output window if (e.MarketDataType == MarketDataType.Last) { string msg = e.Price.ToString() + "\t" + e.Volume.ToString(); Print(msg); } }AustinNinjaTrader Customer Service
Comment
-
Hi thanks for the sample code, which I expanded:
protected override void OnMarketData(MarketDataEventArgs e)
{
// Print some data to the Output window
if (e.MarketDataType == MarketDataType.Last)
{
string msg = "Last traded is" + e.Price.ToString() + "\t" + e.Volume.ToString();
Print(msg);
}
else if (e.MarketDataType == MarketDataType.Bid)
{
string msg = "Bid is " +e.Price.ToString() + "\t" + e.Volume.ToString();
Print(msg);
}
else if (e.MarketDataType == MarketDataType.Ask)
{
string msg = "Ask is" +e.Price.ToString() + "\t" + e.Volume.ToString();
Print(msg);
}
}
Question is : Why am I seeing duplicates? I thought OnMarketData is triggered only when there is a Lvl 1 change in bid, ask, last or its corresponding change volume?
e.g.
Bid is 8400 73
Ask is 8405 125
Bid is 8400 73
Ask is 8405 125
Comment
-
matthiasho,
Are you perhaps using multiple data series in your indicator?
Directly from the help guide for OnMarketData()
For more information on BarsInProgress, please see this link.With multi-time frame and instrument strategies, OnMarketData() will be called for all unique instruments in your strategy. Use the BarsInProgress to filter the OnMarketData() method for a specific instrument. (BarsInProgress will return the first BarsInProgress series that matches the instrument for the event)Adam P.NinjaTrader Customer Service
Comment
-
Dear Adam.
No, I am not using multiple data series in my indicator.
Just pure and simple like the codes I provided.
In fact there isnothing in the Onbarupdate.
If you provide me with yr email, I can mail you my source code for you to take a look.
Thanks!
Comment
-
hi the indicator is not running double. I only apply it to 1 chart
how to send source code to ninjatrader dot com?
[email protected]
Thanks
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
626 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
567 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment