Need help optimizing custom indicator

thread: Need help optimizing custom indicator

  1. #1
    Junior Member anpknio.abs's Avatar
    28

    Need help optimizing custom indicator

    Hi, I've some price distribution indior. Its initially named as market profile.mq4. But because the original only draw daily price distribution, I have altered them to draw monthly, weekly and yearly. And additionally 1 modifiion to draw price distribution from day [I] with n as days backward daily [ I n ].

    But my coding skill is bad, and those indior were greatly lagged my pc when its place to draw more than 6 cycles of price distribution. Along with also the dynamics price distribution indior sometimes'jumped' a year back

    I am wondering whether anyone can assist me with fixing / debugging these indiors.
    https://www.cliqforex.com/attachment...8876793291.mq4
    https://www.cliqforex.com/attachment...1354282800.mq4
    https://www.cliqforex.com/attachment...1313572951.mq4
    https://www.cliqforex.com/attachment...1683113884.mq4

  2. #2
    Junior Member anpknio.abs's Avatar
    28
    A few screenshot of its look.




  3. #3
    Hi dito . . What were you specifically looking to repair? ... you need help optimizing to attempt and eliminate a few of the memory usage that is weighing down your CPU?

  4. #4
    Junior Member anpknio.abs's Avatar
    28
    Sorry I forgot to say it. The indior draws all rectangle from the start of the loops over and over again everytime a new high / low published. I can't make it to only draw the last rectangle (or to ignore the current developing price bar).

    And would be fine if all distribution is calculated within an array. Now its calculated by loops lol, I'm such a primitive developer. Benefit would be able to implement many purpose if it had been drawn into a memory range.

  5. #5
    Right got it... ill have a little look through once I get some time shortly.

  6. #6
    Junior Member
    18
    Hi dito
    I discovered you've modified the original Market Profile Indior for the computation of a Mean value instead of the Point of Control (POC) which the original writer had done so. POC is the same as DRT's yellow line (which is the highest line in a Price Distribution. This line differs from a Mean value. Let's say for a certain period of time to get eurusd

    Price Occurrences
    1.5001 30
    1.5000 45
    1.4999 44
    1.4998 32
    1.4997 20


    POC or Yellow line would be 1.5000
    Mean would be (30 45 44 32 20)/5 =34.2 along with the closest price to the mean is 1.4998

    ronaldo

  7. #7
    Junior Member anpknio.abs's Avatar
    28
    Really. I altered that deliberately for another kind of analysis. Since POC is usually visible in a distribution that is balanced, is not hard to point that amount as key S/R. However, what if the current distribution does not make a balanced curve? Thats why I use mean value of distribution hi-low projection to stage which region of the curve has to be filled in order to make distribution curve that is balanced.

    And the mean may be used conjunctively with greater time frame price distribution also. To be able to see which side does the value assembles is heavier relative to time frame that is greater key s/r levels.

  8. #8
    Junior Member Oxrayna's Avatar
    17
    Here is actually the MP Overlay, I believe that is what you are searching for.
    https://www.cliqforex.com/attachment...1146429742.mq4

  •