fxDreema

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

    Problem with find the mean ATR SD

    Questions & Answers
    2
    3
    336
    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.
    • P
      purecnx last edited by purecnx

      double atrMean = CalculateATRMean(ATR_Period);

      double CalculateATRMean(int period) {
      double sum = 0;
      for (int i = 1; i <= period; i++) {
      sum += iATR(Symbol(), 0, period, i);
      }
      return sum / period;
      }

      double CalculateSD(double &values[], int size, double mean) {
      double variance = 0.0;
      for (int i = 0; i < size; i++) {
      variance += MathPow(values[i] - mean, 2);
      }
      return MathSqrt(variance / size);
      }

      USE THIS CODE IN MQLmessageImage_1738134123513.jpg

      [link text](link url)https://fxdreema.com/shared/M40hxlHTb

      How can i declareation Function in Global?

      Compilation errors
      'CalculateATRMean' - function not defined
      'CalculateATRMean' - function declarations are allowed on global, namespace or class scope only
      'CalculateSD' - function declarations are allowed on global, namespace or class scope only

      1 Reply Last reply Reply Quote 0
      • P
        purecnx last edited by purecnx

        @fxDreema @l-andorrà

        1 Reply Last reply Reply Quote 0
        • S
          sktsec last edited by

          In the source code, there is a dedicated session for custom function.

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

          Online Users

          S
          E
          O
          H
          Q
          O
          O
          L

          19
          Online

          146.9k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors