Another question for real programmers.
-
Dear real programmers,
I know there is a way to create a custom code block so that these input parameters:
Can be selectable as constants on fxDreema. I've spent a few hours looking for an old thread by miro a long time ago explaining something like that but to no avail

Could someone please tell me how can I choose them all?
-
@l-andorrà
adding enum block will solve this issueextern ENUM_MA_METHOD ma = MODE_SMA;
extern ENUM_APPLIED_PRICE maP=PRICE_CLOSE; -
@l-andorrà Lets work through this:
Ma method and Applied price seems to be something else than just numbers, like those MA period and MA shift are. From this we can deduce that the constant's datatype needs to be something else than double, because double is the type for simple decimal numbers.
So, where to find the correct datatype?This default ma indicator has its own page in mql4 documentary, lets google it: https://docs.mql4.com/indicators/ima
Here's the datatypes!

Now, what can we use as the constant value? Just click that mql4 article. We can use these values!

Now just create the constants and right-click them into place:

Hope this helps (and hope I didn't make any mistake lol).
You can generalize this method to other indicators, time frames and everything -
Thank you very much abubakr and roar.

I'll try it! -
Just another question. How can I change the MA method from one to another? I can see every MA method has a different value number, from 0 to 3. Can I use them instead of that 'MODE_SMMA' text? Same for all other input parameters.
Additionally, I tried to do that with the BB indicator and I can't find the ENUM type variable for line mode:
https://docs.mql4.com/indicators/ibands
I tried ENUM_MODE, but I got a lot of compiling errors.
Any hint?
-
@l-andorrà
Yes, you can use the numbers as well.
I don't know the proper ENUM type for indicator lines, but you can use simple "int" datatype and integer values:

-
Ok. Thank you once more ;).
-
I retake this old thread because I would appreciate some help to find where in this page
could I find the same for a true/false display menu:https://docs.mql4.com/indicators
It is not related to any particular indicator. I'm looking for a general boolean Constant. I want to see the nice display options as an input parameter.
-
@l-andorrà Just use bool type in the constant
https://docs.mql4.com/basis/types/integer/boolconst


-
Great! Thank you.
