Closed marleymwangi closed 6 years ago
Found it one of the closed ones...
Anyway, in the API folder search for a file named " timesync.py "... You'll find the expiry time there.. You can change it to whatever time you want..
self.__expiration_time = 1......
time seems to be in minutes
Not exactly whatever time. There is "turbo" mode and "binary" mode. You may see available times at api_init_all websocket return message.
@marleymwangi don't work, i have changed the value 1 to 15
@marleymwangi @lucianopinheiro @boskiv I want to open a position by setting the closing time. for example open 1$ in eur/usd time 13:00 binary. i have try a set self.__expiration_time = * minute , but don't work
You have to do something like: minutes = 3 exp_not_rounded = now() + minutes 3 60 round_exp = exp_not_rounded % 60 expiration = exp_not_rounded - round_exp
You should also test if you can open inside next minute or not (for example, if actual seconds > 30).
Also, on TURBO buy mode, you can set just to 5 minutes in advance. bigger times are available only at BINARY buy mode.
You probably should check how many minutes you need against api_init_all variable. If 1 ~ 5, use TURBO If 15, 30, 45, etc., use BINARY.
But you should never use time * minute. Because time is unix_timestamp (seconds since 1970-01-01), not number of minutes from now.
@lucianopinheiro thanks for your reply, Where should I apply this change in file?
exp_not_rounded = datetime.datetime.now() + minutes 3 60 TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'int'
datetime.now() uses a datetime object, not a unix timestamp. Just study a little bit more. :)
Hey, so I've been looking through the sample code posted here and I can't seem to find a way to change the expiration time for a binary option
The all seem to be one minute ...
Could someone please clarify how I can do this... Thanks