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 Segwin, 05-07-2018, 02:15 PM
          14 responses
          1,789 views
          0 likes
          Last Post aligator  
          Started by Jimmyk, 01-26-2018, 05:19 AM
          6 responses
          837 views
          0 likes
          Last Post emuns
          by emuns
           
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,293 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          13 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          63 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X