Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2006, 07:40 PM
ycomp's Avatar
Member
 
Join Date: Jan 2006
Posts: 93
ycomp is on a distinguished road
Script to calculate Average Daily Range?

Hi,

anyone have a script that will calculate the average daily range of a currency going back "n" days?

e.g. for 50 days

Last edited by ycomp; 02-27-2006 at 08:31 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2006, 08:28 PM
Senior Member
 
Join Date: Jan 2006
Posts: 146
faifarni is on a distinguished road
I'd like to see this also....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2006, 09:45 PM
Beluck's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 207
Beluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud ofBeluck has much to be proud of
isn't it ATR indicator?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2006, 09:50 PM
ycomp's Avatar
Member
 
Join Date: Jan 2006
Posts: 93
ycomp is on a distinguished road
so if I wanted to see it for the last 50 days I would just look at the last bar's value for the ATR(50)?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2006, 10:04 PM
cucurucu's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 314
cucurucu is on a distinguished road
Question Ycomp, what do you mean by daily range?

What do you mean by daily range? (High-Low)?
ATR is the average true range for the last n periods. The true range however, is not the High-Low for every day. True range is the maximum value of the following 3:

1.CurrentHigh-CurrentLow
2.Abs(PreviousClose-CurrentHigh)
3.Abs(PreviousClose-CurrentLow)

I hope you understand. Now, please tell me what exactly do you mean by the average daily range.

Bye.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2006, 10:55 PM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 130
keris2112 is on a distinguished road
#MTF_Average Range

I've attached #MTF_Average Range.mq4

It will give you the average range (high-low) for whatever period it is attached to. If you want the see the average range of a different timeframe, change the TimeFrame input to whatever timeframe you want. (1,5,15,30,60,240,1440,10080,43200)

The TimeFrame value must be greater than the current timeframe.

keris

BTW, unlike other MTF versions of custom indicators I've done, all the code is incorporated in this one file.
Attached Files
File Type: mq4 #MTF_Average Range.mq4 (3.4 KB, 443 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 02-27-2006, 11:22 PM
ycomp's Avatar
Member
 
Join Date: Jan 2006
Posts: 93
ycomp is on a distinguished road
thanks keris I think this is what I was looking for... plus a bit more!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 02-27-2006, 11:24 PM
ycomp's Avatar
Member
 
Join Date: Jan 2006
Posts: 93
ycomp is on a distinguished road
thanks for the explanation cucurucu.. now I understand better. I was just looking for High-Low.

Quote:
Originally Posted by cucurucu
What do you mean by daily range? (High-Low)?
ATR is the average true range for the last n periods. The true range however, is not the High-Low for every day. True range is the maximum value of the following 3:

1.CurrentHigh-CurrentLow
2.Abs(PreviousClose-CurrentHigh)
3.Abs(PreviousClose-CurrentLow)

I hope you understand. Now, please tell me what exactly do you mean by the average daily range.

Bye.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 02-28-2006, 01:17 AM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Here is a simple script to do what you are wanting.
Attached Files
File Type: mq4 Average Range.mq4 (960 Bytes, 291 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 02-28-2006, 12:22 PM
Member
 
Join Date: Nov 2005
Posts: 84
nohills is on a distinguished road
script

Hi Nic,

Appreciate your work.

Quote:
Originally Posted by Nicholishen
Here is a simple script to do what you are wanting.
I think there is 1 error in this script:

for (int i=0;i<=PeriodsBack;i++)

must be:

for (int i=0;i<PeriodsBack;i++)

In your example it will go 11 times through the for loop
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
daily range, AVERAGE DAILY RANGE, calculate true range, calculate average range, calculate average daily range, average true range, how to calculate Average daily range


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FXiGoR DYNAMIC Breakout system on Daily Average Range iGoR Suggestions for Trading Systems 276 11-14-2009 06:31 AM
Average Daily Range KJB General Discussion 12 07-03-2009 10:30 PM
Average Daily Range fxid10t Indicators - Metatrader 4 4 07-28-2008 08:51 PM
Average daily range indicator, help !! Pepinillo Metatrader 4 3 03-04-2007 07:53 PM


All times are GMT. The time now is 09:55 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.