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

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.
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by carnitron, Today, 08:42 PM
    0 responses
    6 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Today, 07:51 PM
    0 responses
    8 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,974 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Today, 06:48 PM
    0 responses
    9 views
    0 likes
    Last Post rbeckmann05  
    Started by rhyminkevin, Today, 04:58 PM
    4 responses
    58 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Working...
    X