- initialize
- login
- shutdown
- version
- last_error
- account_info
- terminal_info
- symbols_total
- symbols_get
- symbol_info
- symbol_info_tick
- symbol_select
- market_book_add
- market_book_get
- market_book_release
- copy_rates_from
- copy_rates_from_pos
- copy_rates_range
- copy_ticks_from
- copy_ticks_range
- orders_total
- orders_get
- order_calc_margin
- order_calc_profit
- order_check
- order_send
- positions_total
- positions_get
- history_orders_total
- history_orders_get
- history_deals_total
- history_deals_get
copy_rates_from_pos
Get bars from the MetaTrader 5 terminal starting from the specified index.
copy_rates_from_pos(
|
Parameters
symbol
[in] Financial instrument name, for example, "EURUSD". Required unnamed parameter.
timeframe
[in] Timeframe the bars are requested for. Set by a value from the TIMEFRAME enumeration. Required unnamed parameter.
start_pos
[in] Initial index of the bar the data are requested from. The numbering of bars goes from present to past. Thus, the zero bar means the current one. Required unnamed parameter.
count
[in] Number of bars to receive. Required unnamed parameter.
Return Value
Returns bars as the numpy array with the named time, open, high, low, close, tick_volume, spread and real_volume columns. Returns None in case of an error. The info on the error can be obtained using last_error().
Note
See the CopyRates() function for more information.
MetaTrader 5 terminal provides bars only within a history available to a user on charts. The number of bars available to users is set in the "Max. bars in chart" parameter.
Example:
from datetime import datetime
|
See also
CopyRates, copy_rates_from, copy_rates_range, copy_ticks_from, copy_ticks_range