Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Do I have to cancel Exit order from ExitLongLimit() if I need to change the price?

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

    Do I have to cancel Exit order from ExitLongLimit() if I need to change the price?

    I am using ExitLongLimi() with fromEntrySignal provided.

    myExitOrder = ExitLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, string signalName, string fromEntrySignal)

    If isLiveUntilCancelled = false, which means this ExitLongLimit only survives for the length of one bar. Then I could repeat to call ExitLongLimit() in each OnBarUpdate().
    If isLiveUntilCancelled = true, do I have to cancel this ExitLongLimit() in order to re-submit a new exit with different price?

    I printed myExitOrder: no change for the orderId, but price has changed when I call ExitLongLimit() in 2nd time without a cancellation.

    Order To String = orderId='bbb07527ca8845e9bb0222445e950b21' account='Sim101' name='Sell' orderState=ChangePending instrument='IBM' orderAction=Sell orderType='Limit' limitPrice=110.43 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=10 time='2020-09-15 10:55:53' gtd='2099-12-01' statementDate='2020-09-15'
    Order To String = orderId='bbb07527ca8845e9bb0222445e950b21' account='Sim101' name='Sell' orderState=ChangeSubmitted instrument='IBM' orderAction=Sell orderType='Limit' limitPrice=110.42 stopPrice=0 quantity=100 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=10 time='2020-09-15 10:55:53' gtd='2099-12-01' statementDate='2020-09-15'
    Last edited by localappleseed; 09-15-2020, 09:15 AM.

    #2
    Hello localappleseed, thanks for your post.

    If you call ExitLongLimit with the same signal name the price of the order will be modified. If it had a different signal name it would submit a completely separate order. We also have the ChangeOrder method:


    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    79 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X