IbcAlpha / IBC

Automation of Interactive Brokers TWS. You can download the latest release here: https://github.com/ibcalpha/ibc/releases/latest
GNU General Public License v3.0
974 stars 174 forks source link

Invalid ClosedownAt setting #248

Open giulyko00 opened 5 months ago

giulyko00 commented 5 months ago

Hi and thanks for your precious work.

I'd like to know why do I get the error:

2024-01-28 22:50:54:487 IBC: Invalid ClosedownAt setting: 'Friday 23:30'; format should be: <[day ]hh:mm> eg 22:00 or Friday 22:00

What's wrong in my time format?

rlktradewright commented 5 months ago

Well, since you didn't attach your IBC log file, I have no information to go on.

The likely cause is that you haven't taken acount of this note to the ClosedownAt setting in config.ini:

# Note that the day of the week must be specified using your
# default locale. 

So if for example your default locale is set to French, you'd need to set it to Vendredi rather than Friday.

If this doesn't help, then attach your IBC log file to your reply (the whole of it please).

giulyko00 commented 5 months ago

Ok thank you so much. This in fact was the issue. I thought English was the go-to language for anyone using latin characters. Changed to Italian and works. Thanks again!

rlktradewright commented 5 months ago

Yes, I realise this is slightly confusing. The Java API that IBC calls to validate the value is locale-dependent, which means it expects the value to be formatted according to the rules of the locale that the operating system is running in. So if your OS is running in Italian, it will expect Italian day-of-week names. One day I will get round to improving this to allow English to be used.

This is completely independent from the language that TWS is running in, which must be English for IBC: this is because IBC has to recognise dozens of different bits of text to be able to detect the various windows and controls it's interested in: they are displayed in the language that TWS is running in. It would be technically possible for IBC to do this detection regardless of the TWS language, because all these strings are held in a locales resource file that can be used to map back to a language-independent identifier which IBC could work with. This was suggested to me many years ago by the author of TwsStart, a Windows program with similar functions to IBC. But life is too short...