How to stop the order that is placed via API at breakeven automatically

Step are :

  1. place a API buy/sell order
  2. order gets into some profit (lets say $400)
  3. now i would like that i have auto stop placed to be stopped out at breakeven?
  • i do no have dom access to place bracket order after the order is placed. is it possible with OSO? if any example would be great.

appreciate any help here.

You could just send another /order/placeOrder and make it a Stop at the price you originally bought.

The problem with that is i am using Autoview with tradingview and its sort of one way communication. i have no handle over the buy or sell price that my order was executed at.