Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No results in Optimizer

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

    No results in Optimizer

    Hello!

    I have problem with Optimizer and Analizer.
    I'm using my own Strategy on Market Replay Data and that works fine, but when I'm trying to use Strategy Analizer or Optimizer it shows me nothing. No executioins, no orders or something else. For any periods, for any parameters...

    Can somebody tell my why thats happening?

    Thanks!

    #2
    Hello,

    Are you connected to the Market Replay when using the Strategy Analyzer?

    If so, try connecting to a real-time connection.

    Do you have real-time connection that supplies the data type you are using in the backtest?

    Does the Chart tab in the Strategy Analyzer results have data on the chart?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello,

      Are you connected to the Market Replay when using the Strategy Analyzer?

      If so, try connecting to a real-time connection.

      Do you have real-time connection that supplies the data type you are using in the backtest?

      Does the Chart tab in the Strategy Analyzer results have data on the chart?
      1 - I'm connected to the Real-Time Data. And there are no results.
      2 - I tried to use some providers (and from my real account too) and nothing appeared
      3- Chart Tab have data and bars on it

      Comment


        #4
        Hello YevhenShynkarenko,

        Thank you for your response.

        Do you see trades if you run the same From and To Date and Instrument for a backtest on the SampleMaCrossOver?

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello YevhenShynkarenko,

          Thank you for your response.

          Do you see trades if you run the same From and To Date and Instrument for a backtest on the SampleMaCrossOver?
          Yes, SampleMaCrossover works good

          Comment


            #6
            Hello YevhenShynkarenko,

            Thank you for confirming the data is available and that the built in sample scripts work without any issue.

            This indicates the script is not placing orders due to the conditions in the script.

            I suggest that you add prints to your code so that we can see why the script is behaving as it is.

            May I have a sample condition in your script that should place an order? I will help you to create a print statement to see how this evaluates.

            For example on a crossover I could print:

            Print(Time[0]+" - "+SMA(7)[1]+" < "+SMA(14)[1]+" && "+SMA(7)[0]+" > "+SMA(14)[0]);

            This would let me know why a crossabove condition was or was not evaluated as true.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello,

              Are you connected to the Market Replay when using the Strategy Analyzer?

              If so, try connecting to a real-time connection.

              Do you have real-time connection that supplies the data type you are using in the backtest?

              Does the Chart tab in the Strategy Analyzer results have data on the chart?
              Sure, here is the code I'm using to enter positions

              PHP Code:
              if(!IsLongTrend){
                                  if(
              price _numLow && GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat){// upper then green line
                                      //if(GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat){
                                      //    Print ("HAVE ANY ORDER");
                                      //}
                                      //else 
                                      
              if(GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat){
                                          
              //atmStrategyId = GetAtmStrategyUniqueId();
                                          //orderId = GetAtmStrategyUniqueId();
                                          
              AtmStrategyCreate(OrderAction.SellOrderType.Market00TimeInForce.DayorderId"AqueGenNinjaStrategy"atmStrategyId);
                                          
              startOrderPrice price;
                                          
              openedOrderId orderId;
                                          
              isOrderPresent true;
                                      }
                                  }
                              }
                      else 
                              if(
              IsLongTrend){
                                  if(
              price _numHigh && GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat){
                                      
              //if(GetAtmStrategyMarketPosition(atmStrategyId) != MarketPosition.Flat){
                                      //    Print ("HAVE ANY ORDER");
                                      //}
                                      //else 
                                      
              if(GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat){
                                          
              //atmStrategyId = GetAtmStrategyUniqueId();
                                          //orderId = GetAtmStrategyUniqueId();
                                          
              AtmStrategyCreate(OrderAction.BuyOrderType.Market00TimeInForce.DayorderId"AqueGenNinjaStrategy"atmStrategyId);
                                          
              startOrderPrice price;
                                          
              openedOrderId orderId;
                                          
              isOrderPresent true;
                                      }
                                  }
                              } 

              Comment


                #8
                Hello YevhenShynkarenko,

                I see that you are using Atm Strategy methods in your code.

                When using Atm Strategy methods these orders will not appear in the strategy performance or in the Strategy Analyzer when backtesting.
                Once you have allowed NinjaTrader to manage the orders they are not actually created by your script and cannot be included with the script performance.

                Are you able to duplicate this issue when using EnterLong() methods and not using Atm Strategy methods?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello YevhenShynkarenko,

                  I see that you are using Atm Strategy methods in your code.

                  When using Atm Strategy methods these orders will not appear in the strategy performance or in the Strategy Analyzer when backtesting.
                  Once you have allowed NinjaTrader to manage the orders they are not actually created by your script and cannot be included with the script performance.

                  Are you able to duplicate this issue when using EnterLong() methods and not using Atm Strategy methods?
                  No, that's not possible. I'm using ATM trainings in 3 steps... So I can't change it to another entry method.

                  Comment


                    #10
                    Hello YevhenShynkarenko,

                    If you test using entry orders in another script (and not this script) I'm sure this will work fine.

                    It is expected that if you use Atm Strategies the strategy performance will be blank because the strategy is no longer submitting the orders at that point, instead NinjaTrader is submitting the orders and using an Atm Strategy instead of allowing the strategy to manage the orders.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_ChelseaB View Post
                      Hello YevhenShynkarenko,

                      If you test using entry orders in another script (and not this script) I'm sure this will work fine.

                      It is expected that if you use Atm Strategies the strategy performance will be blank because the strategy is no longer submitting the orders at that point, instead NinjaTrader is submitting the orders and using an Atm Strategy instead of allowing the strategy to manage the orders.
                      And there are no ways to find resolve which using ATM trailing?

                      Comment


                        #12
                        Hello YevhenShynkarenko,

                        There is not a way to have orders made outside of the strategy (such as ones made with an AtmStrategy) to be included with the strategy performance.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_ChelseaB View Post
                          Hello YevhenShynkarenko,

                          There is not a way to have orders made outside of the strategy (such as ones made with an AtmStrategy) to be included with the strategy performance.
                          Now I created enters with simple EnterLong and EnterShort functions, but there is still no results in Analyzator.

                          Now my strategy finding levels (signals) with some default indicators. When I get this signal - strategy must enter position. I'm using this code for searching where is the price right now.

                          Code:
                                  protected override void OnMarketData(MarketDataEventArgs e)
                                  {
                                      if (e.MarketDataType == MarketDataType.Last) {
                                          _lastPrice = Price;
                                          Price = e.Price;
                                                          
                                          BuyOrSell(Price, _lastPrice);
                                      }
                          What's the problem in running in Analyzator? Market Replay is working good.

                          Comment


                            #14
                            Hello YevhenShynkarenko,

                            From the help guide:
                            This method is not called on historical data (backtest)
                            http://www.ninjatrader.com/support/h...marketdata.htm

                            If you want to evaluate on a tick by tick basis in backtest/historical, then you need to add a secondary data series of 1 tick ask and 1 tick bid to your script. This is called intra-bar granularity.

                            Below is a link to an example of a script that uses 1 minute intra-bar granularity.
                            http://www.ninjatrader.com/support/f...ead.php?t=6652
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_ChelseaB View Post
                              Hello YevhenShynkarenko,

                              From the help guide:



                              If you want to evaluate on a tick by tick basis in backtest/historical, then you need to add a secondary data series of 1 tick ask and 1 tick bid to your script. This is called intra-bar granularity.

                              Below is a link to an example of a script that uses 1 minute intra-bar granularity.
                              http://www.ninjatrader.com/support/f...ead.php?t=6652
                              Thanks, that works, but now I have another problem!
                              I'm using ZigZag indicator and on the same parameters it shows another results in Backtest and Market Replay. Why it can be so?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Skifree, Today, 03:41 AM
                              1 response
                              2 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