Using exponent "operand"
-
I wanted to use the exponent operation in some of my calculations, but i dont know where i could place it.
Formula blocks and custom MQL code blocks don't recognize the "^" symbol, so...
Do i need to multiply the number as many times by itself ? Thanks -
Interesting question. I would like to know it too. Someone can help?
-
@seb-0 Use pow() or MatPow() function https://docs.mql4.com/math/mathpow
-
@trader-philipps
Thank you !
I'm gonna check this page now if i need an other function.
What does that mean though : "The code entered here will be placed into a generated function, which means that you can't define custom functions in it." ? (description of MQL code block) -
@seb-0 I think fxdrema creates a function per custom mql code. However, I haven't used it to call from a different place and I have no idea how to do so.
Just created a cutom code block like that.

The mql result is like that ..
// Block 32 (PrintHelloWorld)
class Block19: public MDL_CustomCode<bool>
{public: /* Constructor */ Block19() { __block_number = 19; __block_user_number = "32"; _beforeExecuteEnabled = true; } public: /* Callback & Run */ virtual void _callback_(int value) { } virtual void _beforeExecute_() { Print("Hello, World"); }};
-
@trader-philipps
I am reposting.
I saw the base should be "double" ,but how can i do if i want to raise a variable, like : ((highOf10 - lowOf10)/price)pow(1.5) ?
Which is not ok -
((highOf10 - lowOf10)/price)pow(1.5)
in mql4:
MathPow(((highOf10 - lowOf10)/price),1.5)
https://docs.mql4.com/math/mathpow -
@roar
Oh indeed, i struggle reading codes thanks!