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 ZenCortexCLICK, Today, 04:58 AM
          0 responses
          2 views
          0 likes
          Last Post ZenCortexCLICK  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          172 responses
          2,280 views
          0 likes
          Last Post sidlercom80  
          Started by Irukandji, Yesterday, 02:53 AM
          2 responses
          17 views
          0 likes
          Last Post Irukandji  
          Started by adeelshahzad, Today, 03:54 AM
          0 responses
          5 views
          0 likes
          Last Post adeelshahzad  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X