Need help in new daily indicator

post your indicators here

Moderator: moderators

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

Need help in new daily indicator

Postby metotron » Sat Dec 15, 2007 9:47 am

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 :-(
Help please!
Thanks!

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

gmoney
rank: <50 posts
rank: <50 posts
Posts: 11
Joined: Fri May 26, 2006 12:56 pm
Reputation: 0
Location: Scottsdale, AZ
Gender: Male

Postby gmoney » Sun Dec 16, 2007 2:23 am

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;

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15561
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Sun Dec 16, 2007 4:02 am

Use my TRO_24HOURS indicator.

You want to know the range for each hour right?
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!

Please do NOT PM me with trading or coding questions, post them in a thread.

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

Postby metotron » Sun Dec 16, 2007 10:13 am

"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
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender: None specified

Postby metotron » Sun Dec 16, 2007 10:30 am

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

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15561
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Sun Dec 16, 2007 4:25 pm

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.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

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

Postby metotron » Mon Dec 17, 2007 5:17 pm

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
rank: <50 posts
Posts: 12
Joined: Thu Aug 09, 2007 5:54 pm
Reputation: 0
Gender: None specified

Postby metotron » Mon Dec 17, 2007 6:10 pm

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
pic.jpg (123.12 KiB) Viewed 5241 times

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15561
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Tue Dec 18, 2007 12:04 am

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.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

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

Postby metotron » Tue Dec 18, 2007 5:59 pm

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
pic.jpg (141.16 KiB) Viewed 5203 times

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “Tradestation indicators”