• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy doesn't execute

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

    Strategy doesn't execute

    I have ninja trader strategy which works for backtest but when added to sim-trading doesn't place orders.
    What I do is go to strategies tab, add new strategy, change paramters and start. But it doesn't place even if the conditions are met. Is there a step I am missing in order to deploy strategies?

    #2
    Hello morphtrade,

    Does the issue persist if you apply the strategy in a chart?
    http://www.ninjatrader-support.com/H...romAChart.html

    Could it be the strategy uses 'Calculate on bar close' set to True?

    In addition, general debug information can be found at the following link.
    http://www.ninjatrader-support2.com/...ead.php?t=3418
    JasonNinjaTrader Customer Service

    Comment


      #3
      it shows all the trades when I apply it to chart. yes calc on bar close is set to true.

      Comment


        #4
        Does it make a difference if you set it to False? When set to True, the strategy will trigger orders at the close of a price bar, while set to False it will submit orders intra-bar.
        JasonNinjaTrader Customer Service

        Comment


          #5
          I can set it to false just for testing but in live if I calculate entry intrabar it might results into more trades and live results will deviate from testing.

          Comment


            #6
            Ok sounds good, you can find debug tips to debug your strategy at the link below as well.
            http://www.ninjatrader-support2.com/...ead.php?t=3418
            JasonNinjaTrader Customer Service

            Comment


              #7
              it's this line here which never return true for realtime bars but does work for historical bars.

              if (CrossAbove(EMA(smSeries, Period1), EMA(smSeries, Period2), 1))

              Comment


                #8
                Suggest you actually print values of your indicator and debug it by hand.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  so after debugging I found out that EMA(smSeries, Period1) and EMA(smSeries, Period2) gives different values when calculated on historical and realtime series. For realtime EMA's are much lower than what it should be. Is there a difference between how the EMA is calculated for historical bars than realtime? I changed tha Min bars to calculate to 100 but that didn't make any difference either.

                  Period1 is 2 and Period2 is 5.

                  Comment


                    #10
                    I have copied the values from output window for hist and realtime EMA's

                    79.0258361854625
                    78.9966120618208
                    78.9588706872736
                    78.9436235624245
                    78.9665411874748
                    79.010180395825
                    79.0540601319417
                    79.0593533773139
                    26.353117792438 <<<<<<<<<<<realtime bar
                    8.78437259747933 <<<<<<<realtime bar

                    Comment


                      #11
                      No difference. You need to check your realtime values stored in smSeries.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        I will debug that and find out. But I am trying to understand what's the difference between the way OnBarUpdate is executed for historical bars and realtime bars. This might help me in future as well.

                        Comment


                          #13
                          Difference depends on your CalculateOnBarClose setting. On Historical, all bars are processed once at the end with OHLC. In real-time, if the setting is set to false, bars are processed on every single incoming tick.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            calculateonbarclose is set to true even then there is difference between realtime and historical values. I print the values in realtime and then I realod strategy and same bars when processed as historical print different values(correct one).

                            Comment


                              #15
                              Which is why you need to debug every aspect of your custom DataSeries as you set values to it in real-time.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Wingo, Today, 04:52 PM
                              1 response
                              9 views
                              0 likes
                              Last Post bltdavid  
                              Started by Bionian, Today, 10:10 AM
                              3 responses
                              20 views
                              0 likes
                              Last Post Bionian
                              by Bionian
                               
                              Started by D Trader, Today, 01:41 PM
                              0 responses
                              13 views
                              0 likes
                              Last Post D Trader  
                              Started by rexmie888, Today, 04:00 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_ShawnB  
                              Started by terminatorT1000, Today, 01:23 AM
                              1 response
                              17 views
                              0 likes
                              Last Post NinjaTrader_ShawnB  
                              Working...
                              X