samuraitaiga / py-metatrader

metatrader library for metatrader
Apache License 2.0
90 stars 48 forks source link

ModuleNotFoundError #9

Open ValeriChakarov opened 6 years ago

ValeriChakarov commented 6 years ago

Hi, I am using py-metatrader on Windows 10 and I am also using Pycharm. I installed py-metatrader from the anaconda3 terminal as I have done many times before.

Today, I got the following error when I ran the sample example on the page below: https://pypi.python.org/pypi/metatrader/0.0.1 :

The error log is below

Traceback (most recent call last): File "..../translator.py", line 2, in from metatrader.backtest import BackTest File "C:\anaconda3\lib\site-packages\metatrader\backtest.py", line 9, in from mt4 import get_mt4 ModuleNotFoundError: No module named 'mt4'

Can anyone help me fix this?

PaulDoree commented 6 years ago

Hi Valeri

You need to import metatrader as a package in Pycharm. You can do this by, under the File menu selecting Settings->project: py-metatrader->Project Interpreter and then adding metatrader as a package. The top three lines of my backtest.py file are:

from metatrader.mt4 import initizalize from metatrader.backtest import BackTest import datetime

Regards

michaelabera commented 2 years ago

I starting my first project on Github with a metatrader EA to customize for a trading. Don't have a clue where to begin. Metatrader language is in C.

Any tips or links would be greatly appreciated.

Thanks in advance.