Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Running Strategy on Simulator and Live

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

    Running Strategy on Simulator and Live

    Hello,

    I have design Automated Strategy, back tested and now when I add it to Strategies window in Control Center it is not doing anything on simulator (ZenFire). Of course I wouldn't like to try it on live market without extensive test on Sim. Please let me know why it is not executing the orders even the Start is enabled? What am I missing?

    Best regards.

    #2
    Hi veetek,

    Please check the Log-tab for any error messages.

    Could it be your strategy is referencing bars not listed in your chart? If so, please see the following link.


    Could it be the conditions in your strategy were not met yet?
    JasonNinjaTrader Customer Service

    Comment


      #3
      Hello Jason,

      I have used the wizard to design thissimple strategy based on Parabolic SAR. Is there any way to check this issue inside of wizard without writing a script?

      Here is my strategy (out of wizard):

      // This namespace holds all strategies and is required. Do not change it.
      namespace NinjaTrader.Strategy
      {
      ///<summary>
      ///
      ///</summary>
      [Description("")]
      publicclass SARTest1 : Strategy
      {
      #region Variables
      // Wizard generated variables
      // User defined variables (add any user defined variables below)
      #endregion

      ///<summary>
      /// This method is used to configure the strategy and is called once before any strategy method is called.
      ///</summary>
      protectedoverridevoid Initialize()
      {
      Add(ParabolicSAR(0.02, 0.2, 0.02));
      Add(ParabolicSAR(0.02, 0.2, 0.02));

      CalculateOnBarClose = true;
      }

      ///<summary>
      /// Called on each bar update event (incoming tick)
      ///</summary>
      protectedoverridevoid OnBarUpdate()
      {
      // Condition set 1
      if (CrossBelow(GetCurrentAsk(), ParabolicSAR(0.02, 0.2, 0.02), 1))
      {
      EnterShort(DefaultQuantity, "");
      }

      // Condition set 2
      if (CrossAbove(GetCurrentAsk(), ParabolicSAR(0.02, 0.2, 0.02), 1))
      {
      ExitShort("", "");
      }
      }

      #region Properties
      #endregion
      }
      }

      Comment


        #4
        One more message from a log:
        Default
        Error on setting property 'Account' for strategy 'SAR6minShort': Object reference not set to an instance of an object.

        Comment


          #5
          I apologize for cofusion. I thought the start button was pressed but it was not. Everything is working now. Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by JesseOffshore, Today, 09:40 PM
          0 responses
          1 view
          0 likes
          Last Post JesseOffshore  
          Started by WHICKED, 04-26-2024, 12:56 PM
          4 responses
          139 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by ezrollin, 02-26-2022, 11:14 PM
          7 responses
          207 views
          0 likes
          Last Post kenz987
          by kenz987
           
          Started by rocketman7, Today, 08:34 PM
          0 responses
          5 views
          0 likes
          Last Post rocketman7  
          Started by rt61968, 02-17-2018, 05:24 PM
          3 responses
          2,736 views
          0 likes
          Last Post MasterEtrad3  
          Working...
          X