iB - NFA Flag error

Posted By: AndyF1982

iB - NFA Flag error - 06/26/20 20:25

Hi,
I have a script that should buy and sell stocks at specific dates. Broker is IB. The buying works, but the when selling I get an error: Closing prohibited - check NFA flag!
Does anybody knows why this error comes up and how I can fix it? Thanks

Andy
Posted By: AndrewAMD

Re: iB - NFA Flag error - 06/26/20 20:33

When using IB, you must set the NFA flag before you trade. You didn't set the NFA flag.
https://zorro-project.com/manual/en/ib.htm
https://zorro-project.com/manual/en/mode.htm#nfa
Quote
The IB API is NFA compliant and does not control individual trades. All trades can therefore only controlled by Zorro. The account portfolio only reflects the net sum of all open positions by all connected Zorros. The NFA flag must be set for IB accounts.
© 2024 lite-C Forums