Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

My strategies don't seem to execute

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

    My strategies don't seem to execute

    Sorry about the noob question.

    I connected to Market Replay Connection, hit "play", opened chart, chose ES 06-15, made sure the chart is updating, added my very simple strategy (all it does is Print() and Alert()) , made sure it's enabled, even tried setting CalculateOnBarClose to false. Still, the only alerts and prints I am getting are from Initialize(), never from OnBarUpdate(). It seems that OnBarUpdate() is never called. None of the other strategies seem to produce any visible result either. Same strategies do work in backtest. What am I doing wrong?

    Thank you
    Last edited by asdfadf; 05-27-2015, 10:11 AM.

    #2
    Hello asdfadf,

    May I confirm that the strategy is enabled?

    (Is enabled set to true? Is there a (D) preceding the name of the strategy on the chart?)
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      Enabled is true, I get the warning alert "Although you get confirmation...", and when I go to the Strategies tab, the "Enabled" checkbox next to my strategy is checked. However, I am seeing no (D). Where should it be? In the top left corner? I just have Test(1), which is the name of my strategy and its parameter.

      Comment


        #4
        Hello asdfadf,

        That alert is generated every time you enable a strategy if you have confirm order placement enabled in Tools -> Options... -> General.

        Just to confirm, the strategy shows the Enabled box checked on the Strategies tab of the Control Center and there are no prints, is this correct? (The (D) only shows on the chart by the strategy label when the strategy is disabled. The (D) means disabled.

        May I confirm that the output window was open before running the strategy?

        May I test this strategy on my end?

        To export your script do the following:
        1. Click File -> Utilities -> Export NinjaScript
        2. Enter a unique name for the file in the value for 'File name:'
        3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
        4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


        Below is a link to the help guide on Exporting NinjaScripts.
        http://www.ninjatrader.com/support/h...nt7/export.htm
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          OK. I feel stupid. It's an error on my side. Please ignore.

          Comment


            #6
            Hello asdfadf,

            I tested on my end. The alert is showing up in the Alerts window when the bar closes.

            This alert will only generate once because you have the re-arm seconds set to 0. When set to 0 the alert will not re-arm. Set this to at least 1 if you would like the alert to re-arm.

            Also, alerts do not work historically so you do have to wait for a bar close in real time.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you Chelsea.

              I am now debugging the scripts, and it takes me a long time to restart a script once modified: I have to compile, go to chart, stop the strategy, press "apply", add the strategy again, enable it, press OK. Sometimes all that just to display the value of a variable. Is there a faster way?

              Comment


                #8
                Hello asdfadf,

                As long as you are not changing items in Initialize, you can hit F5 on your key board to Reload NinjaScripts.

                You can also right-click the chart and select Reload NinjaScript.

                If anything is changed in Intialize(), this would require removing and re-adding the script.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Wow, thank you, that's very valuable!

                  As a wish list item, why not offer to reload the strategy automatically, after a prompt? "Your strategy has changed, reload?"

                  Comment


                    #10
                    Hello asdfadf,

                    Thank you for the suggestion.

                    I've forwarded this as a feature request to the development department. It will be up to development to decide to implement this in a future version of NinjaTrader.

                    Please do not hesitate to contact us for any other NinjaTrader inquiries or suggestions you may have.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Thank you. May I just keep using this thread for newbie questions, instead of littering the place with a bunch of assorted questions?

                      I see ES 06-15 starts at 9:30PM in Replay. I am curious, why such an odd start time and what does it represent? Where can I find more about it?

                      Comment


                        #12
                        Hello asdfadf,

                        Typically playback will start from the start time of the data.

                        If you right-click the Market Replay and select Available Data, what time does the first data start?

                        We do have a video on using the Market Replay you may find helpful.
                        Chelsea B.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        633 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        364 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        105 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        567 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        568 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X