Dash
Looking for help with database injection in NinjaTrader - Advanced(I think)
I'm using NinjaTrader to build a fully automated trading bot. Right now the issue I'm having is that Ninjatrader doesn't auto-update stock tickers, and there is no way to bulk add new tickers, nor is there a supported way to add them programmatically. I'm currently trying to figure out how I'd add them programmatically and could use a hand.
The way I want to do it right now is to clone an Instrument that already exists - (Example: Instrument oldInstr = Instrument.GetInstrument("MOGU");) - Change the "FullName" parameter, and add the new object to the database. Unfortunately the FullName parameter is readonly, and because I haven't been able to create a unique Instrument, I can't test adding it to the database yet.
I was able to use reflection to see the methods for the objecs and I see a DbAdd function that looks like how I would add it to the DB, but it doesn't allow me to change the FullName, nor does it accept anything other than a bool. So what I'm assuming I need to do is like I said above using the DbAdd function.
Support saying it's not supported: https://forum.ninjatrader.com/forum/ninjatrader-8/add-on-development/1302818-bulk-addition-of-instruments#post1302821
The DbAdd Function to be used:
NinjaTrader.Cbi.Instrument - OBJECT
DbAdd - METHOD
Void DbAdd(Boolean) - ATTRIBUTES
PrivateScope, Public, HideBySig - CALLINGCONVENTION
Standard, HasThis - CALLINGCONVENTION
True - IsPublic?
2 replies