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

NT8 Questions

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

    NT8 Questions

    1. If I modify a strategy that's running, how do I get the new changes to take affect?

    2. Can I change a user defined input value while the strategy is running?

    3. I only trade currencies. Can I hide the other markets?

    4. Can a strategy manage a manually created position?

    5. Can I create a dashboard? Can a strategy process data from more than one pair?
    Image of a simple dashboard attached.
    Attached Files

    #2
    Hello RiversideDude,

    Thanks for writing in.

    As allowing the changing of user defined inputs on-the-fly could cause for a lot of unexpected behavior, this feature is not allowed. Strategy parameters must be modified by disabling and re-enabling the strategy.

    You can create instrument lists to conveniently monitor any group of futures, FOREX, or stocks. You can learn more about using instrument lists in NinjaTrader 8 here: http://ninjatrader.com/support/helpG...ment_lists.htm

    There are two different approaches to creating strategies in NinjaTrader 7 and NinjaTrader 8 referred to as the Managed Approach and the Unmanaged Approach. The Managed Approach will allow you to create strategies without having to control orders exactly for each profit target and stop loss. The Unmanged Approach allows you to manage raw orders and you can manage the orders based on your current market position. The Unmanaged Approach is intended for experienced developers who want complete control of their strategies. You can learn moire about creating strategies with the documentation below:

    Order Methods and Approaches: https://ninjatrader.com/support/help...er_methods.htm

    Developing Strategies (NinjaTrader 7 but still relevant): https://ninjatrader.com/support/help...strategies.htm

    Recorded webinar on the NinjaScript Editor (NinjaTrader 7 but still relevant): https://www.youtube.com/watch?v=K8v_2ONBbqI

    Yes you can create a dashboard. A watch list can be made in the Market Analyzer with customizeable columns and alerts, or you can create your own window to manage and watch your instruments.

    Market Analyzer documentation: http://ninjatrader.com/support/helpG...t_analyzer.htm

    You may want to looking into creating your own window if the Market Analyzer does not fulfill your needs.

    Creating your own Add-On Window: http://ninjatrader.com/support/helpG...don_window.htm

    Strategies can access more than one pair by adding additional data series to that strategy. We have this documented in our help guide here: https://ninjatrader.com/support/help...dataseries.htm

    Please let me know if you have any further questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      DaystoLoad & BarstoLoad

      In my strategy I am using the Pivot indicator. It requires maybe a month or 2 of historical data. when I enter a large number for DaystoLoad say 60 days the pivots calculate fine. Now In the strategy analyzer I only want to test one day at a time to see the results. So I Put same day for the start and end date. Instead of giving me one day it give me historical data when I run the strategy analyzer. Is there a way in the Strategy Analyzer to only get results for one day but still calculate the pivots correctly in my strategy.

      Comment


        #4
        Hello dlespinasse50,

        Thanks for writing in.

        To answer your question directly, no there is not any specific setting in the Strategy Analyzer to have a back-tested strategy use different data series per indicator. This must be coded manually.

        To restrict historical trades from showing up in your back-test, you may want to add a return condition for historical data in OnBarUpdate():

        Code:
        protected override void OnBarUpdate()
        {
          // only process real-time OnBarUpdate events
          if (State == State.Historical)
            return;
            
          //rest of logic           
        }
        To have your pivots form off of historical data that you are not inputting to the Strategy Analyzer's primary data series, you will want to add an additional data series to your strategy that will be used for pivot calculations.

        We have a reference sample on creating an additional data series for calculating values outside of the primary data series. I will provide a link below:

        You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


        Please also take the time to read the documentation for the components listed within as well as the documentation on creating NinjaScript for Multi-Time Frame & Instruments:



        Syntax for using Pivots in NinjaScript can be referenced here: https://ninjatrader.com/support/help...us/?pivots.htm

        If you have any further questions, please don't hesitate to ask.
        Last edited by NinjaTrader_Jim; 03-01-2017, 02:59 PM.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thank you very much for your answer. My program is getting a compile error when I use the
          if(Historical)
          return:

          It says its not finding Historical in the context. Do I need to define it some where and check for a condition?

          Comment


            #6
            Hello dlespinasse50,

            Thanks for writing back.

            Yes, you are correct. if(Historical) does return a compiler error in NinjaTrader 8. NinjaTrader 8 uses a State system now which allows for other states other than Historical and Realtime. You can read about the State system here: https://ninjatrader.com/support/help...n-us/state.htm

            You will be looking to add the following code to your strategy instead:
            Code:
            protected override void OnBarUpdate()
            {
              // only process real-time OnBarUpdate events
              if (State == State.Historical)
                return;
                
              //rest of logic           
            }
            I will update my last post to reflect this correction.

            Please let me know if I may be of further assistance.
            Last edited by NinjaTrader_Jim; 03-01-2017, 03:44 PM.
            JimNinjaTrader Customer Service

            Comment


              #7
              Thanks again for your response. I drop that code in there and there was no errors but My did not have any orders. Nothing is getting pass
              State == State.Historical
              Return;.
              I tried to use the link that you provided to read up but It says I am not authorize.

              Comment


                #8
                Hello dlespinasse50,

                I have fixed the broken link in my previous post.

                Please let me know if I may assist you further with this matter.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Thanks for your response. I put the code change into OnBarsUpdate.. Nothing is getting into OnBarsUpdate. orders were not submitted


                  if (State == State.Historical)
                  return

                  Comment


                    #10
                    Hello dlespinasse50,

                    Thanks for your note.

                    Could you send me a copy of your strategy so I may take a look?

                    Please write in to platformsupport[at]ninjatrader[dot]com with the ticket number 1665287 referenced as well as the text "Attention Jim" with your strategy attached.

                    I look forward to assisting you further.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      I have sent it in for your review. Thank your for looking at it.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by maybeimnotrader, Yesterday, 05:46 PM
                      2 responses
                      22 views
                      0 likes
                      Last Post maybeimnotrader  
                      Started by adeelshahzad, Today, 03:54 AM
                      5 responses
                      32 views
                      0 likes
                      Last Post NinjaTrader_BrandonH  
                      Started by stafe, 04-15-2024, 08:34 PM
                      7 responses
                      32 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by merzo, 06-25-2023, 02:19 AM
                      10 responses
                      823 views
                      1 like
                      Last Post NinjaTrader_ChristopherJ  
                      Started by frankthearm, Today, 09:08 AM
                      5 responses
                      22 views
                      0 likes
                      Last Post NinjaTrader_Clayton  
                      Working...
                      X