Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Indicators - Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-15-2008, 05:39 PM
maxvre's Avatar
Junior Member
 
Join Date: Jul 2007
Posts: 8
maxvre is on a distinguished road
Post Simple ADTR indicator

Hi all,
Thought I would make a simple contribution here for newbies.

This is a simple average daily trading range pip indicator (mq4 attached) that displays todays pips so far and the last X days average total of pips moved. X being definable by the user.

It's nothing spectacular but I thought new people trying to learn to code would find it maybe of use to mess around with.

BTW my ADTR goes from highest to lowest and not just the candle body. I use the wicks too.

Maxvre

---------------------------------------------------------------------

#property indicator_chart_window

extern int X.Offset=0;
extern int Y.Offset=0;
extern int DAYS = 20;
extern int Font_Size = 10;
extern color TODAY_Title_Color = DeepSkyBlue;
extern color ADTR_Title_Color = DeepSkyBlue;
extern color TODAY_Value_Color = White;
extern color ADTR_Value_Color = White;


double ATR_Day_0;
double ATR_Total;
string ATR_String;
double PIP;
double MPP_Double;
string MPP_Total;

string prefix = "ADTR_Example_";
string name;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
Sleep(1000);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
Sleep(1000);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{

//--------------------------------------------------------------------
// TODAYS PIP TRADING RANGE AND AVERAGE PIP TRADING RANGE FOR LAST MONTH (19 WORKING DAYS)


ATR_Day_0=(iHigh(Symbol(),1440,0) - iLow(Symbol(),1440,0));

ATR_Total=0;
int i;
PIP=MarketInfo(Symbol(), MODE_TICKVALUE);

for (i=1;i<DAYS;i++)
{
ATR_Total=ATR_Total+(iHigh(Symbol(),1440,i) - iLow(Symbol(),1440,i));
}

ATR_Total = ATR_Total/(DAYS-1);

ATR_String=DoubleToStr(ATR_Total/Point,0);
MPP_Double=StrToDouble(ATR_String);

MPP_Double=MPP_Double*PIP;
MPP_Total=DoubleToStr(MPP_Double,0);

name = prefix +"Todays_Pips_Title";
ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name,"Today",Font_Size, "Arial Bold", TODAY_Title_Color);
ObjectSet(name, OBJPROP_CORNER, 0);
ObjectSet(name, OBJPROP_XDISTANCE, 0+X.Offset);
ObjectSet(name, OBJPROP_YDISTANCE, 0+Y.Offset);

name = prefix +"Todays_Pips_Value";
ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name,DoubleToStr(ATR_Day_0/Point,0)+" Pips",Font_Size, "Arial Bold", TODAY_Value_Color);
ObjectSet(name, OBJPROP_CORNER, 0);
ObjectSet(name, OBJPROP_XDISTANCE, 55+X.Offset);
ObjectSet(name, OBJPROP_YDISTANCE, 0+Y.Offset);

//------------------------------------------------------------------------------------------------
//THE AVERAGE TRADING RANGE FOR ALL 19 DAYS

name = prefix +"ATDR_Title";
ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name,"ADTR",Font_Size, "Arial Bold", ADTR_Title_Color);
ObjectSet(name, OBJPROP_CORNER, 0);
ObjectSet(name, OBJPROP_XDISTANCE, 150+X.Offset);
ObjectSet(name, OBJPROP_YDISTANCE, 0+Y.Offset);

name = prefix +"ADTR_Value";
ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
ObjectSetText(name,DoubleToStr(ATR_Total/Point,0)+" Pips",Font_Size, "Arial Bold", ADTR_Value_Color);
ObjectSet(name, OBJPROP_CORNER, 0);
ObjectSet(name, OBJPROP_XDISTANCE, 200+X.Offset);
ObjectSet(name, OBJPROP_YDISTANCE, 0+Y.Offset);

//-----------------------------------------------------------------------------------------------
Sleep(1000);
return(0);
}
//+------------------------------------------------------------------+
Attached Files
File Type: mq4 # ADTR Example.mq4 (3.5 KB, 93 views)

Last edited by maxvre; 01-15-2008 at 05:42 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-15-2008, 07:48 PM
ElectricSavant's Avatar
Senior Member
 
Join Date: Jun 2007
Posts: 2,724
ElectricSavant is on a distinguished road
I do not know how to communicate what I need. I am going to try.

It is not enough to just identify pip range as an average. Because it does not identify trend power. It could be a choppy environment and a high value may not help a trader in a decision he is using the indication for.

I need to find a deviation of direction and assign a range to that...

Do not ask me to explain...because I cannot.

Does anybody know what I mean?...cause' I sure the hell do not...

I think its called ADR....Average Directional Range?

ES
__________________
ElectricSavant Challenge™ (Ends 10/09/08)

Live Portfolio (This takes a while to download as it is a big excel spreadsheet)

Last edited by ElectricSavant; 01-15-2008 at 08:12 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-15-2008, 08:06 PM
Senior Member
 
Join Date: Jan 2007
Location: not so remote
Posts: 1,822
fxbs is on a distinguished road
ADTR example


