Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Will disabling strategy turn off OCO for profit/stop loss

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

    Will disabling strategy turn off OCO for profit/stop loss

    Hello,

    I have a couple questions regarding this..

    I am wondering if once I disable my strategy, will the Sell Limit Order (Profit) and the Stop Loss Order (Loss) still use OCO. When the strategy is active it will cancel the other order once the profit is filled or the stop loss is filled.

    However, I am afraid that once I disable the strategy, that the other order that is unfilled will remain active. I do not want this to happen.

    My second question is, how do I decrease the Sell Limit Order and or the Stop Loss Order while the strategy is active? When I try, it reverts right back to the original profit and stop loss orders.

    I notice if I disable the strategy, I am able to adjust them, but I want to make sure they are OCO orders like they are when the strategy is active.

    thank you

    #2
    Hello Polufson,

    Thank you for writing in.

    You could determine if entry and exit orders cancel when a strategy is disabled by navigating to Control Center > Tools > Options > Strategies tab. Within the NinjaScript section of the Strategies tab, you may enable or disable automatic cancellation of entry and exit orders. A checkmark displayed means the setting is enabled and orders will be canceled when disabling a strategy.

    Here is a help guide link for more information - https://ninjatrader.com/support/help...derstandingnin jascriptProperties

    To change the price of the Sell Limit or Stop Loss order while a strategy is active, you could place an EnterLongLimit order with its isLiveUntilCanceled property set to true. Then, you could create your Profit Target and Stop Loss orders within OnExecutionUpdate. Please see the attached example strategy, 'SetProfitTargetAndStopLoss', demonstrating how this could be accomplished.

    This works because the order method is only called once from the strategy logic, and will stay alive with IsLiveUntilCancelled being set to false. When using Set methods, orders will move back based on the strategy Calculate mode

    Here are help guide links about EnterLongLimit and the isLiveUntilCanceled property.

    EnterLongLimit - https://ninjatrader.com/support/help...rlonglimit.htm

    LiveUntilCanceled orders - https://ninjatrader.com/support/help...ilCancelledOrd ers

    Also, here are help guide links about using OnExecutionUpdate - https://ninjatrader.com/support/help...and_onexec.htm

    Please let us know if we may further assist.
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by FrancisMorro, Today, 03:24 AM
    0 responses
    1 view
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,769 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    10 views
    0 likes
    Last Post Max238
    by Max238
     
    Working...
    X