Sterling API Take profit orders

Discussion in 'Order Execution' started by DoctorProfits, Mar 7, 2022.

  1. I am having trouble placing take-profit server-side stop orders. For instance, taking a long position on a ticker price at $100. if I place a sell order at $120, it gets executed immediately, is there a way to avoid this? Sterling does not have OCO bracket orders.
     
  2. Robert Morse

    Robert Morse Sponsor

    Sterling Trader Pro allows you to tag orders as OCO. https://www.sterlingtradingtech.com...-guides/sterling-trader-pro-guide/oco-orders/


     
  3. I don't have that functionality, it is grayed out and the Sterling's ActiveX object library pdf has no functions that work with OCO
     
  4. Robert Morse

    Robert Morse Sponsor

    You did not say you were automated. There are a number of functions not accessible on the API that can be on the display. If you are automated, why do you need OCO when you can program your server to do that?

     
  5. Sorry, I'm not particularly looking for OCO brackets. I'm writing an algorithm using their c#, I program the algorithm for when an order is filled, A TP/SL order would be placed and if one is triggered the other TP/SL order would cancel. When I tested the algorithm a few days ago, I noticed my TP order was being filled immediately after being placed even though the profit target was far from the current price. This occurred on both longs and shorts. I am looking for a way to place my TP order without getting filled immediately like this.
     
  6. Robert Morse

    Robert Morse Sponsor

    I'm going to PM you.
     
    DoctorProfits likes this.
  7. Okay.
     
  8. The issue was the use of the demo account. The orders would fill at the TP price even though the asset price was nowhere near the TP price. On a live account, sending the order to the exchange "DAY" instead of having a server stop allowed tp to work properly and not execute immediately.