Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 ScottWalsh, Today, 04:52 PM
        0 responses
        1 view
        0 likes
        Last Post ScottWalsh  
        Started by ScottWalsh, Today, 04:29 PM
        0 responses
        5 views
        0 likes
        Last Post ScottWalsh  
        Started by rtwave, 04-12-2024, 09:30 AM
        2 responses
        22 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by tsantospinto, 04-12-2024, 07:04 PM
        5 responses
        70 views
        0 likes
        Last Post tsantospinto  
        Started by cre8able, Today, 03:20 PM
        0 responses
        7 views
        0 likes
        Last Post cre8able  
        Working...
        X