Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of this bridge #11

Open
williamwongys opened this issue Dec 6, 2016 · 0 comments
Open

Usage of this bridge #11

williamwongys opened this issue Dec 6, 2016 · 0 comments

Comments

@williamwongys
Copy link

williamwongys commented Dec 6, 2016

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);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant