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 Hwop38, 05-04-2026, 07:02 PM
|
0 responses
161 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
309 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
245 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
349 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment