Tutorial - Create Custom Blocks with "FXDreema Studio"
-
Hello Developers,
This is a simplified tutorial on how to build Custom Blocks using "FX Dreema Studio", which is part of "FX Dreema"
Step 1 - Since The Studio works in a separate link, use your internet browser to navigate to https://fxdreema.com/studio/MQL5 .
Step 2 - Choose the platform you are using, by clicking MQL4 or MQL5
Step 3 - Name and Create your new Block

Step 4 - Create your Block by writing your code on Region A, Put your Global Variables on Region B, Create Input Parameters for the Block on region c, Pre-defined parameters go in region D and Global Functions for all your custom blocks will go on region E.

Once you go through these basics, it is pretty straightforward.
I hope you enjoy this intro tutorial, that will save time on getting your fingers moving. -
@quantengineer Thank you very much for sharing.
-
Nice simple steps thank you!
-
@quantengineer yeah,.. amazing tutorial but your custom functions are 10 mine is 8 for the News Filter, is there something/.? or am wrong?
-
Hi @QuantEngineer , I'm wondering if this tutorial could help me with not having to write my enumerations each time I export a file.
Basically each time I want to export the file, I have to click the .mq5 button (not the .ex5) because of missing enumerations and then open the file in MetaEditor and add in the enumerations manually as per the picture below.

I tried adding a block using the tutorial above and adding it to the OnInit tab but every time I try clicking .ex5, I still get the same error that enumerations are missing.

Any ideas how I might use a custom block to save me the hassle of having to manually add these enumerations each time I export?
-
Yes, I have found the same error with enumerations... I think the text parser that fxdreema uses on custom blocks prior to compiling the code is not compatible with enumerations ... The only way I could get enumerations into FX Dreema without having to copy-paste every time a new compilation was needed, was to place the enumerations into a custom indicator and import the indicator into the fxdreema EA via "My Indicators-> Add Custom Indicator" and use the indicator anywhere in the decision trees... once the indicator is part of the fxdreema project, now you can use any of it's enumerations freely...
-
You're a genius, it works like a charm! Thanks for your help.
For reference if it helps others, I did it like this in the on Init tab, I can now use the .ex5 button:
-
@Breeeeen could you share the indicator? lol
-
hello please i tried downloading an auto trendline bot that i created but it shows me compilation error please how do i resolve the issue
-
I don't understand how you can return a value from within the custom block - back to the calling FXD EA.....So if I define for example 2 input parameters into the Custom Block. I do a calculation for which I would need to write Custom code/function and based on that I want to return two values I can use in my EA ; I can't figure out how to do this. That is the purpose of a block in general, right; do something, compare etc. and then return a value that you can use in your logic.
-
in the function save to a variable, create the variable in your EA project, read and use as normal.
-
So in Visual studio I define a varable A (in the area Global Variables, includes or in the area where my logic is as a local variable ?) and in my EA I also create a variable and the value that is assigned in the logic in studio, in my custom block is the readeable in my EA in variable A ?
-
In the studio I have added to in settings and functions once created this is part of the EA code so you can access in project.
-
This is my code in Settings (Area A):
bool TradeActive,ReturnCheckVar;
ReturnCheckVar=Global_Check_Trade_ActiveLocal(Prefix,TradeActive);
Print(ReturnCheckVar,TradeActive);
~next~
ReturnCheckVar is defined in my EA as a bool variable. In my Experts Tab I see from the Print, True True. However in my EA the check on TRUE for boolean ReturnCheckVar is not true. -
don't duplicate questions: https://fxdreema.com/forum/topic/1893/Library-Studio/28?_=1775737635020