Announcement

Collapse
No announcement yet.

error thrown by IB not caught by try catch block

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

  • error thrown by IB not caught by try catch block

    For the following code when IB throws error its not being caught in the try catch block, instead it just halts the script execution and throws error on the console, what am I doing wrong?
    try{
    orderid= Trade.buyLimit({"limit":cpr,"symbol":sSymBol,"qty" :un,"account":"XXXXX402","route":"SMART"});
    }catch(e){

    debugPrintln(" ERRROR :"+ e.message);
    }

  • #2
    I reread the the doc which says any error message will be will be thrown to the console, So i guess I need to make sure that error is handled in some way before placing the order.
    BTW here is the error message if any one has see this errro and handled it for IB please let me know. thanks in advance.

    This order will be directly routed to CBOE. Direct routed orders may result in higher trade fees.
    Restriction is specified in Precautionary Settings of Global Configuration/API.

    Comment


    • #3
      nvm, I found the setting in IB to turn off that message.

      Comment

      Working...
      X