Auto BreakEven thru API placeOSO

I want to use the Auto BreakEven over the API endpoint placeOSO. I have gotten it working thru startOrderStrategy over websocket but since startOrderStrategy don’t support levels/only distances its not working for our strategy. Lovely that nor breakEven or breakEvenPlus is even mentioned in the official api documentation however do still work over websocket is of course super strange.

So back to the original question if anybody have succeeded making orders with this enabled?

The API docs are indeed a bit out of ….well lets say they need some adjustments :slight_smile:
I use the placeOSO over the api but don’t use it for auto break even. Not sure why you can’t use the order strategy. I have a latency that is real low so I can live with the current price + points for setting things like an auto trailing to start etc.

The startorderstrategy over websocket works with breakEven nicely but then you get in to the other issue. startorderstrategy cant handle exact levels only distance. We have strategies that require an exact level for example for Stop Loss. Since its based on actual levels so if the there is a quick move on the market order and you get 2 points of these levels are complety of. So they should either just add levels support for startorderstrategy or add breakeven support for placeOSO. Why they are even different is so strange for me. And since documentation really suck its very hard to find out there are ways to get this working or not. Feels like having an API documentation that builds from code and are exact should be pretty easy. I also guess they want to take more of my money which they will if we can do API orders :stuck_out_tongue:

def modify_order_strategy(strategy_id, stop_loss=None, profit_target=None, trailing_stop=False, auto_trail_trigger=None, auto_trail_stop_loss=None):

    """Constructs and sends a modifyOrderStrategy request."""

    from tradovate.socket_manager import send_message  # Local import

    modify_body = {"orderStrategyId": strategy_id}

    if stop_loss is not None:

        modify_body["stopLoss"] = stop_loss

    if profit_target is not None:

        modify_body["profitTarget"] = profit_target

    if trailing_stop:

        modify_body["trailingStop"] = True

        if auto_trail_trigger is not None and auto_trail_stop_loss is not None:

            modify_body["autoTrailTrigger"] = auto_trail_trigger

            modify_body["autoTrailStopLoss"] = auto_trail_stop_loss

    

    modify_message = f"orderStrategy/modify\n2\n\n{json.dumps(modify_body)}"

    send_message(modify_message)

    logging.info(f"Sent modifyOrderStrategy request: {modify_message}")


of course I am not using your setup and I don’t use this function even though I created it but what I would do in your case is enter that trade using the points. Then on the confirmation message check how far off I am on the actual fill price to the assumed one and then adjust if needed accordingly