• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trouble parametres Developing stretegy

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

    Trouble parametres Developing stretegy

    hi everybody thanks for ur attencion in others topic, in my strategy shorts are rejected as image can un help me please thanks.....

    #2
    Hello simonerg,

    Thanks for your post.

    The error message is pretty clear that you are submitting a buy stop (market or limit) order below the current price which results in a rejected order which then disables the strategy.

    You would need to correct your strategy coding so that is does not do that.

    As we do not know how you have coded your strategy, we could not provide further specific advise.

    If you do not wish to share or show your strategy coding in a public forum, please feel free to send it into PlatformSupport[at]NinjaTrader[dot]Com. Mark the e-mail Atten Paul and Ticket#2242523 and include a link to this thread for reference. In addition, include your strategy file which can be found in Documents>NinjaTrader8>bin>Custom>Strategies> and it will have the same name as your strategy.

    In most cases, you will want to debug your strategy (we do not provide debugging services), here is a link to our debugging tips which may get you started: https://ninjatrader.com/support/help...script_cod.htm Most likely you will want to compare the stop price you are using to the current price.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      greetings paul thanks for the response time for the support provided in the code I managed to solve the error with your help you are awsome... my strategy run so well!!

      Comment


        #4
        Hello simonerg,

        Thanks for your reply, glad we were able to help.

        For readers of this thread, the issue was created by unexpected entry orders which related to the use of Calculate.OnEachTick. The strategy is run on each tick and when the entry conditions were true they remained true for many ticks thus placing many orders. While the EntriesPerDirection was set to 1, in this OnEachTick mode, the strategy is run before the position can be updated to prevent further orders. The issue was solved by adding an int variable to store the bar number of the bar where the first entry order was placed and in the entry conditions, checking to see that the CurrentBar is not equal to the saved bar number. Example:

        if (Entry conditions && CurrentBar != savedBar)
        {
        // place order here
        savedBar = CurrentBar; // store the entry bar
        }


        Other solutions would be to use a bool variable that is set when the 1st entry occurs and checking the state of the bool as an entry condition, however this would require an addition set of conditions to "reset" the bool to allow for subsequent entries.
        Last edited by NinjaTrader_PaulH; 08-14-2019, 07:27 AM. Reason: fixed spelling error.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ct_fx, Today, 05:14 AM
        0 responses
        6 views
        0 likes
        Last Post ct_fx
        by ct_fx
         
        Started by Beauregard, Today, 04:36 AM
        0 responses
        5 views
        0 likes
        Last Post Beauregard  
        Started by fx.practic, Today, 04:34 AM
        0 responses
        7 views
        0 likes
        Last Post fx.practic  
        Started by thomaspartyof10, Today, 02:33 AM
        0 responses
        10 views
        0 likes
        Last Post thomaspartyof10  
        Started by ArmKnuckle, Today, 01:59 AM
        0 responses
        13 views
        0 likes
        Last Post ArmKnuckle  
        Working...
        X