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

overfill and stops

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

    overfill and stops

    Hello,

    it occurs that when there is an overfill then all positions are closed and NinjaTrader7 shows the message " there occurred and overfill.... closed", this I was experiencing when using NT-script-strategies. But it also occurs that there is an overfill and the positions are not closed and because of the overfill there are naked positions in the other direction. I couldn´t find out when all is closed and when there are positions running from an overfill. (I think it occurs when using an ATM from chart trader that there are positions from an overfill??)

    And in this concern I want to add: when I have a stoploss but I want to close the positions earlier from conditions in my NT-script how can I avoid an overfill please? What happens when I want to exit with a market order from conditions in a script but the price is moving fast suddenly, can it then happen that the mar****rderexit and the stop cause an overfill? What, if instead of using a market order to exit fast, when I move my stop closer when the conditions are true? Eg stop is 2353 and the script moves the stop to 2352 but same moment when stop is changed to 2352 the price jumps up to 2352.50. Will the stop work? Will there be an exit with this stop 2352.50 or doesnt it work because in that moment price 2352.50 is already higher then the stopprice 2352?

    Thank you!
    Tony
    Last edited by tonynt; 03-29-2017, 12:35 AM. Reason: translation error

    #2
    Hello tonynt,

    Thanks for your post.

    Over-Fills is a serious issue that can occur when using complex entry conditions that bracket the market in both directions end up with both entries being filled instead of one being cancelled. Over-Fills can also occur when you place a trade quickly hoping to close a position while a prior order to close the same position already had an in-flight execution. The exact scenarios in which an over-fill can occur is highly dependent on the specific strategy programming.

    Your NinjaScript / C# Code will always be logically processed and evaluate according to your set logic – this can of course lead to unexpected results at times, thus we would suggest to simplify and debug your code to better understand the event sequence it would go through - unfortunately we cannot offer such debug or code modification services here.

    First of all you would want to use Print() statements to verify values are what you expect - Debugging your NinjaScript code.

    For strategies add TraceOrders = true to your Initialize() method and you can then view valuable output related to strategy submitted orders through Tools > Output window - TraceOrders

    It may also help to add drawing objects to your chart for signal and condition confirmation - Drawing Objects.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Paul,

      I didn´t ask for debugging. Did I?

      So let me do one accurate question: when I move a stop closer to the entry, eg for a short position I move stop to 2352 and in same moment price goes up to 2352.50 will the stop order work and exit at 2352.50 or will it not work because stopprice is 2352 and below current price this moment.

      Thank you!
      Tony

      Comment


        #4
        Hello tonynt,

        Thanks for your reply.

        If your stop order is a market order and you move it below the current price, yes it will fill immediately.

        If your stop order is a limit order and you move it below the current price, no it will not fill.

        You can test this on your sim account, on a superdom, using the two stop order types.
        '
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Interesting topic

          Hello, I´m interested in this topic as well. I know how to set the DOM, but what is the correct syntax for a stop market order within an NT script code.?

          Thanks.

          Comment


            #6
            Hello jacko,

            Thanks for your post and welcome to the forums.

            Please review the helpguide on Managed approach: http://ninjatrader.com/support/helpG...d_approach.htm

            Please review the various order methods here: http://ninjatrader.com/support/helpG...er_methods.htm

            ExitLongStop() would be one example method.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by alifarahani, Today, 09:40 AM
            6 responses
            29 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            13 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X