does somebody tried already to do ATR (or Range) of (by) sessions?
don't know, ES, see, ATR somewhat deceiving thing
Attached Images
File Type: gif adtr.gif (23.5 KB, 1025 views)

Last edited by fxbs; 01-15-2008 at 08:08 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-15-2008, 09:22 PM
Linuxser's Avatar
Moderator
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 2,512
Blog Entries: 10
Linuxser has disabled reputation
Quote:
Originally Posted by fxbs View Post
ADTR example


does somebody tried already to do ATR (or Range) of (by) sessions?
don't know, ES, see, ATR somewhat deceiving thing
You mean something like this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-15-2008, 09:29 PM
BLUR71's Avatar
Member
 
Join Date: Sep 2007
Posts: 52
BLUR71 is on a distinguished road
Pip Power Indicator?

Is it possible to measure the movement of pips per candle for the day?

In other words, on a 5m chart you would have 288 candles for the day.

So, the question is can the movement of pips(positive or negative) be measured ?

for example the range would be 280 pips/day but Pip Power would be 1000-1200 pips for the day. Is this possible?

I think the range is a good indicator for volatility, but this suggestion above would greatly enhance ability to gauge volatily of any pair.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-15-2008, 09:36 PM
ElectricSavant's Avatar
Senior Member
 
Join Date: Jun 2007
Posts: 2,724
ElectricSavant is on a distinguished road
That's the ticket...thats what I want... It was all a blur...


Quote:
Originally Posted by BLUR71 View Post
Is it possible to measure the movement of pips per candle for the day?

In other words, on a 5m chart you would have 288 candles for the day.

So, the question is can the movement of pips(positive or negative) be measured ?

for example the range would be 280 pips/day but Pip Power would be 1000-1200 pips for the day. Is this possible?

I think the range is a good indicator for volatility, but this suggestion above would greatly enhance ability to gauge volatily of any pair.
__________________
ElectricSavant Challenge™ (Ends 10/09/08)

Live Portfolio (This takes a while to download as it is a big excel spreadsheet)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-15-2008, 10:00 PM
BLUR71's Avatar
Member
 
Join Date: Sep 2007
Posts: 52
BLUR71 is on a distinguished road
I've been looking for an indicator like that for the longest while...

Until now I thought I was the only one with this concept

I guess great minds think alike


Now..., if I only knew how to write the code...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-15-2008, 10:48 PM
Senior Member
 
Join Date: Jan 2007
Location: not so remote
Posts: 1,822
fxbs is on a distinguished road
[quote=Linuxser;178447]
could work; more like hourly - sessions....

may be some kind of like that?

that's how Wa did
Waddah Attar Buy Sell Vol ( never seen before )


if (iClose(Symbol(),DataFromTF,i)>iClose(Symbol(),Dat aFromTF,i+1))
{
P1 = P1+(iVolume(Symbol(),DataFromTF,i));



just take volume off ....
his indi a bit heavy - but works just fine

i modifyed original a bit - put user defined TFDatafeed
Attached Images
File Type: gif bs vol wa.gif (18.3 KB, 978 views)
Attached Files
File Type: mq4 BUY_SELL_Vol_WA_xtf.mq4 (3.4 KB, 59 views)

Last edited by fxbs; 01-15-2008 at 11:31 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-15-2008, 11:27 PM
Senior Member
 
Join Date: Jan 2007
Location: not so remote
Posts: 1,822
fxbs is on a distinguished road
w/o volumes would be like Absolute Strength set to 1:
Attached Images
File Type: gif as dhs.gif (20.2 KB, 968 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-15-2008, 11:46 PM
BLUR71's Avatar
Member
 
Join Date: Sep 2007
Posts: 52
BLUR71 is on a distinguished road
Pip Power Indicator?

Hi fxbs,

those indi are nice, but not exactly what I was hoping for..

Do you think its possible to measure the movement of the pips as stated above? In a numeric display like average daily range?

For example:
1st candle moved market price down 7 pips,
next candle down 12 pips,
next candle down 5 pips,
next candle up 20 pips

that would make total (Pip Power) movement be 44 pips over four candles.
So you would add all movement together, negative or positive , in a total movement index.

I hope that explanation is clear
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

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 On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/indicators-metatrader-4/11834-simple-adtr-indicator.html
Posted By For Type Date
Technorati: Discussion about “Simple ADTR indicator” This thread Refback 01-23-2008 09:50 AM
Simple ADTR indicator - Forex Trading This thread Refback 01-16-2008 12:54 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple indicator needed MFM General Discussion 1 10-16-2007 09:46 AM
Need help for this very very simple indicator canados Indicators - Metatrader 4 12 02-23-2007 08:21 PM
A Simple indicator antone Indicators - Metatrader 4 2 02-06-2007 06:19 PM
Simple indicator request -25- Indicators - Metatrader 4 1 01-24-2007 09:12 AM
I need a simple indicator programmed SaxMan Indicators - Metatrader 4 1 08-08-2006 07:26 PM


All times are GMT. The time now is 10:09 PM.



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