Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Preventing overfill?

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

    Preventing overfill?

    My strategy goes long and then short on reversal. The problem I am having is that each time it reverses I get an overfill error. I fixed this by including Position.MarketPosition == MarketPosition.Flat but that prevents my strategy from entering a position once the previous one has been closed and so it then waits for the entry signal while missing the one before. Is there a way not to use Position.MarketPosition == MarketPosition.Flat so that I can catch every reversals move?

    #2
    Hello relogical,
    Can you send a toy NinjaScript code* replicating the behavior to support[AT]ninjatrader[DOT]com

    Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email.

    I look forward to assisting you further.

    *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Originally posted by relogical View Post
      My strategy goes long and then short on reversal. The problem I am having is that each time it reverses I get an overfill error. I fixed this by including Position.MarketPosition == MarketPosition.Flat but that prevents my strategy from entering a position once the previous one has been closed and so it then waits for the entry signal while missing the one before. Is there a way not to use Position.MarketPosition == MarketPosition.Flat so that I can catch every reversals move?

      How was this resolved?

      Comment


        #4
        If I where you I'd wait for NT8 version which will be awesome. Current version has way too many bugs that will blow up your brokerage account.

        Comment


          #5
          Hello Tasker-182,

          Thank your for your post.
          Originally posted by Tasker-182 View Post
          How was this resolved?
          This case would be resolved through custom debugging of the users script to determine exactly why the Over-Fills occurred.

          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. By default, NinjaTrader will protect against over-fills even though you are using the Unmanaged approach by halting the strategy, but should you decide to custom program your own over-fill handling it is up to you to either prevent over-fills from being a possibility in your code or by introducing logic to address over-fills should one occur.

          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, but please see the provided resources below to help you proceed productively :

          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.

          If you would prefer the debug assist of a professional NinjaScript consultant, please check into the following listings - Click here for a list of certified NinjaScript Consultants

          Please let me know if you have any questions.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Stanfillirenfro, Today, 02:32 AM
          2 responses
          9 views
          0 likes
          Last Post Stanfillirenfro  
          Started by isataris, 06-23-2022, 04:29 AM
          5 responses
          62 views
          1 like
          Last Post torento
          by torento
           
          Started by ラリー, Today, 02:35 AM
          0 responses
          5 views
          0 likes
          Last Post ラリー  
          Started by manraygun, Today, 02:20 AM
          0 responses
          2 views
          0 likes
          Last Post manraygun  
          Started by ChriChurch, Today, 02:19 AM
          0 responses
          1 view
          0 likes
          Last Post ChriChurch  
          Working...
          X