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?

    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 argusthome, 03-08-2026, 10:06 AM
          0 responses
          65 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          41 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          23 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          26 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          52 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X