Отсчет элементов копируемых данных (индикаторный буфер с индексом buffer_num) от стартовой позиции ведется от настоящего к прошлому, то есть стартовая позиция, равная 0, означает текущий бар (значение индикатора для текущего бара). При копировании заранее неизвестного количества данных в качестве массива-приемника buffer[] желательно...
Technical Analysis (TA) is an easy to use library that is built upon Python's Pandas library with more than 80 Indicators. These indicators are comminly used for financial time series datasets with columns or labels similar to: datetime, open, high, low, close, volume, et al. Many commonly used indicators are included, such as: Moving Average...
copy_buffer() implies getting an array of data for your calculations. Andcopy_buffer() should work both ways. What's missing is a bi-directional array transfer.
The symbols_total and symbol_name functions are missing To get a list of symbols like this:
In 5.0.29 added symbols_total(), symbols_get([group="EURUSD, "USDGBP", *RU*"]), requires the latest beta version of the Terminal to work.
Also, in all functions orders_get(),positions_get(), history_orders_get(), history_deals_get() added possibility of filtering by group - group="EURUSD, "USDGBP", *RU*". The order_check(), order_send() methods will return the initial request for execution in the request field.
Thecopy_buffer() implies getting an array of data for its own calculations. Andcopy_buffer() should work in both directions. What's missing is bidirectional passing of the array.
There are a lot of them on github, there are both b/gbin libs and paid packages...
Do not transfer the model of working with MQL5 to python. They are different and have different purposes.
In 5.0.29 added symbols_total(), symbols_get([group="EURUSD, "USDGBP", *RU*"]), requires the latest beta version of Terminal to work.
Also, in all functions orders_get(), positions_get(), history_orders_get(), history_deals_get() we added an option of filtering by group - group="EURUSD, "USDGBP", *RU*". The order_check(), order_send() methods will return the initial request for execution in the request field.
And the list of _todict() is not yet able to return?
import MetaTrader5 as mt5
# выведем данные о пакете MetaTrader5
print("MetaTrader5 package author: ",mt5.__author__)
print("MetaTrader5 package version: ",mt5.__version__)
# установим подключение к терминалу MetaTrader 5if not mt5.initialize():
print("initialize() failed")
mt5.shutdown()
# подключимся к торговому счету с указанием пароля и сервера
authorized=mt5.login(25115284, password="gqsdfgtdm",server="MetaQuotes-Demo")
if(authorized):
# выведем данные о торговом счете
print(mt5.account_info())
else:
print("failed to connect to trade account 25115284 with password=gqz0lbdm")
account_info_dict=mt5.account_info(). _asdict()for prop in account_info_dict:
print("{}={}".format(prop,account_info_dict[prop]))
mt5.shutdown()
There are plenty of them on github, there are both b/bp libs and paid packages...
Do not transfer the model of working with MQL5 to python. They are different and have different objectives.
What do you mean by that? Copying an array from mql5 to py and back? You should at least carefully read what we're talking about. You don't have to think only for yourself. If you don't need it, others do.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Tried it, it all depends on the hardware it's running on.
One instance eats about 45-50Mb RAM + 2,5-4% CPU. (Yes, % CPU depends on CPU type, in my case Intel Xeon L5640 @ 2.27GHz).
The same, one instance of python.
If python runs with history, + 200-300Mb RAM. CPU is almost not used up.
Well, why, it depends on your ToR or idea.
Understood. Thanks for the information.
Developers, please make API-function copy_buffer(). Get indicator data via analog.
Isn't there an indicator package in Python? Or is it some kind of special indicator. This one seems to work https://github.com/twopirllc/pandas-ta
Isn't there an indicator package in Python? Or is it some kind of special indicator. This one seems to work https://github.com/twopirllc/pandas-ta
copy_buffer() implies getting an array of data for your calculations.
Andcopy_buffer() should work both ways.
What's missing is a bi-directional array transfer.
The symbols_total and symbol_name functions are missing
To get a list of symbols like this:
In 5.0.29 added symbols_total(), symbols_get([group="EURUSD, "USDGBP", *RU*"]), requires the latest beta version of the Terminal to work.
Also, in all functions orders_get(),positions_get(), history_orders_get(), history_deals_get() added possibility of filtering by group - group="EURUSD, "USDGBP", *RU*".
The order_check(), order_send() methods will return the initial request for execution in the request field.
Thecopy_buffer() implies getting an array of data for its own calculations.
Andcopy_buffer() should work in both directions.
What's missing is bidirectional passing of the array.
There are a lot of them on github, there are both b/gbin libs and paid packages...
Do not transfer the model of working with MQL5 to python. They are different and have different purposes.
In 5.0.29 added symbols_total(), symbols_get([group="EURUSD, "USDGBP", *RU*"]), requires the latest beta version of Terminal to work.
Also, in all functions orders_get(), positions_get(), history_orders_get(), history_deals_get() we added an option of filtering by group - group="EURUSD, "USDGBP", *RU*".
The order_check(), order_send() methods will return the initial request for execution in the request field.
And the list of _todict() is not yet able to return?
Can't they return a list of _todict() yet?
Yes, they can, see the example.
Result
They can, see example
Result
Thank you, I have seen this example, it works.
My question is a bit different.
positions_get - it returns to me a list of tradePosition. In principle, it's OK, we can throw it in pandas and work fine.
But it's not limited to pandas and if you want to get something like this:
[{'ticket': 164661016, 'time': 1585075408, 'time_msc': 1585075408163, 'time_update': 1585075408, 'time_update_msc': 1585075408163, 'type': 1, 'magic': 0, 'identifier': 164661016, 'reason': 0, 'volume': 0.01, 'price_open': 120.306, 'sl': 0.0, 'tp': 0.0, 'price_current': 120.328, 'swap': 0.0, 'profit': -0.2, 'symbol': 'EURJPY', 'comment': '', 'external_id': ''}, {'ticket': 164661051, 'time': 1585075426, 'time_msc': 1585075426062, 'time_update': 1585075426, 'time_update_msc': 1585075426062, 'type': 0, 'magic': 0, 'identifier': 164661051, 'reason': 0, 'volume': 0.01, 'price_open': 1.07798, 'sl': 0.0, 'tp': 0.0, 'price_current': 1.07881, 'swap': 0.0, 'profit': 0.83, 'symbol': 'EURUSD', 'comment': '', 'external_id': ''}]we have to convert it somehow, pandas or for ... That's a lot of unnecessary gestures.
_asdict() has become much more convenient, if the developer is not an MQL5 programmer, but, say, a Pythonist ... or a data scientist, list/dict is
list/dict are the main elements of python. Many libs use list/dict to create data transfers.
Tuples are used a lot too, but only if you want to strictly control types of data in it.
and have an error handler for incorrect use or assignment. Somewhere ... :) I could be wrong.
There are plenty of them on github, there are both b/bp libs and paid packages...
Do not transfer the model of working with MQL5 to python. They are different and have different objectives.
What do you mean by that? Copying an array from mql5 to py and back?
You should at least carefully read what we're talking about.
You don't have to think only for yourself. If you don't need it, others do.