Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Managed Strategy - Complete Sample?

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

    Managed Strategy - Complete Sample?

    Hello,
    I have previously created a fully functional Unmanaged strategy. Now, I am trying to further my education regarding MANAGED Orders.

    I would appreciate if you would answer each question.

    Is there a COMPLETE Sample with Managed Strategy?

    Does Managed use IOrder or is it "hidden"?

    Does Managed use OnOrderUpdate and OnExecutionUpdate or are they "hidden"?

    If I have a rejected order with Managed, and I have
    Code:
    RealtimeErrorHandling = RealtimeErrorHandling.TakeNoAction;
    what should I do to Cancel the Order and pending Target Order since the stop is cancelled automatically and no longer attached to the original order? Do I need to create the OnOrderUpdate and OnExecutionUpdate sections to handle this rejection?

    Thanks,
    kz
    Last edited by zeller4; 08-07-2011, 05:28 PM.

    #2
    Hello zeller4,

    Yes, there are complete samples with managed strategies. The built in one SampleMaCrossOver uses managed approach. There are also additional strategies in the reference sample section on these forums that are designed to help with different aspects of IOrders and advanced handling.

    Managed strategies can use IOrders and advanced handling, if you structure this way. This page can help with IOrders and advanced handling:


    If you have a rejected order, then you have to custom program in your own handling. This sample can help with CancelOrder():
    When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until
    Last edited by NinjaTrader_RyanM1; 08-07-2011, 06:07 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ryan,

      Thanks for the quick reply.

      I've reviewed the SampleMACrossOver. The reason I don't consider it a "complete" sample is that there are no demonstrations of exits. It's an "always-in" strategy. Showing Long and Short is fine, but there are no realistic "standing-on-the-sidelines" moments. Also, there is no demonstration of other "hidden" features of IOrder, OnOrderUpdate, or OnExecution. If there was a complete sample "JUST SHORT OF" "Advanced Handling", this would be a terrific asset to your reference sample database.

      I mainly want to be clear regarding SetStopLoss and SetProfitTarget and SetTrailStop. It's disconcerting to find these described under the Managed Approach description in the Order Methods help section. I'm sure I've seen numerous references to these being troubling for NT7 managed orders and strat development. Please clarify if by using SampleCancelOrder as a "starting point", I can stay away from the Set...-type orders and ignore any references to them.

      Thanks again.

      Kirk

      Comment


        #4
        Right, the SampleMaCrossOver is an introductory sample on the managed approach. There are other dedicated samples for common order management tasks available on these forums, in the reference sample section.

        Set statements are not required at all. If you are looking to use IOrders instead of these, then I would take a look at this sample on Using OnOrderUpdate() and OnExecution() methods to submit protective orders:
        The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()


        As well as this help guide article on Live Until Cancelled Orders here:


        The one on CancelOrder() is also good for manually cancelling orders. There isn't a complete all in one sample for advanced order handling, but those two and the help guide article are a good start.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X