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
Running a Strategy Live
Collapse
X
-
Running a Strategy Live
Hello- I have a Multi-Instrument strategy that does money management as well. Here I adaptively determine how many shares I would like to buy for a given instrument based on the available cash I have in the account . In the strategy I set this value to a certain amount. However I would like to go live with this strategy and still have this capability. But with a live strategy however, I will need get cash available info from the actual account and work off that rather than the values set in the strategy. Also the current strategy prints a bunch of info when an order is made through the output window as well as to an Excel file for charting purposes. How will this get affected when I go live? Will the strategy still do this? -
Hello,
Thank you for the post.
Your existing features you have developed in the script should all remain in place when switching to live, the only difference is that you are using a live account instead of a sim account.
For the account values, this would also be the same as the sim currently in regard to what you can access for values. Generally, it would be suggested to have some input as you have described where you can input your account values for the strategy to use in its logic and recalculate from. If you would like to access the account values you can use the strategy override for account item information:
Also, the addon methods can be used from the Account Class in more complex situations: https://ninjatrader.com/support/help...ghtsub=account
Regarding the output window, it would be unaffected, this is always available for NinjaScript objects to use.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Hi Jesse- Thanks for the quick response. It looks like the Add On method is calling the OnStateChange() command. Question: Where do I put this Add On code? Do I put it right after the Void initialize() segment but right before the OnBarUpdate() segment in my current strategy?
Also it appears that the OnAccountItemUpdate() is a bit more straightforward. It seems to me that this code can be put anywhere in the strategy. Is this a correct interpretation?Last edited by ciro1963; 12-28-2017, 08:50 AM.
Comment
-
Hello,
Thank you for the reply.
I wanted to confirm, the information provided so far has been for NT8 as we are in the NT8 subforum, was this question intended for NT7? Only NT7 would have Initialize, the sample in the help guide should reflect the standard NinjaScript structure in NT8.
Regarding the OnAccountItemUpdate override, that can be placed in a strategy in NT8.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello,
I have moved this thread into the NT7 subforum, in the future please ensure to post according to the version being used.
For NT7, the prior replies do not apply so please ignore my prior response. It would instead be suggested to create an Input and utilize that in NT7. The Account items shown previously were not available in NT7 specifically.
You could see the following post for one example on creating loss limits in nt7: https://ninjatrader.com/support/foru...367#post475367
You could also review the GetAccountValue method, please note this would only work in realtime: https://ninjatrader.com/support/help...ghtsub=account
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Originally posted by ciro1963 View PostHello- I have a Multi-Instrument strategy that does money management as well. Here I adaptively determine how many equity shares I would like to buy for a given instrument based on the available cash I have in the account . In the strategy I set this value to a certain amount. However I would like to go live with this strategy and still have this capability. But with a live strategy however, I will need get cash available info from the actual account and work off that rather than the values set in the strategy. Also the current strategy prints a bunch of info when an order is made through the output window as well as to an Excel file for charting purposes. How will this get affected when I go live? Will the strategy still do this?
Also what about selling the shares? Is that going to be an option or not?
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mestor, 03-10-2023, 01:50 AM
|
11 responses
303 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
407 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
||
Started by yertle, Yesterday, 05:49 PM
|
2 responses
11 views
0 likes
|
Last Post
by yertle
Today, 12:12 AM
|
||
Started by kaywai, Today, 12:06 AM
|
0 responses
10 views
0 likes
|
Last Post
by kaywai
Today, 12:06 AM
|
Comment