• Get access

Requests & Ideas - page 144

Mladen Rakic
162715
Mladen Rakic  

...

dbarkah

I am sure that mrtools, when he sees your post, will post the template he used on that picture. I am saying this because I can only guess his settings for each an every indicator and only he can "reconstruct" the settings he used

dbarkah:
Hi mladen Can you please post a template including all the indicators in the attached picture especially the one that paint bars? This was originally posted by mrtools in post #92 under Dynamic Zone indicators section.
William Snyder
9493
William Snyder  
dbarkah:
Hi mladen Can you please post a template including all the indicators in the attached picture especially the one that paint bars? This was originally posted by mrtools in post #92 under Dynamic Zone indicators section.

Hi Dbarkah,

Was awhile back, so not real sure which version dynamic zone indicator was the chart indicator the others have some minor changes IMO better. The paint bars use Hodrick Prescott Filter, it requires the Hodrick Prescott Filter dll file for it to work, and it recalculates. Hopefully everything you need should be in the rar file if I forgot something please let me know.

ps)for the dynamic zones indicators to work you will need the dynamic zones dll file from the first page, first post of that thread.

Files:
dz_zones.rar 44 kb
dzones.gif 47 kb
Martin
8
Martin  

Help Please - Counted Bars problem in indicator

Hi All,

I am new to the forum and fairly new to MT4 development and am very impressed with what I've seen so far. I hope this is the right place to post this question, and I'd appreciate any help that you are able to give me.

I have developed a few indicators, and I am now struggling with the behaviour of the IndicatorCounted() function in my latest indicator.

My understanding is that the first time the indicator program is launched, IndicatorCounted() is zero, which means I can process every bar in the chart. Subsequent entries into the indicator would have IndicatorCounted() as very small value such as 1 or 2, which shows that only the latest bar (or bars) need to be processed. I have been using this method successfully so far with my indicators. The typical code I am using is as follows.

int i, limit;

int counted_bars=IndicatorCounted();

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

if(limit == 0) return(0);

for(i=0; i<limit; i++)

{ . . . .

However in my latest indictor ROCTrigger Indictor, I have an intermittent problem, where the IndicatorCounted() value is zero again, which implies that I need to process all of the bars again. My indicator creates various objects in the chart, and I am forced to delete them all and recreate them, as the placing of the objects is no longer accurate on the chart after I get IndicatorCounted()has the value zero again.

I feel that Metatrader shouldn’t normally behave this way, and I am at a loss to find what I have done to cause this problem.

Some background details on my indicator are as follows. The ROCTrigger indicator combines ADX details with SmoothedROC indicator (Smoothed Rate Of Change). The structure I am using is that I have a SmoothedROC Indicator which is called from ROCTrigger Indicator using the iCustom function. I also have a standard ADX indicator, which is also called from ROCTrigger Indicator using the iCustom function.

The ROCTrigger Indicator runs in a separate window to the main chart.

I usually run the ROCTrigger indicator on about 20 hourly charts. When the problems start occurring, it is usually at the start of a new hour, and one or more charts start this looping and getting IndicatorCounted() with zero value. This forces the delete all objects and recreate all objects in the ROCTrigger Indicator, and this appears to then occur at every new tick or price change, which arrives for the chart.

I have attached copies of the code. I hope it’s not too misleading with all of the Print statements, but this is the only way I know of trying to debug the logic and learn about what is actually happening.

Thanks in advance for your help

Martin

Files:
yuhu
89
yuhu  

Repost.

Thank you.

yuhu:
Dear Mladen,

Could you please kindly take a look at my request post #1390?

If you could just make an entry indicator based on this rules, it would be awesome:

-price breakout past the X bars high or low

-check volatility by looking Y bars.

an example: price goes from 50-100; range is 50, mean is 75. so volatility is 50/75 = 66.66%

-if volatility is more than Z%, no signal

-if volatility is less than Z%, and price breakout high, long entry signal - draw arrow

-if volatility is less than Z%, and price breakout low, long entry signal - draw arrow

Thank you very much
Mladen Rakic
162715
Mladen Rakic  

A question ...

yuhu

In your description you are using a description of volatility that can be simply achieved by using ATR (average true range). Is that what you had in mind? If it is so, I think that there might be a problem of signals for breakouts that would be delayed (ATR, since it is averaged, will always lag behind a high or low break out and adding the "less than" will delay the break out even more)

Let me know if ATR as the basis is what you had in mind

yuhu:
Repost. Thank you.
kokleongch
51
kokleongch  

Hi Mladen,

I like this indicator that you provided. Could you add adaptive function to this indicator with phase accumulation ?

Thanks

KL

Files:
Mladen Rakic
162715
Mladen Rakic  

Phasa accumulation adaptive bulls and bears ...

Here you go

PS: there are two parts of that indicator - acceleration oscillator (the histogram part) that is by default calculated only one way (sma(5)-sma(34)) and that part is left "un-adaptive". The bulls-bears part is made adaptive using Phase accumulation for cycles length and calculation length. Added muti time frame interpolation possibility in this one too

kokleongch:
Hi Mladen,

I like this indicator that you provided. Could you add adaptive function to this indicator with phase accumulation ?

Thanks

KL
kokleongch
51
kokleongch  

thanks !

mladen:
Here you go
PS: there are two parts of that indicator - acceleration oscillator (the histogram part) that is by default calculated only one way (sma(5)-sma(34)) and that part is left "un-adaptive". The bulls-bears part is made adaptive using Phase accumulation for cycles length and calculation length. Added muti time frame interpolation possibility in this one too
yuhu
89
yuhu  

Hello Mladen

Thank you for your reply.

I checked ATR, and I failed to see how it can be used for my purpose. Perhaps I am not seeing clearly

Please let me try again:

By using the following parameters:

Breakoutbar = 5bars

Volabar = 10bars

Volapercentage = 67%

1. Current bar is closed below lowest of the last 6bars (5+1) or above highest of the last 6bars

2. Calculate volatility by looking 10 bars.

an example: in the past 10bars price goes from 50-100; range is 50, mean is 75. so volatility is 50/75 = 66.66%

3. If Vola % is more than 67%, draw an arrow

Hope this helps.

Thank you very much.

Mladen Rakic
162715
Mladen Rakic  

...

yuhu

Where I see the problem is here :

2. Calculate volatility by looking 10 bars. an example: in the past 10bars price goes from 50-100; range is 50, mean is 75. so volatility is 50/75 = 66.66%
as an example price goes form 1.2700 to 1.2500, range is 0.02 and mean is 1.26. Percentage is roughly 1.5% and it will need a higher time frames for that percentage or a very long lookback period on a lower time frames. On JPY crosses the percentages will be even smaller (due to greater "basic price" percentages can roughly be divided by 10) On a lower time frames, since the changes are much smaller, percentages are going to be very small, which means that that kind of calculation will highly depend on time frame and symbol and we will have no consistent criteria

Those were my thoughts at the first place and so far I did not find a solution for that. Anyway, will make one to work as you described it so it can be tested that way