Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Grid Data Extraction
Collapse
X
-
Grid Data Extraction
I wonder if there is a way or script to extract Grid Data periodically (Every specific time) Instead of right click on NinjaTrader 'Control Center - Strategies' Window then hit Export to export whether xlsx or csv file , I want to automate thisTags: None
-
Hello Badr123,
Thank you for your post.
What you have described may or may not be possible to automate, though there is no supported/documented method for doing so via NinjaScript. This thread will remain open for members of the forum community to chime in with their thoughts or ideas on how this might be possible.
Otherwise, you could consider adding logic into your strategies directly that writes the desired data to a text file via StreamWriter. That text file could then potentially be converted to a xlsx or csv spreadsheet file. For an example of using StreamWriter to write to a text file:
Please let us know if we may be of further assistance.
-
The link I provided contains a download for a reference sample that demonstrates how to write to a text file with StreamWriter. It is up to you to decide which data you would like to write to that file; in terms of the Strategies tab of the Control Center, you can get items such as the average price, unrealized PnL, etc. via NinjaScript methods and properties available such as the following:- AveragePrice - https://ninjatrader.com/support/help...erageprice.htm
- GetUnrealizedProfitLoss() - https://ninjatrader.com/support/help...profitloss.htm
- MarketPosition - https://ninjatrader.com/support/help...etposition.htm
- Quantity - https://ninjatrader.com/support/help...n_quantity.htm
Comment
-
Create a custom NinjaScript strategy to handle the data extraction. NinjaScript allows you to write custom C# scripts for NinjaTrader. By leveraging NinjaScript, you essentially create a data enrichment tool that automates the extraction process. This tool can be tailored to your specific requirements, allowing you to gather the necessary data at scheduled intervals without manual intervention.Last edited by Morkab; 01-19-2024, 02:25 AM.
Comment
-
Can you give me at least example for script to print all my Instrument in the "Control Center - Strategies" window please ?Originally posted by Morkab View PostCreate a custom NinjaScript strategy to handle the data extraction. NinjaScript allows you to write custom C# scripts for NinjaTrader.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
598 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
557 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
555 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment