Requests & Ideas - page 2

 

...

Walander,

Just checking if I understand correctly :

It should show a range that was:

from 08:00 to 17:00 of periods1 length

from 17:00 to xx:xx of periods2 length

from xx:xx to yy:yy of periods3 length and so on

Am I correct?

mladen

Walander:
Hey,

I was wondering if I could request a average range indicator that can be based on any custom range based on time.

Hence you can find any daily range for any timezone. Or any range of time size back a custom amount of periods.

So an example of the indicators goal would be able to calculate the range range of say, "8:00" to "17:00" for x periods back.Or the average range of the US EST close day for x periods.

Cheers,
 

That could be a variation assuming other people who probably want variable time sizes on a continuous range basis.

My goal is.

8:00 to 13:00 = Range 1

Next Day

8:00 to 13:00 = Range 2

Next Day

8:00 to 13:00 = Range 3

Avg Range = Range 1 + Range 2 + Range 3 / Range

Customizable Start and End times or continuous time frame ranges

Thanks mladen.

 

...

Walander

I am working on it

This is just a "scratch" version : it is bloody slow (too many loops within loops - have to rewrite it in order to make it a normal indicator), so as soon as i make one that runs as it should will post it here

regards

mladen

Walander:
That could be a variation assuming other people who probably want variable time sizes on a continuous range basis.

My goal is.

8:00 to 13:00 = Range 1

Next Day

8:00 to 13:00 = Range 2

Next Day

8:00 to 13:00 = Range 3

Avg Range = Range 1 + Range 2 + Range 3 / Range

Customizable Start and End times or continuous time frame ranges

Thanks mladen.
 

Mladen,

I am amazed at your program design skills. I tried doing this, and I think I had about 100+ more lines of code, let alone calculating it properly. I will try it out! Thanks!

 

...

Try this one if it is what you had in mind (no problem with the speed any more )

Parameters :
AtrDays-> number of days you want the range calculated for

AtrFrom-> starting time for high/lows determining

AtrTo-> ending time for highs/lows determining

______________________________ The way it works :
It finds highest high an lowest low for the period specified by AtrFrom and AtrTo (AtrTo time is left out of the calculation - meaning if AtrTo is, for example 13:00, than a bar at 12:59 is taken into calculation, but the one from 13:00 is not) and then calculates average range for AtrDays ranges obtained that way

Since it is limited to calculating daily ranges, it will not work for time frames > 4 hour

If you place it to 1 minute time frame, you might get something that look like an empty indicator. It happens because all the values for the specified window are the same and than metatrader shows it that way. Zoom out and you will get the "step like" look

______________________________

PS: do not use this indicator but use the one from post #17. This one has a bug when working on certain brokers which bug is corrected in the later one. Kept it here as a reminder to myself not to rush without thorough testing

regards

mladen

Files:
atr.gif  12 kb
 

You're right.

I did have a heart attack doing this, because of the syntax that metatrader has.

It makes it nearly impossible to do this effeciently, which is very annoying.

Also, one more error. Say if im trying to have London Close Day Average Range on +1 Broker. The hours are from Start 01:00 end 01:00

This is where I truly got a heart attack, I don't know anyway around this.

 

...

Will cook some solution for that too

Walander:
You're right.

I did have a heart attack doing this, because of the syntax that metatrader has.

It makes it nearly impossible to do this effeciently, which is very annoying.

Also, one more error. Say if im trying to have London Close Day Average Range on +1 Broker. The hours are from Start 01:00 end 01:00

This is where I truly got a heart attack, I don't know anyway around this.
 

...

I must admit that this indicator caused me a serious hart attack :)

_______________________________

The reason is simple : I was testing the indicator on one broker, and everything went smooth. And then I jumped to another broker, and what did I get : rubbish, an absolute rubbish. As a proof a picture of it (upper is how it should look like and a lower is the one that caused me a hart attack) Took me some time to understand what happened : Sunday data. But it could be any day which does not have data that satisfies the time filter.

To cut the story short, here is the corrected one. What it does is that when there is no data for some days (like those Sundays when it effectively could not find any data that satisfied the time filter) it skips it and goes to previous day (and so on, and so on...)

_______________________________

Hope you did not get the similar hart attack as I did :)

regards

mladen

Walander:
Mladen, I am amazed at your program design skills. I tried doing this, and I think I had about 100+ more lines of code, let alone calculating it properly. I will try it out! Thanks!
Files:
 

Yours I'm sure will be elegant, mine will be filled over 100 conditional statements

 

...

Walander,

I think this is the one

_________________________

Added timeShiftparameter
Time shift would be, in the example you posted, 1 and AtrFrom 00:00 (or simply 0 - changed that too, no need to enter it in strict 00:00 fromat) with AtrTo24:00. So more or less it is the n part in GMT+(n). Time filter does not have to be altered at all. It stays as it was till now. You are choosing the same as until now the time of the day you want the indicator to find ranges for, only with timeShiftyou are choosing the time zone related to GMT too.

As a consequence, range is, in cases when timeShift is != 0, not drawn from 00:00 broker time but is shifted to the chosen time zone beginning (posted a picture too that where the lower is shifted by 5 hours, I think it explains better than my words )

So far I did not find errors, but, if you do, please yell
regards

mladen

Files:
Reason: