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

changeOrder and Managed order Handling

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

    changeOrder and Managed order Handling

    Few questions hoping support will have the patience to answer them all.

    I am trying to figure out the correct direction to take to implement the execution.I am working on both Ninjatrader8 and also still ninjatrader7.
    I'd like to use Managed handling to play safe even though I am an advanced programmer and a little familiar with unmanaged programming.
    I prefer to use liveUntilCancelled for the limit order and be able to amend the entry price to follow for example an SMA.

    For such purpose can I use ChangeOrder() in NinjaTrader8? And in Ninjatrader7?
    or should I use EnterLongLimit with the same string-signal-name?

    Also, using ExitLongLimit()​ can I amend the exit price (using "fromEntrySignal​" ) ? Also in Ninjatrader7 ?

    What is the main drawback of not using liveUntilCancelled and code by Keeping orders alive​ ? Is it slower? Less clean?

    Are stops generally held on the server side?

    Are the above answers similar for both CQG and Rithmic?

    Not using liveUntilCancelled will will work ok with Rithmic ?

    #2
    Hello giogio1,

    Thanks for your post.

    If you are using the isLiveUntilCancelled property for your Entry order method then you could use ChangeOrder() to change the order in your script in NinjaTrader 8. Or, you could call the order method again with the same signal name.

    NinjaTrader 8 ChangeOrder(): https://ninjatrader.com/support/help...htsub=ChangeOr der

    When using the Managed Approach in NinjaTrader 7 you would need to call the order method again with the same signal name as you have noted. ChangeOrder() in NinjaTrader 7 would be used if the strategy uses the Unmanaged Approach.

    Yes, fromEntrySignal is a property for Exit order methods in both NinjaTrader 7 and NinjaTrader 8 that could be used to tie and Exit order to an Entry order.

    NinjaTrader 7 Managed Approach: https://ninjatrader.com/support/help...d_approach.htm
    NinjaTrader 8 Managed Approach: https://ninjatrader.com/support/help...d_approach.htm

    If the isLiveUntilCancelled property is not used then orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted.

    From the Managed Approach help guide: "By default, orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted"

    For information about where your orders reside, please see the forum thread and help guide page linked below.

    Where your orders reside NinjaTrader 7: https://forum.ninjatrader.com/forum/...der-7#post5506
    Where your orders reside NinjaTrader 8: https://ninjatrader.com/support/help...rs_reside_.htm

    Yes, isLiveUntilCancelled could be used in a strategy running on CQG or Rithmic.

    When using Rithmic, the sequence of OnOrderUpdate(), OnExecutionUpdate(), and OnPositionUpdate() events are not guaranteed due to provider API design. You could keep in mind the following information from the NinjaTrader 8 help guide regarding using OnExecutionUpdate() and OnOrderUpdate() with Rithmic in NinjaTrader.

    OnExecutionUpdate(): "Rithmic and Interactive Brokers Users: When using a NinjaScript strategy it is best practice to only work with passed by value data from OnExecution. Instances of multiple fills at the same time for the same instrument might result in an incorrect OnPositionUpdate, as sequence of events are not guaranteed due to provider API design."

    OnOrderUpdate(): "Rithmic and Interactive Brokers Users: When using a NinjaScript strategy it is best practice to only work with passed by value data from OnExecution. Instances of multiple fills at the same time for the same instrument might result in an incorrect OnPositionUpdate, as sequence of events are not guaranteed due to provider API design. For an example on protecting positions with this approach, see OnExecutionUpdate()"

    OnPositionUpdate(): "Rithmic and Interactive Brokers Users: When using a NinjaScript strategy it is best practice to only work with passed by value data from OnExecution. Instances of multiple fills at the same time for the same instrument might result in an incorrect OnPositionUpdate, as sequence of events are not guaranteed due to provider API design. For an example on protecting positions with this approach, see OnExecutionUpdate()"

    NinjaTrader 8:
    OnOrderUpdate(): https://ninjatrader.com/support/help...rderupdate.htm
    OnExecutionUpdate(): https://ninjatrader.com/support/help...tionupdate.htm
    OnPositionUpdate(): https://ninjatrader.com/support/help...tionupdate.htm

    NinjaTrader 7:
    OnOrderUpdate(): https://ninjatrader.com/support/help...rderupdate.htm
    OnExecutionUpdate(): https://ninjatrader.com/support/help...nexecution.htm
    OnPositionUpdate(): https://ninjatrader.com/support/help...​​
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Trader146, Today, 11:41 AM
    0 responses
    2 views
    0 likes
    Last Post Trader146  
    Started by jpapa, 04-23-2024, 07:22 AM
    2 responses
    16 views
    0 likes
    Last Post rene69851  
    Started by funk10101, Today, 11:35 AM
    0 responses
    1 view
    0 likes
    Last Post funk10101  
    Started by samish18, Today, 11:26 AM
    0 responses
    1 view
    0 likes
    Last Post samish18  
    Started by Trader146, 03-29-2024, 01:22 PM
    2 responses
    14 views
    0 likes
    Last Post Trader146  
    Working...
    X