Written Conditions
-
Hello,
I was just curious where I can learn about the written code blocks such as this example I took from another thread. I am not sure where to read about the FxDreema format to find what I am trying to do

I would like to take a result from a moving average and double the result. I assume to do this I input the result as a variable and use the "adjust the result (optional)" block to x2 the output
-
This block is for programmers only. You need to learn MQL4 code to use it. Trust me, if you learn to code you will not need fxDreema anymore.

-
@Zereleth To some degree I can code although primarily in Kotlin not MQ, I am just wondering how I would implement things such as rounding and finding the square route of variables within FxDreema if I don't utilise these functions.
For example what would be sqn=round(sqrt(14)) in Pine
@roar You seem quite experienced with this do you have any advice?
-
You can do it in a more simple way with the block Modify Variables.
In the block, enter the input box : MathSqrt(your_variable)
Yes. Your can input a function in the box!
-
-
@Zereleth
YES -
@sktsec Let me know if I am being annoying, just trying to comprehend how the modify variable works
In MT4 I would write it out like this
double sqn1 = MathRound(MathSqrt(keh));
When using the modify variable option I can use your suggestion to square it, although im not sure how to round it.
Also how does it modify the variable? Is it each time the script runs eg; if the modify is variable*2 does it make the variable 2 on first run then 4, 8, 16, 32, etc or do all variables reset after each script run.
In this case would it function to write MathSqrt(variable) then later write MathRound(variable) in a connected block would it both square root and round the outcome?
Thank you for the help
-
@Zereleth I believe the practical answer for my question is MathRound(MathSqrt(variable1)) if anyone reads this thread in future and wants a summary. I am just trying to understand how the FxDreema platform functions.
-
-
Try to use the block Comment(ugly) to see the output value of any variable. You will get all your answers.
-
NormalizeDouble() is another function that could help you get round values
-
MathSqrt() is a square root function rather than a square function
-
The variable you defined is in global scope. Therefore, you can use the current output at the next block.
-
As you are a programmer, you may wonder how the MT4 program flows. It a real time computation problem. That means a new calculation may start before you has finished the last once. That's why slow PC and a complex EA is problematic
-