• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question on a function in the TS DLL

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

    Question on a function in the TS DLL

    int NTCancelAllOrders
    Cancels all orders across all connections across all accounts. A return value of 0 indicates success and -1 indicates an error. Success indicates success in submitting the command NOT that all orders are in fact cancelled.

    int NTCancel(string orderId)
    Cancels an order by orderId. A return value of 0 indicates success and -1 indicates an error. Success indicates success in submitting the command NOT that the order has in fact been cancelled.


    I have 2 orders pending one on INTC the other on MSFT.

    NTBuyLimit("A_Trade", 500, 100); // limit order for INTC
    NTBuyLimit("A_Trade", 500, 50); // limit order for MSFT


    Situation: 1) On my chart of MSFT on tradestation the following code gets executed... No code is generated on my chart of INTC
    NTCancelAllOrders;

    Situation: 2) On my chart of MSFT on tradestation the following code gets executed... No code is generated on my chart of INTC
    NTCancel("A_Trade");

    Situation 1) The limit order for both MSFT and INTC get cancelled right??

    Situation 2) I'm not really sure on this one. I know that the limit order for MSFT gets cancelled, but does the limit order for INTC gets cancelled. There was no code that was executed on the INTC chart, however the "order ID" for both the limit order of INTC and MSFT were the same, so would that mean that all orders in the account with the order ID of "A_Trade" gets cancelled or is the only order that will be getting cancelled the symbol of the chart in which the code of generated, and in this case MSFT ?

    I hope that was clear

    Thanks

    #2
    Situation 1) Correct

    Situation 2) I suspect this will not work since you can't submit two orders with the same id value, they need to be unique. The call will only cancel the order associated to the id value passed in.
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AspenHiker, Today, 08:37 AM
    0 responses
    1 view
    0 likes
    Last Post AspenHiker  
    Started by dshalom9, Today, 08:36 AM
    0 responses
    1 view
    0 likes
    Last Post dshalom9  
    Started by StarTrader, 07-11-2020, 11:27 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by rtwave, Yesterday, 04:11 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by sachin shetty, 07-11-2020, 08:49 PM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Working...
    X