MetaTrader 5 Python User Group - как использовать Python в Метатрейдере - страница 66
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
А какие были текущие цены (Bid и Ask)? Какой был уровень заморозки (SYMBOL_TRADE_FREEZE_LEVEL)?
Not sure about the FREEZE levels?
Ask price is being used for my buy and bid price for my shorts.
I have tried hardcoding my sl and tp now.
Just strange that it will Buy and Sell perfect for hours and then stop.
Всё равно пишет:
if r.retcode != TRADE_RETCODE_REQUOTE and r.retcode != TRADE_RETCODE_PRICE_OFF:
AttributeError: 'NoneType' object has no attribute 'retcode'
Запустите пример из справки для https://www.mql5.com/ru/docs/integration/python_metatrader5/mt5ordersend_py
Пример из справки работает.
Применяю пример у себя в функции, пишет:
if result_buy.retcode != mt5.TRADE_RETCODE_DONE:
AttributeError: 'NoneType' object has no attribute 'retcode'
Всё равно пишет:
Пример из справки работает.Применяю пример у себя в функции, пишет:
if result_buy.retcode != mt5.TRADE_RETCODE_DONE:
AttributeError: 'NoneType' object has no attribute 'retcode'
То есть вы получили result_buy==None, не проверили значение и попытались получить retcode от None?
The new MT5-terminal beta along with the MetaTrader5 5.0.31 can only sustain about ~7700 calls to copy_rates_from_pos() before it completely locks up the thread. In order to demonstrate this bug I have implemented a timeout using asyncio. The timeout works on the control, however, it does not work for copy_rates_from_pos because the thread completely freezes due to the bug.
Even shutting down and re-initializing the connection doesn't help.
There is a bug in copy rates. I posted this several times but nobody has acknowledged it.
Вопрос: Этот цикл зачем?
Question: Why this cycle?
I was getting failures requesting maxbars as the "count" parameter so I wrote a simple routine that grows the number of bars requested on each iteration as a unit-test to test the function. This should complete without issues, but given that you can only call it a finite number of times makes it unreliable.
I was getting failures requesting maxbars as the "count" parameter so I wrote a simple routine that grows the number of bars requested on each iteration as a unit-test to test the function. This should complete without issues, but given that you can only call it a finite number of times makes it unreliable.
Всё равно пишет:
if r.retcode != TRADE_RETCODE_REQUOTE and r.retcode != TRADE_RETCODE_PRICE_OFF:
AttributeError: 'NoneType' object has no attribute 'retcode'
Пример из справки работает.
Применяю пример у себя в функции, пишет:
if result_buy.retcode != mt5.TRADE_RETCODE_DONE:
AttributeError: 'NoneType' object has no attribute 'retcode'
ckeiderling:
...
I get the same problem using mt5.copy_ticks_range () and mt5.copy_rates_range (). I have to reset the kernel in order to clear out the memory.
...