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!
Need help in new daily indicator
Moderator: moderators
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
"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
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
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.
Thank you for your support.
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- 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.
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.
Please do NOT PM me with trading or coding questions, post them in a thread.
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- 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.
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.
Please do NOT PM me with trading or coding questions, post them in a thread.
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 5203 times
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.