fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    ENUM in constant declaration ** Solved **

    Questions & Answers
    2
    4
    2415
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      trader.philipps last edited by trader.philipps

      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
      0_1567872517454_4c7a8606-9672-4ea9-9f68-afafa96f9afd-grafik.png

      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
      };
      //

      I like to share my knowledge, but expect the others to contribute as well.

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @trader.philipps last edited by

        Try and error. I took a look how the indicator is embedded in fxdreema. Here is an example.

        0_1567876273288_Auswahl_522.png

        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.

        0_1567876389212_Auswahl_523.png

        That's it!

        I like to share my knowledge, but expect the others to contribute as well.

        A 1 Reply Last reply Reply Quote 2
        • A
          ambrogio @trader.philipps last edited by

          @trader-philipps very smart 😉

          T 1 Reply Last reply Reply Quote 0
          • T
            trader.philipps @ambrogio last edited by

            @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.

            I like to share my knowledge, but expect the others to contribute as well.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post

            Online Users

            9
            S
            E
            E

            11
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors