Hello,

I am currently writing a broker API and I have some issues regarding limit/stop orders.
I want to be able to place such orders through the API using the variable OrderLimit and to be able to cancel them calling BrokerSell2.
So far the only way I found is to return a size when calling BrokerBuy2 and BrokerTrader as if the size is 0 Zorro will not call BrokerSell2 when trying to delete it.
This issue is that Zorro considers it in that case as an opened trade and update the current PnL taking this trade into account.
Could you please tell me the way to make Zorro understanding this trade is pending?

Also, if I initialize a limit order without calling the broker API but by doing:
TRADE* trade = enterShort(3, -42000);
trade->nID = 100001;
This trade will be available when looping on opened trades with for(open_trades) and I get TradeIsPending=TRUE.
However even if I save this trade to the .trd file using:
SaveMode = SV_TRADES;
Zorro is not able to load it at the next session.
Am I doing something wrong here?



Last edited by byakuren81; 03/04/22 19:17.