Simple market buy/sell on MQL5 code
-
Hi,
I would like to do a simple market buy/sell on a "custom MQL code" (MQL5) node but I can't figure how.
I've tried to put some code I've found but it gives error. Like: trade.Buy(0.01,NULL);
Can anybody tell me how to do it?
-
@nilsen maybe that's an outdated function, I can't find it in documentation..
https://www.mql5.com/en/docs/standardlibrary/tradeclasses/ctrade/ctradebuy
-
@roar Thanks for the response but those functions give me compilation errors:
"
Compilation errors
'Buy' - undeclared identifier
',' - unexpected token
'0.1' - some operator expected
')' - unexpected token" -
@nilsen ah, I noticed it too. I don't really know about this then, I'm starting to fear its not possible in "Custom MQL code".
Making your own blocks in fxdreema studio would allow to use mql in "global scope", whatever that means. But I can't really help you further..
https://fxdreema.com/studio/