Need help in new daily indicator

Moderator: moderators

metotron
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender:

Need help in new daily indicator

Hi all!!!
I need smal help. I want to make indicator that will calculate Average Daily Range on 15min or 1h time frames.
For that i need High and low from previously days.
Example: if i want to make Average D. Range from 20 days i must take high and low from each of this days. Its easy if i use Daily chart. But i want to use 15 min or 1h.
Ferst way is taken DATA2 But it's not very comfortable.
Next way....i don't know
Thanks!

gmoney
rank: <50 posts
Posts: 11
Joined: Fri May 26, 2006 12:56 pm
Reputation: 0
Location: Scottsdale, AZ
Gender:
Do a search for this in the TradeStation forums and I'm sure you will find a solution.

The first thing that came to mind is something like this (don't know if correct, just first thought):

var: n(0), avgdailyrange(0);

for n = 1 to 20
begin
avgdailyrange = average(highd(n) - lowd(n),20);
end;

TheRumpledOne
rank: 10000+ posts
Posts: 12776
Joined: Sun May 14, 2006 9:31 pm
Reputation: 1264
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender:
Contact:
Use my TRO_24HOURS indicator.

You want to know the range for each hour right?

metotron
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender:
"You want to know the range for each hour right?"

i think not...
I want to get Average Daily Range (for 20 days) on 15 or 1h harts.
Example:
R1-yesterday range was 120pips
R2 - 2days ago - 100 pips
R3 - 3days ago - 97
-----------
R20 - 20days ago -180 pips
Average Daily Range = (R1+R2+R3+..+R20)/20
I can do it very easy for daily charts But i need it for calculating on 15 min charts.
Example: i Make enter long if 5SMA crosses 12SMA and (Today High- Today Low) < Average Daily Range

metotron
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender:
gmoney wrote:Do a search for this in the TradeStation forums and I'm sure you will find a solution.

The first thing that came to mind is something like this (don't know if correct, just first thought):

var: n(0), avgdailyrange(0);

for n = 1 to 20
begin
avgdailyrange = average(highd(n) - lowd(n),20);
end;

It does't work - it recalculate Range on each 1h bar. But it's wrong. Each day has only 1 Range - for all day. This Range changed only on 00:00

TheRumpledOne
rank: 10000+ posts
Posts: 12776
Joined: Sun May 14, 2006 9:31 pm
Reputation: 1264
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender:
Contact:
Ok, now I understand what you want.

Use TRO PLOT.

Set the input to averagefc( (HighD(0) - LowD(0) ) , 20 )

You'll also need to format the indicator scaling.. set it to subplot 2 or higher.

You may want it to display as a histogram, so format the style.

metotron
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender:
Oh!!! Great Thanks!
I works!!!
But it's not my final question! Next will be after 2 days. I will try to build Cluster Indicators for FOREX

metotron
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender:
Hm...TRO PLOT works good. But... its calculate its value on each bars inside day. Avery day has only one Daily Range.
Look at pic - i try to show what i need
Attachments
pic.jpg (123.12 KiB) Viewed 1026 times

TheRumpledOne
rank: 10000+ posts
Posts: 12776
Joined: Sun May 14, 2006 9:31 pm
Reputation: 1264
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender:
Contact:
Well that depends...... for today, the range changes everytime there is a new daily high or daily low.

If you count today, then the value is going to change.

averagefc( (HighD(1) - LowD(1) ) , 20 )

Using yesterday's data should take care of it.

metotron
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender:
TheRumpledOne wrote:Well that depends...... for today, the range changes everytime there is a new daily high or daily low.

If you count today, then the value is going to change.

averagefc( (HighD(1) - LowD(1) ) , 20 )

Using yesterday's data should take care of it.

no...it doesn't work....look at the pic. it changes its value every bar inside day
Attachments
pic.jpg (141.16 KiB) Viewed 988 times