Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Programmatic Access to Instruments Database
Collapse
X
-
Programmatic Access to Instruments Database
I'm running NinjaTrader version 8.0.21.1 64-bit, and I'd like to programmatically read-from and write-to my local instrument database. I'd like to know if it's possible to do this, either internally to NT8 using NinjaScript, or externally to NT8 using Python/C#/VBA? If it is possible, then I'd appreciate any guidance you might provide for how to do it. Thank you.Tags: None
-
Hello NtFan,
That really depends on what your local database format is, NinjaScript is just C# programming language so you could use any C# means to interface with external data. You can also reference libraries if needed in case you are using a database or something that requires an actual library to use.
I would suggest to first review what you need to access the data and then search online for C# examples for that. For example if your database was a csv file you could search for "C# read csv file" to get some examples which would apply in NinjaScript.
I look forward to being of further assistance.
-
Hi Jesse,
The "local database" that I want to read-from and write-to is the NinjaTrader instrument database that is installed on my local computer. With regard to this database, here are two things I'd like to do:
1a. Using NinjaScript, I'd like to read from it to check if an instrument having a specific name (i.e. ticker) exists; and
1b. Ditto, but using Python/C#/VBA.
And, here are two more things I'd like to do:
2a. Using NinjaScript, I'd like to write to it to add an instrument that doesn't exist; and
2b. Ditto, but using Python/C#/VBA.
Are any/all of these four things possible? If yes, then I'd appreciate any guidance you might provide regarding how to do them.
Thank you,
NtFan
Comment
-
Hello NtFan,
There is no suggestion I can make for accessing the NT databases directly, you could look up an instrument in NinjaScript using the method to do that but I could not advise for any external use case outside of NinjaScript. In general the database files and other data files NinjaTrader stores are not accessible from outside the platform.
Creating instruments from NinjaScript is also very limited, technically you can try to Instrument.GetInstrument("name", true) and it will add a default stock type instrument but there is no supported way to modify/add instruments in the database through code. It is only suggested to manually define instruments so that you can ensure the configuration is correct before you try to use it.
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment