Hi,

I need some ideas / help to bypass a problem with BrokerAsset (Error 053) while trading a multi Asset strategy using the Binance Futures Plugin.

The problem is that when an Asset becomes unavailable or unsubscribed from the websocket, the connection stopped as a whole and trading stops not only for the unavailable assets, but for all:

From the _diag log:

Code
Load ETCUSDT
BrokerAsset ETCUSDT 0 => 
printf: 
!§s0  (494.990800 ms)
printf: 
Error 053: §s unavailable at this time


From the _real log (Debug 7):

Code
!FEED_WS: readloop_handler: unspecified system error
!BrokerAccount: 'stopped' detected!
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
!BrokerAsset: stopped
...


As for the BrokerPlugin docs (https://manual.zorro-project.com/brokerplugin.htm) when an Asset is unavailable it returns Error 053 and trading with that asset is disabled. That's Ok, and perfectly fine, but as my understanding trading should be disabled only for that asset, and not the remaining ones that are Ok and available IMHO. I debug that and If I comment the affected asset and connect again the system resume the trading session without problem.

I talked with support about this and they were very helpful, but unfortunately I am not a very good coder, and not sure what are the best way to setup this workaround, as it is more complex than expected.

Option 1: Use Ignore(53) to continue trading with the other assets: This option is not working (in my test) maybe because it only have effect at the start of the trading session: https://manual.zorro-project.com/errors.htm

Option 2: Detect that the Asset is unavailable by script and exclude it from the trading session, restarting the connection with the broker again.

This is a complex thing because it is necessary to do in the error() or callback() function and then connect again without the unavailable Assets. It could be something like this:

1.- Detect the error
2.- Check and Stop the connection with the broker if already open with login(2); or login(4);
3.- Exclude the affected asset
4.- Start again the connection with the broker with login(1)

If someone have a better idea, or similar experiences and can share some code it would be great as I am a bit desperate with this problem.

Thank you so much