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 zstheorist, Today, 07:52 PM
          0 responses
          3 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          149 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          5 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          5 views
          0 likes
          Last Post tkaboris  
          Working...
          X