Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with order management logic

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

    Help with order management logic

    I have written an order management algo for a simple MA crossover strategy. I have been backtesting it with 2 year of 1 min interval ES data. The main idea is to enter positions using stop limit orders, to exit positions using also stop limit orders and to use stop orders for stoploss. Line 187, 205 and 220 are for debug purpose. As you can see if you run the program, the if-block of line 204 never get executed. I have been scatching my head for almost a week. I really appreciate if anyone can shed some light on it.
    P.S. the code is really simple to follow.
    Thanks.
    Attached Files

    #2
    imagineer, please add TraceOrders = true to the Initialize(), you most likely run into the Internal Order Handling Rules with this and the script would not make it into OnExecution potentially - http://www.ninjatrader-support2.com/...ead.php?t=3627

    Please also see the bottom section of this link here - http://www.ninjatrader-support.com/H...verview36.html

    NinjaTrader 7 offers new features in this regard offering more flexibility - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html

    New Unmanaged Order Submission
    In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    66 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X