Now I have a problem that I don't know how to solve, no matter how easy it may seem.
private void CancelarOredenes()
{
submissionAccount.CancelAllOrders(instrumentSelect or.Instrument);
foreach (var position in submissionAccount.Positions)
{
if (position.MarketPosition != MarketPosition.Flat)
{
position.MarketPosition = MarketPosition.Flat;
}
}
}/// FALTA CANCELAR LA POSICION
I have created a button with which I intend to close all the orders but it does not close the open positions, can you tell me how to do it?

Comment