BinaryOptionsTools-v2 icon indicating copy to clipboard operation
BinaryOptionsTools-v2 copied to clipboard

When receiving candles, the data received is not up-to-date and not complete.

Open kos-ds opened this issue 1 year ago • 10 comments

Hi! V2 works, but not completely, on v2 I connect to a real account, take the balance, but when I want to get candles, it does not give them in normal form. I do not know what the problem is.

I want get 10 candles from 1M timeFrame with this: candles = await api.get_candles("EURUSD_otc", 60,600 )

And api return me: Candles: time open close high low 0 2025-04-14T17:56:00Z 1.06447 1.06432 1.06449 1.06422 1 2025-04-14T17:57:00Z 1.06439 1.06474 1.06474 1.06433 2 2025-04-14T17:58:00Z 1.06474 1.06443 1.06474 1.06441 3 2025-04-14T17:59:00Z 1.06443 1.06474 1.06474 1.06416 4 2025-04-14T18:00:00Z 1.06474 1.06485 1.06507 1.06469 5 2025-04-14T18:01:00Z 1.06484 1.06485 1.06498 1.06459 LEN: 6 It's both in real and in demo Moreover, the request time is 18:06:00, and the last candle is 18:01:00 I expect 10 values ​​from it and for the last candle to be closer to the current time. Please HELP!

kos-ds avatar Apr 14 '25 16:04 kos-ds

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

Rick-29 avatar Apr 14 '25 16:04 Rick-29

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

my code:

from BinaryOptionsToolsV2.pocketoption import PocketOptionAsync import pandas as pd import asyncio

async def main(ssid: str): # The api automatically detects if the ssid is for real or demo account api = PocketOptionAsync(ssid) await asyncio.sleep(5)

balance = await api.balance()
print(f"Balance: {balance}")


for x in range(100):

    candles = await api.get_candles("EURUSD_otc", 60,600 )        
    print(f"LEN RAW Cand: {len(candles)}")
    candles_pd = pd.DataFrame.from_dict(candles)
    print(f"Candles: {candles_pd}")
    print(f"LEN: {len(candles_pd)}")
    await asyncio.sleep(10)
    print(f"After Sleep: {x}")

if name == 'main': ssid = input('Please enter your ssid: ') asyncio.run(main(ssid))

kos-ds avatar Apr 14 '25 16:04 kos-ds

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

You can check out a example on how to do it here: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/examples%2Fpython%2Fasync%2Fsubscribe_symbol_timed.py

theshadow76 avatar Apr 14 '25 16:04 theshadow76

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

You can check out a example on how to do it here: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/examples%2Fpython%2Fasync%2Fsubscribe_symbol_timed.py

Exception has occurred: AttributeError 'PocketOptionAsync' object has no attribute 'subscribe_symbol_timed'

kos-ds avatar Apr 14 '25 16:04 kos-ds

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

I tried this program on another computer with Windows 11, the result is the same. When I use the V1 library, I get the candles correctly, but I can't switch to real. Something is missing in V2, tell me what.

kos-ds avatar Apr 14 '25 16:04 kos-ds

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

You can check out a example on how to do it here: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/examples%2Fpython%2Fasync%2Fsubscribe_symbol_timed.py

Exception has occurred: AttributeError 'PocketOptionAsync' object has no attribute 'subscribe_symbol_timed'

What version of the api are you using the subscribe_symbol_timed is only available for the version 0.1.6a3 and newer

Rick-29 avatar Apr 14 '25 17:04 Rick-29

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

You can check out a example on how to do it here: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/examples%2Fpython%2Fasync%2Fsubscribe_symbol_timed.py

Exception has occurred: AttributeError 'PocketOptionAsync' object has no attribute 'subscribe_symbol_timed'

What version of the api are you using the subscribe_symbol_timed is only available for the version 0.1.6a3 and newer

I think last: PS D:\po222> pip install binaryoptionstoolsv2==0.1.6a4 Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: binaryoptionstoolsv2==0.1.6a4 in c:\users\user\appdata\roaming\python\python313\site-packages (0.1.6a4) Or not?

kos-ds avatar Apr 15 '25 06:04 kos-ds

It seems that the get_candles function has some kind of delay, the data with is returned by the PO server, to get realtime candles you can use the subscribe_symbol_timed function, or maybe try the history function.

You can check out a example on how to do it here: https://github.com/ChipaDevTeam/BinaryOptionsTools-v2/blob/master/examples%2Fpython%2Fasync%2Fsubscribe_symbol_timed.py

Exception has occurred: AttributeError 'PocketOptionAsync' object has no attribute 'subscribe_symbol_timed'

What version of the api are you using the subscribe_symbol_timed is only available for the version 0.1.6a3 and newer

How i can check version?

kos-ds avatar Apr 15 '25 06:04 kos-ds

you can use I think pip list

theshadow76 avatar May 13 '25 09:05 theshadow76

fixed, now install: pip install binaryoptionstoolsv2==0.1.8 for the latest version

theshadow76 avatar Jul 16 '25 07:07 theshadow76