OTMql4Py
OTMql4Py copied to clipboard
Usage of this bridge
Essential information for reporting Issues:
- What version of Windows, and 32/64 bit:32
- What Build number of Metatrader:4.0 Build 1010 (18 Aug 2016)
- Where was the Metatrader installed from:
- What version of Python: 2.7
- Where was the Python installed from:
- OTMql4Py from git, or what version of the OTMql4Py installer:current
I was looking to call Python from MT4, MT4 will pass a few arrays of doubles to Python which will use the arrays to calculate and return a double back to MT4. MT4 will then draw an indicator using the return value. Can this be done? Is there an example to start with? I installed and tried with a simple script in MT4, it hanged MT4 with access violation:
#include <OTMql4/OTPy27.mqh>
int OnStart(){ uchar expr[]; StringToCharArray("a=""a string""",expr); PyInitialize(); int s=PyEvaluate(expr); StringToCharArray("a",expr); s=PyEvaluate(expr); s=PyGetString(s); printf("%s",s);
return(0);
}