Binance Testnet Futures PnL wrong

After calculating my position size, I’m risking $10 for 1:3 risk to reward but my profit is less, I’m getting less than the expected profit which is $30, what is causing this?? My trades hit TP but my realized profit is less than expected, any reason why this might be?? I haven’t tested trades on the live api

Please provide a sample of the request sent, expected outcome and actual outcome.

1 Like

BUY ORDER
order, err := client.NewCreateOrderService().Symbol(session.SYMBOL).

    Side(futures.SideTypeBuy).

    Type(futures.OrderTypeMarket).

    Quantity(base_currency_position_size.String()).

    NewOrderResponseType(futures.NewOrderRespTypeRESULT).

    WorkingType(futures.WorkingTypeMarkPrice).

    Do(context.Background())

STOPLOSS
stoploss_order, err := client.NewCreateOrderService().Symbol(session.SYMBOL).

    Side(futures.SideTypeSell).Type(futures.OrderTypeStopMarket).

    StopPrice(stoploss_price.String()).

    NewOrderResponseType(futures.NewOrderRespTypeRESULT).

    Quantity(base_currency_position_size.String()).

    TimeInForce(futures.TimeInForceTypeGTC).

    ReduceOnly(true).

    WorkingType(futures.WorkingTypeMarkPrice).

    Do(context.Background())

TAKEPROFIT
takeprofit_order, err := client.NewCreateOrderService().Symbol(session.SYMBOL).

    Side(futures.SideTypeSell).Type(futures.OrderTypeTakeProfitMarket).

    StopPrice(takeprofit_price.String()).

    NewOrderResponseType(futures.NewOrderRespTypeRESULT).

    Quantity(base_currency_position_size.String()).

    TimeInForce(futures.TimeInForceTypeGTC).

    ReduceOnly(true).

    WorkingType(futures.WorkingTypeMarkPrice).

    Do(context.Background())


this image shows inconsistent gains risking $10 to gain $30 after TP is hit

When working with the API, it’s best to work out the PNL yourself, or use the PNL from the API instead of the UI

@tantialex the position size is calculated for a risking $10, and the TP is calculated 3x the risk, logically the resulting profit should be $30, I’m getting $20 when my TP is hit and when my SL is hit I’m losing $10 sometimes or a little less. I just dont understand the behaviour

@tantialex so I reviewed my code and Binance api again and I figured out that when I place some orders I don’t get the prices at which I calculated for, why is this?? My SL or TP sometimes is not the same with what Binance fills

You have to put stop_limit_order because if you put stop_market_order you will not be filled at the price you want

1 Like

Hey @saent-x , care to share what your API futures url is? I am getting 404 errors on my end and don’t know what the problem is

@crsvld I’m using a 3rd party client library to interact with the API, but i guess you can get the info you’re looking for in the documentation