Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged Order Approach Examples

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

    Unmanaged Order Approach Examples

    Hi,

    Is there a collection of sample/reference strategies that illustrates how to use the unmanaged order approach in advanced scenarios which also illustrates all the things one would need to be concerned about vs using the managed approach? Is there something like that you can point me to?

    Thanks,
    FaaastEddy

    #2
    Hello FaaastEddy,

    Thanks for your post.

    You can read about the Unmanaged Approach following the documentation below. I have also attached an UnmanagedTemplate strategy which follows the same techniques as SampleOnOrderUpdate.

    Unmanaged Approach - https://ninjatrader.com/support/help...d_approach.htm

    SampleOnOrderUpdate (to compare with Unmanaged Template strategy) - https://ninjatrader.com/support/help...and_onexec.htm

    Unmanaged allows you to have full control over OCO and Overfilled orders, but removes the framework of the Managed Approach. We essentially just tell NinjaTrader to submit orders to buy and sell. SellShort and BuyToCover would be order types to enter short and close short positions, but the premise is essentially the same that we do not Enter/Exit, we just Buy/Sell.

    Let us know if you have any additional questions.

    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      Thanks for the UnmanagedTemplate sample code, its quite helpful to understand how to use the Unmanaged Order Approach.

      I have a question regarding order references. The sample has a comment in the OnOrderUpdate() method that indicates its more reliable to assign order objects there than in the OnBarUpdate() method. The reason provided is: "as the assignment is not guaranteed to be complete if it is referenced immediately after submitting". I want to double check if I get this point. As an example, you assign the order object that is returned from the unmanaged order submission call to an order entry variable in the OnBarUpdate() method. Then on the next line, you try to use it - is this is the unreliable case? If so why? The code is not async, so I assume after the order object assignment it should be there by the time the next line of code is processed. Or am I going down the wrong path in thinking what that comment means? When would you use the order object that is returned from the unmanaged order submission method? in the sample provided it's not assigned there but assigned in the OnOrderUpdate() instead.

      Comment


        #4
        Hello FaaastEddy,

        Your understanding is correct. The trying to use the order on the next line will either be the incorrect order, unreliable information, or will fail with an error.

        The code is async. OnBarUpdate runs from the data thread. OnOrderUpdate runs from the order thread. These are not synchronous.

        Below are links to the help guide.
        https://ninjatrader.com/support/help...rderupdate.htm
        https://ninjatrader.com/support/help...nbarupdate.htm

        Where you have inquired:
        "When would you use the order object that is returned from the unmanaged order submission method?"

        The answer is never. Always use the order object from OnOrderUpdate as advised in the help guide.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jipsonmv, Today, 06:51 AM
        0 responses
        7 views
        0 likes
        Last Post jipsonmv  
        Started by harr5754, Today, 06:28 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by aelagha, Today, 12:21 AM
        0 responses
        20 views
        0 likes
        Last Post aelagha
        by aelagha
         
        Started by rcrook23, Today, 03:06 AM
        1 response
        15 views
        0 likes
        Last Post rcrook23  
        Started by timekiller1985, Today, 02:46 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Jason  
        Working...
        X