ENUM in constant declaration ** Solved **
-
Hi folks,
I use an indicator that uses enum as a data type for it's parameters-. As I have mql4 code, I can drag use the indicator in a block (custom indicators) and there I can select that the input is available for optimization. This causes in EA parameter list this output

As I am using constants for the parameters as I want to specifiy the logical order by myself as well as giving it a human friendly label.
I'm asking myself how I can specify a constant that does the same thing. I read a lot here in the forum, but the solutions seem to be quiet old. As an example modification of fxdreema's generated EA source code is not an option.If enum as constant is possible, please give me an example (eg. screenshot) how to enter it?
The generated enum looks like that:
//
enum enTimeFrames
{
tf_cu = 0, // Current time frame
tf_m1 = PERIOD_M1, // 1 minute
tf_m5 = PERIOD_M5, // 5 minutes
tf_m15 = PERIOD_M15, // 15 minutes
tf_m30 = PERIOD_M30, // 30 minutes
tf_h1 = PERIOD_H1, // 1 hour
tf_h4 = PERIOD_H4, // 4 hours
tf_d1 = PERIOD_D1, // Daily
tf_w1 = PERIOD_W1, // Weekly
tf_mb1 = PERIOD_MN1 // Monthly
};
//Or that
//enum enMaTypes
{
ma_sma, // Simple moving average - SMA
ma_ema, // Exponential moving average - EMA
ma_mcg, // McGinley Dynamic
ma_dsema, // double smoothed exponential moving average - DSEMA
ma_dema, // Double exponential moving average - DEMA
ma_tema, // Tripple exponential moving average - TEMA
ma_smma, // Smoothed moving average - SMMA
ma_lwma, // Linear weighted moving average - LWMA
ma_pwma, // Parabolic weighted moving average - PWMA
ma_alxma, // Alexander moving average - ALXMA
ma_vwma, // Volume weighted moving average - VWMA
ma_hull, // Hull moving average
ma_tma, // Triangular moving average (TMA)
ma_b2p, // Two pole Ehlers Butterworth
ma_b3p, // Three pole Ehlers Butterworth
ma_s2p, // Two pole Ehlers smoother
ma_s3p, // Three pole Ehlers smoother
ma_sine, // Sine weighted moving average
ma_linr, // Linear regression value
ma_ilinr, // Integral of linear regression slope
ma_ie2, // IE/2
ma_nlma, // Non lag moving average
ma_zlma, // Zero lag moving average
ma_lead, // Leader exponential moving average
ma_ssm, // Super smoother
ma_smoo // Smoother
};
// -
Try and error. I took a look how the indicator is embedded in fxdreema. Here is an example.

It seems like all you need to do is to use the indicator somewhere and than in the constants declaration you use the same syntax.

That's it!
-
@trader-philipps very smart

-
@ambrogio Yeah, it's a pity that such a great software as fxdreema is laging a good documentation. Or at least I'm not aware where to find it.