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!
See more
See less

Partner 728x90

Collapse

Running a Strategy Live

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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

    Comment


      #3
      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


        #4
        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


          #5
          Hi Jesse- I didn't realize I was in the NT8 forum. No I'm using NT7, Can you answer the questions for NT7? Thanks.

          Comment


            #6
            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


              #7
              Thanks Jesse- I see that I can retrieve the cash available from GetaccountValue() command. But is there also a way to get total account value?

              Comment


                #8
                Hello,

                Thank you for the reply.

                In NT7 there would not be, it would still be suggested that you manually enter this into an input.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by ciro1963 View Post
                  Hello- 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?
                  To be honest I want to know how will you manage the risk factors?
                  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 Skifree, Today, 03:41 AM
                  1 response
                  3 views
                  0 likes
                  Last Post Skifree
                  by Skifree
                   
                  Started by usazencort, Today, 01:16 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post usazencort  
                  Started by kaywai, 09-01-2023, 08:44 PM
                  5 responses
                  603 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by xiinteractive, 04-09-2024, 08:08 AM
                  6 responses
                  23 views
                  0 likes
                  Last Post xiinteractive  
                  Started by Pattontje, Yesterday, 02:10 PM
                  2 responses
                  23 views
                  0 likes
                  Last Post Pattontje  
                  Working...
                  X