Get info if position has been closed by stop loss or take profit
Get info if position has been closed by stop loss or take profit
I have code that listens to all trading messages. I`m checking if given message is: PROTO_OA_EXECUTION_EVENT and order ClosingOrder and order type STOP_LOSS_TAKE_PROFIT. But I cannot find which of these 2 closed position. Was it by stop loss or take profit? I`m trying to use code:
var executionEvent = ProtoOAExecutionEvent.CreateBuilder().MergeFrom(msg.Payload).Build();
var byStopLoss = executionEvent.Order.HasStopLoss
var byTakeProfit = executionEvent.Order.HasTakeProfit
but they are always false.
Hi noob7,
Did you try checking executionEvent.Position.HasStopLoss and executionEvent.Position.HasTakeProfit?
Best Regards,
Panagiotis
Copyright © 2023 Spotware Systems Ltd. All rights reserved.