Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Preventing overfill?
Collapse
X
-
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?Tags: None
-
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
-
Originally posted by relogical View PostMy 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
-
Hello Tasker-182,
Thank your for your post.
Originally posted by Tasker-182 View PostHow was this resolved?
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 ninza33, Today, 09:10 AM
|
1 response
10 views
0 likes
|
Last Post Today, 09:46 AM | ||
Started by goodknight777, Today, 08:43 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:25 AM | ||
Started by kramnor2001, Yesterday, 02:30 PM
|
3 responses
21 views
0 likes
|
Last Post
by kramnor2001
Today, 09:20 AM
|
||
Started by Padan, Today, 02:02 AM
|
3 responses
12 views
0 likes
|
Last Post Today, 08:54 AM | ||
Started by Tim-c, Today, 08:36 AM
|
1 response
5 views
0 likes
|
Last Post Today, 08:45 AM |
Comment