Tradestation API

Discussion in 'Trading Software' started by roi888, Jul 12, 2020.

  1. roi888

    roi888

    Hey guys
    does anyone use Tradestation API?

    I am having difficulties in understanding the reply I get for market order,
    and the documentation is not that clear.

    for example, I want to send OSO and monitor it's execution and by a specific condition to be able to cancel it.
    for the above order I"m getting a bunch of id's,
    and don't know which is which?
    In my application I need to check if the main order was fulfilled or else cancel it. Which id should I choose to cancel?
    Also, at a certain point I would like to update the BUYTOCOVER Limit to become BUYTOCOVER Market, how do I find the id of my BUYTOCOVER order
    among the four id's I received?
     
  2. Bugsy

    Bugsy

    I would suggest going to the tab

    Help>>Get Help>>Platform Trading

    From there, at the top you will see more Tabs. Go to

    Place Trades>>Trade Bar>>Trade Bar Orders>>OCO/OSO Orders>><Choose one of the drop downs from here>

    I only utilize Chart Trading and OCO orders.
     
    SunTrader likes this.
  3. I work directly in the Ewrapper class.
    for example to check if my order is executed, in the orderopen method which called each time an order is opened I can add this condition.

    if ((contract.symbol) .equals ("ES") && order.Action () == "BUY" && orderState.getstate () == "Filled")
    { comptpostion + = 1;
    idorder = orderId;

    }
    so in the main function I can check comptpostion to check if we have Es and already sent or not. I can also use the variable idorder which contains the identifier of the order to modify or cancel the order. with ib api to close an order just send a reverse order