Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stragety WILL NOT enter when I click activate...

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

    Stragety WILL NOT enter when I click activate...

    When I go to activate a strategy it says it is already in one, how do I get the strategy to just look at what is coming in at that moment instead of history? Is there a work around for this Highly Annoying feature?

    #2
    Hello tanju23,

    You can include the following statement in your code to avoid the strategy to be calculated on historical data.

    // Only run on real-time data
    if (Historical)
    return;

    Add the statement to the top of OnBarUpdate()
    JasonNinjaTrader Customer Service

    Comment


      #3
      I'm using the wizard to start with...is this a problem? When i unlock code I see this

      /// <summary>
      /// Called on each bar update event (incoming tick)
      /// </summary>
      protected override void OnBarUpdate()

      What would it look like with what you are saying to do?

      Comment


        #4
        What do you mean by "on top"?

        Comment


          #5
          You will need to unlock the code in order to insert the statement. Please see the attached screenshot for an example.

          I included the statement in the SampleMACrossOver strategy. It is the first statement below OnBarpdate() (to the top).
          Attached Files
          JasonNinjaTrader Customer Service

          Comment


            #6
            Ahhhh...thank you very much!!!!

            Comment


              #7
              When i try to do this i get errors. Any suggestions?
              Attached Files

              Comment


                #8
                Can you please hit F5 or right click in the code window and select 'Compile'.

                Let me know if the errors remain.
                JasonNinjaTrader Customer Service

                Comment


                  #9
                  Still Havings Problems

                  I know its been awhile since i last posted...but i never did get to work. When i hit F5 or right click and compile, a window pops up and says error generating strategy. Is this because I'm the strategy wizard to start off with?

                  Comment


                    #10
                    ???

                    I also just tried to duplicate the example from the sample ma cross that was posted below and it still says programming errors.

                    Comment


                      #11
                      Please debug the code to solve the compiling errors. You can find general debug information at the link below.


                      If the issue remains, please post a new screenshot of the compiling error.
                      JasonNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by ghoul, Today, 06:02 PM
                      0 responses
                      7 views
                      0 likes
                      Last Post ghoul
                      by ghoul
                       
                      Started by Barry Milan, Yesterday, 10:35 PM
                      6 responses
                      18 views
                      0 likes
                      Last Post Barry Milan  
                      Started by DanielSanMartin, Yesterday, 02:37 PM
                      2 responses
                      13 views
                      0 likes
                      Last Post DanielSanMartin  
                      Started by DJ888, 04-16-2024, 06:09 PM
                      4 responses
                      13 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by terofs, Today, 04:18 PM
                      0 responses
                      12 views
                      0 likes
                      Last Post terofs
                      by terofs
                       
                      Working...
                      X