Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Can Strategy Instances be Added Programmatically?
Collapse
X
-
Can Strategy Instances be Added Programmatically?
I run NinjaScript strategies from the Strategies tab in the NinjaTrader 8 Control Center. At present I add strategy instances to this tab manually using the "New Strategy..." item on the Context Menu for the Strategies tab. I'd prefer to add strategy instances to this tab programmatically. Is it possible to add strategy instances to the Strategies tab programmatically using a NinjaTrader Add-On or using some other way that is internal or external to NinjaTrader? If the answer to this question is yes, then would you please recommend an approach for doing this?Tags: None
- Likes 2
-
Hello NtFan,
This is not currently possible through any supported means, it is expected to manually apply and start strategies to ensure they are started when expected. I will put in a feature request for the ability to add strategies programatically.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
I'd also like to make the request for this to be added. I currently have python code I wrote scanning for stocks and when they meet certain criteria it triggers an autohotkey script to click through the GUI to add a strategy. It would be much cleaner, faster, and more precise/accurate if I could add them programmatically using the same method call NT8 uses. Would you be able to say which DLL it calls and how so I can make an addon for it myself?
Comment
-
Is there perhaps any way to use the ATI, or the NTDirect.dll, or the File Interface to do it. Like I stated in the previous comment, I wrote a python script to create my strategies and can easily create a file for NT8 to read. Using the DLL is difficult but still doable.
Comment
-
Hello magnatauren,
You can use the file interface to submit external orders however there is very limited amount of information that can be retrieved through that system. You can read about that here: https://ninjatrader.com/support/help...file+interfaceJesseNinjaTrader Customer Service
Comment
-
Yea, I read through the entirety of the ATI, NTDirect.dll, and File interface KB's and was unable to find anything on it. If possible could you just tell me a little information about how it's handled and I can make my own addon for it? Honestly if it were something like the file interface and could just accept a text file along the lines of
Create Strategy(StrategyName, Instrument, enabled, otherparameters...)
Unfortunately I can't just have a strategy running for each equity or else Kinetick chokes.
Comment
-
Hello magnatauren,
Starting strategies is internal logic, that is not something which is exposed to the user in any form. The File interface would be used for simple order submission but has no means to control strategies. The other dll interface is not supported but still has no means to start a strategy.
It sounds like from your post 3 that you already have a solution to this problem, as there is no NinjaScript way to accomplish this task I would suggest to just stick with that. There is a feature request in place for this so if development sees the need to add this they will update that and place the id in the change log.
In general it is not expected to be able to control strategies through code, enabling a strategy is a deliberate action for the user to trade for them starting at that point. If you want something that runs in the background without enabling it you would have to avoid strategies completely and use an addon. https://ninjatrader.com/support/help...t_overview.htm
JesseNinjaTrader Customer Service
Comment
-
Hello Derjan,
We have added a vote to "SFT-2844" to track your interest behind having functionality available to programmatically start strategies.
This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.
Feature Request Disclaimer
We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing. As such we cannot offer an ETA or promise of fulfillment.
When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.
Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
JimNinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kujista, Today, 06:23 AM
|
4 responses
14 views
0 likes
|
Last Post Today, 09:55 AM | ||
Started by traderqz, Yesterday, 09:06 AM
|
2 responses
15 views
0 likes
|
Last Post
by traderqz
Today, 09:48 AM
|
||
Started by traderqz, Today, 12:06 AM
|
3 responses
6 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by RideMe, 04-07-2024, 04:54 PM
|
5 responses
28 views
0 likes
|
Last Post Today, 08:48 AM | ||
Started by f.saeidi, Today, 08:13 AM
|
1 response
8 views
0 likes
|
Last Post Today, 08:47 AM |
Comment