darwinex / dwxconnect

Seamlessly link any Trading Strategy in ANY programming language to Darwinex liquidity via MetaTrader 4 or 5. DWX Connect is your very own, fully customizable Trading API!
BSD 3-Clause "New" or "Revised" License
158 stars 84 forks source link

trouble with get_historic_data #17

Closed bojnordsky closed 1 year ago

bojnordsky commented 2 years ago

Hi there How can I access historical data after I call that function? It just tells us how many bars are there. I tried to read the historic_data_file in the DWX folder but it doesn't;t update when I change the currency. Also, sometimes It doesn't make any file in that directory.

elvinex commented 2 years ago

Hi, If you call the get_historic_data function, the respond should trigger the on_historic_data(self, symbol, time_frame, data) function of the tick_processor class as in the example script.

Per default it just prints the length of the data, but you can also print the whole thing, or do any calculations with it.

bojnordsky commented 2 years ago

Many thanks. Another question: Is there any way to get some indicator data? for instance, can I access the RSI of MACD, etc.? I already know we can recode those indicators but this would be easier :)

bojnordsky commented 2 years ago

And also, can I access multiple currencies' historical data at once?

teddywaweru commented 2 years ago

Many thanks. Another question: Is there any way to get some indicator data? for instance, can I access the RSI of MACD, etc.? I already know we can recode those indicators but this would be easier :)

Hi @bojnordsky . One option you could employ is the pandas-ta library module, which offers some common indicators. If not, I think another alternative would be to include the functions for your indicator into the EA and make calls to it..

bojnordsky commented 2 years ago

Many thanks. Another question: Is there any way to get some indicator data? for instance, can I access the RSI of MACD, etc.? I already know we can recode those indicators but this would be easier :)

Hi @bojnordsky . One option you could employ is the pandas-ta library module, which offers some common indicators. If not, I think another alternative would be to include the functions for your indicator into the EA and make calls to it..

Many thanks. And what about the other question?

elvinex commented 2 years ago

You can subscribe to bar data for multiple symbols, but only request historic data for single symbols.

However, you can just send get_historic_data in a loop for multiple symbols. The response to all these requests will be stored in a dictionary self.dwx.historic_data, which you could use.