Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order functions

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

    Order functions

    Is it possible that you could post the recommended code pattern for the following:

    As a specific event occurs (for example the closing price of a bar crosses a certain price point) I want to enter a position (say 10 long). The strategy is not to do anything until that position has been reached. How do I ensure that the target position is reached no matter what?

    Running a test on a 1 tick chart on FDAX 09-07 I had some weird things happen. If I only call EnterLong() on the initial bar I sometimes got my order cancelled partially filled. If I resubmit until the target position is reached I sometimes got errors or overfill depending on if I called the function again with the target quantity or the target quantity minus the current MarketPosition.Quantity.

    The problems seemed to happen at random, but were much less frequent on slower moving markets.

    I am sure I must be doing something wrong, but I am just not sure what. Therefore my question.

    #2
    Sorry, due to bandwidth reasons we are unable to provide support at that level. You might consider contacting a NinjaTrader consultant: http://www.ninjatrader.com/webnew/pa...injaScript.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    332 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X