OpenTrading / OTMql4Py

Open Trading Metatrader 4 Python Integration
GNU Lesser General Public License v3.0
104 stars 49 forks source link

OTLibPy24.mq4: TerminalPath() returns wrong directory (Win7/MT4 1198) #4

Closed oafx closed 8 years ago

oafx commented 8 years ago

Hi there,

installing MT4 (newer versions?) into the default directory creates the terminal data folder (MQL4, logs, etc.) inside the users AppData folder. While TerminalPath() returns the directory of your MetaTrader 4 installation, what you actually need to make OTMql4Py work is the data folder path. Therefore i'd suggest to exchange TerminalPath() with TerminalInfoString(TERMINAL_DATA_PATH) to get the expected path.

cheers

OpenTrading commented 8 years ago

I'm tied up for the next couple of weeks, and then can spend some time on this.

Is there only one change to make? If not, the best thing to do is download a fresh copy from this project and put it in one directory, and if you have a Unixish diff program, run a diff -c -C 5 -r of the two directories (clean of binaries), and attach the diff file to a message here.

Thabks for helping...

OpenTrading commented 8 years ago

We see the problem now, and will incorporate your suggested fix.

We appreciate your help as we are currently working on an installer for the code, and it will be a problem for all of the OpenTrading projects. We've started updating the documentation to make sure that people install into the right directory.

OpenTrading commented 8 years ago

We've got the new Mt4 directory structure in the binary installer for OTMQl4Lib https://github.com/OpenTrading/OTMql4Lib/releases/tag/1.1.0.0

We'll fix OTMQl4Py next and do an installer for it too.

OpenTrading commented 8 years ago

I think this is solved now.