Hi,

I have some questions regarding the BrokerAPI for Zorro 1.96.4, while testing my plugin:

1) The TradeTest script seems broken. I can only open trades, but not closing them for a hedged account.
Zorro keeps on saying that one needs to check the NFA flag.
But NFA is set to Off and the hedge mode is set to 2.
The function "BrokerSell" gets never called.
Even when setting AUTO=on, Zorro opens some trades but can not close them, since the NFA is "wrong".
I remember that the TradeTest script was working fine in previous versions; would be very helpful if the developers could fix this.
Edit: I even created a dedicated Accounts.csv entry where NFA compliance is explicitly turned off(0) with no success.
Zorro still says "Closing prohibited - check NFA flag!"

2) Semantics of function brokerCommand (int nCommand, DWORD dwParameter) is sometimes unclear.
The manual says that "they return 0 when they are not supported or no broker connection is established", so returning 0 is for signaling error.
But what about commands which can return 0 as a value? Take GET_NTRADES as an example.
It should return the number of open trades...but what if there are no open trades currently? What does a return of 0 mean here, an error or zero trades?

3) Again regarding brokerCommand: it is unclear for some commands if the value should stay fix for the entire trading session.
Take SET_ORDERTEXT as an example. Should I set the orderText for the next trade which gets opened or should it be set to every upcoming orders?
Or what about SET_LIMIT? To me this makes only sense for the next trade related command and not for every other.
So, I invalidate the limit after applying it and the script has to set a new value again.
The documentation should make it clear on the lifetime of the command values.

Thx for help and have nice holidays laugh
Juergen

Last edited by ibne; 12/26/18 11:03.