How to do include in "Custom MQL code" ?
-
Hi,
I was trying to use #include in a block of mine before realising that this is not supported - find below excerpts after clicking on the question mark beside the "Customer MQL code" itself.
<snip>
You also can't define global variables or use #define, #import or #include.
</snip>Is there any workaround for that ? Thanks in advance for your help.
-
@mndiarra Not sure if someone created any totorial for that. I'm not a programmer, though. I guess you will need a real one for this.
-
@l-andorrà No worries, thanks I will try or unless somebody has done this before that would be appreciated. As said, everything is feasible, but the problem is time.
-
@mndiarra Please share any solution you find, if you don't mind.
-
@mndiarra said in How to do include in "Custom MQL code" ?:
Is there any workaround for that ? Thanks in advance for your help.
You can try to make a custom block here https://fxdreema.com/studio/MQL4
Here is some example of the things you can add in the code of the block to make it functional:

Think of the ~Indicator~ thing as the value from the parameter Indicator (look at the right where the parameters are).
~datatype:Indicator~ is obviously there to deal with the different data types, but this is only needed in very few blocks like this one, you probably don't need this.Think of ~next~ as the orange output. ~inext~ is for the yellow output (the "i" probably means inverted). To have a gray output, which is normally to indicate that there is an error, try ~error~.
Imports and such stuff is to be put below on the other code field at the bottom. But better don't put very fancy code.
-
@fxdreema Thx for getting back to me on this. Actually what I did is, I created "Custom MQL code" blocks with what I needed. Then I generated the code as .mq4 (.not ex4 because at this stage the .mqh file is not included therefore it won't compile). Afterwards, I went to mql4 editor, added "#include <xxxxx.mqh>" and then compiled everything together. The process is a little bit longer but it works. Thanks a million for your help.
-
@fxdreema This message is very clarifying to help build with the FX Dreema Studio.
I am working on building some tutorials for the studio and would like to know if there is somewhere, a list of all the things that we can use with this ~~ notation, like:{~next~} is used to move from the current block to the next block
{~inext~} is used to move to the other block, the orange dot output
etc... etc...Specifically, I am currently looking for ways to assign values in FX Dreema Studio, to variables created on the FX Dreema Builder....
On this Screenshot, I want the custom FX Dreema Block "testBlock" to replace the initial value "initial value", but what is in the custom code, "Hello World".

And here is a screenshot of the custom code that I am working on to figure out how to make happen.
