iqoptionapi icon indicating copy to clipboard operation
iqoptionapi copied to clipboard

How to get candles?

Open leom97 opened this issue 6 years ago • 1 comments

Hi, I'm trying to get the candles from a given timestamp to another of a certain asset. I achieved that by editing the candles.py script in the following way:

def __call__(self, active_id, duration, number):
    """Method to send message to candles websocket chanel.

    :param active_id: The active identifier.
    :param duration: The candle duration.
    """
    data = {"active_id": active_id,
            "duration": duration,
            "chunk_size": number,
            "from": self.api.timesync.server_timestamp - number,
            "till": self.api.timesync.server_timestamp }

    self.send_websocket_request(self.name, data)

number is the number of candles I want to obtain. It turns out that the maximum number of candles is 3600 with duration=1, 720 with duration=5. Is there a way I can arbitrarily increase the amount of data I want to save?

Thanks in advance!

leom97 avatar Sep 15 '17 10:09 leom97