PDA

View Full Version : Need help optimizing custom indicator



anpknio.abs
04-12-2008, 03:45 PM
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/attachments/1519366598876793291.mq4
https://www.cliqforex.com/attachments/15193666001354282800.mq4
https://www.cliqforex.com/attachments/15193666011313572951.mq4
https://www.cliqforex.com/attachments/15193666031683113884.mq4

anpknio.abs
11-07-2022, 01:12 AM
A few screenshot of its look.
https://www.cliqforex.com/attachments/15193666051013943998.png
https://www.cliqforex.com/attachments/1519366606391418849.png
https://www.cliqforex.com/attachments/1519366608535805446.png
https://www.cliqforex.com/attachments/15193666091780828874.png

Zikauskas
11-07-2022, 02:34 AM
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?

anpknio.abs
11-07-2022, 03:57 AM
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.

Zikauskas
11-07-2022, 05:19 AM
Right got it... ill have a little look through once I get some time shortly.

bb
11-07-2022, 06:41 AM
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

anpknio.abs
11-07-2022, 08:03 AM
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.

Oxrayna
11-07-2022, 09:26 AM
Here is actually the MP Overlay, I believe that is what you are searching for.
https://www.cliqforex.com/attachments/15193666111146429742.mq4