MetaTrader 5 Python User Group - how to use Python in Metatrader - page 84

 
ferox875:

Hello, after reading a few pages from the discussion I couldn't find anything specific on the following question:


- Is there anything currently working as MetaTraderR or MetaTrader5 packages to integrate MT and R?


Yay

Integration of what with what are you interested? MQL4/5 <-> R ; MQL4/5 <-> Python or R<->Python ?

 

I'm getting the data from mt5.symbols_get and everything is correct, except the price. The price at 22.05 was 75800. and it's usually correct, but sometimes it's like this. What is this all about?
How to overcome it?


 

New MetaTrader5-Python-5.0.34 for MetaTrader 5 build 2765 beta is available

pip install --upgrade metatrader5

Added functions market_book_add, market_book_release, market_book_get

import MetaTrader5 as mt5
import time

mt5.initialize()

print(mt5.version())
print(mt5.last_error())

mt5.market_book_add('EURUSD')

for i in range(10):
    time.sleep(5)
    print()
    items = mt5.market_book_get('EURUSD')
    print(items)
    # alternative
    #if items:
    #    for it in items:
    #        print(it._asdict())

mt5.market_book_release('EURUSD')

mt5.shutdown()
 
MetaQuotes :

New MetaTrader5-Python-5.0.34 for MetaTrader 5 build 2765 beta is available

Added functions market_book_add, market_book_release, market_book_get

hi .... thanks for this new feature .... it is very important for traders of Brazilian stock exchange (B3)
I would like to know what these highlighted fields are.

I know it's a transaction type, but I was wondering if there is a translation, for example:

1-purchase.

2-sale.


{ 'type' : 2, 'price': 10.57, 'volume': 47500, 'volume_dbl' : 47500.0}
 
Jonathan Pereira :

hello .... thanks for this new feature .... it is very important for traders of the Brazilian stock exchange (B3)
I would like to know what the highlighted fields are.

I know it's a transaction type, but I was wondering if there is a translation, for example:

1-purchase.

2-sale.


I think I understand ...

Anything with 1 is the top where the sales are.

The volume_dbl field is the same volume but with a floating representation.


Thanks again for adding the new feature.

 
MetaQuotes:

New MetaTrader5-Python-5.0.34 for MetaTrader 5 build 2765 beta is available

Added functions market_book_add, market_book_release, market_book_get

Will you add a description in the Documentation?

 

Cool! connected Pythoon to MT5 and downloaded the first data from the terminal

 
I can't figure out what the problem is. I'm trying to unload ticks to python with copy_ticks_from, it gives empty dataframe. At the same time copy_rates_from on the same date works fine, symbol_info_tick works fine. Tool Si-3.21, Opening Broker.
 
Sivoraksha-ia:
I can't figure out what the problem is. I'm trying to unload ticks to python with copy_ticks_from, but the dataframe is empty. At the same time copy_rates_from on the same date works fine, symbol_info_tick works fine. Tool Si-3.21, Opening Broker.

I don't know about"copy_ticks_from ", but this construction works correctly:

ticks = mt5.copy_ticks_range(symbol, utc_from, utc_to, mt5.COPY_TICKS_ALL)
 
Сергей Таболин:

I don't know about"copy_ticks_from ", but this construction works correctly:

It's strange, but empty table comes too. You don't need to open anything in the terminal itself like in Quicksilver to make the uploads work?