Forex



Go Back   Forex Trading > Downloads > Indicators - 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 09-27-2006, 02:32 PM
Junior Member
 
Join Date: Sep 2006
Posts: 22
derekc is on a distinguished road
Highest high for an indicator

I am trying to find out how to calculate the highest high and lowest low values for an indicator over a period in MQL4.

For example:

Using amibroker (similar sor metastock) the formula would be as below to calculate the highest high of the 30 day moving average over the last 10 periods.

Highest high = HHV(MA(Close,30),10 )
I have tried using ArrayMaximum() but this returns the position and not the value of the highest value.
Also Highest() does not work with indicators.

Any help will be much appreciated
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 09-27-2006, 03:52 PM
raff1410's Avatar
Senior Member
 
Join Date: May 2006
Location: 24°10' E 54°24' N
Posts: 201
raff1410 is on a distinguished road
Hi...............................
Attached Files
File Type: mq4 HH_LL.mq4 (2.1 KB, 598 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
  #3 (permalink)  
Old 09-28-2006, 01:34 AM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,410
Blog Entries: 56
Linuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond repute
Raff:

Do you have some code that I can use to:

Over a period x bars

Calculate the 1 highest high
Calculate the 2 highest high

Calculate and 1 lowest low
Calculate and 2 lowest low

But without a MA.

I´m searching to code a simple indicator that plots trendlines.

I know how to make a code to draw a trendline between 2 points. (object_create and object_move). But I need to know howto obtain the value of the high an low. Then I will use the data to fill the draw points.

I´d make some experimets with the zigzag indicator and the mod from coderguru but without succes.

Thanks.
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 09-28-2006, 06:47 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
Take a look at the dictionary :

int Highest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
Returns the shift of the maximum value over a specific number of periods depending on type.

Do not forget that this function return the index of the bar, not a value, so look at the sample :

Sample:
double val;
// calculating the highest value in the range from 5 element to 25 element
// indicator charts symbol and indicator charts time frame
val=High[Highest(NULL,0,MODE_HIGH,20,4)];
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 09-29-2006, 07:15 AM
Junior Member
 
Join Date: Sep 2006
Posts: 22
derekc is on a distinguished road
Thanks for all the replies.

Michel,

I think the formula:
val=High[Highest(NULL,0,MODE_HIGH,20,4)];

Will return the highest high of the high price for that period but can not be used to return the highest high for an indicator like the moving average of the price.
This is because the series array identifier used is MODE_HIGH.

Please correct me if I am wrong.
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 09-29-2006, 07:16 AM
raff1410's Avatar
Senior Member
 
Join Date: May 2006
Location: 24°10' E 54°24' N
Posts: 201
raff1410 is on a distinguished road
Hi... automatic trend lines indicator...

Raff

Quote:
Originally Posted by Linuxser
Raff:

Do you have some code that I can use to:

Over a period x bars

Calculate the 1 highest high
Calculate the 2 highest high

Calculate and 1 lowest low
Calculate and 2 lowest low

But without a MA.

I´m searching to code a simple indicator that plots trendlines.

I know how to make a code to draw a trendline between 2 points. (object_create and object_move). But I need to know howto obtain the value of the high an low. Then I will use the data to fill the draw points.

I´d make some experimets with the zigzag indicator and the mod from coderguru but without succes.

Thanks.
Attached Files
File Type: mq4 TrendLines.mq4 (5.3 KB, 535 views)
__________________

Last edited by raff1410; 09-29-2006 at 03:28 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
  #7 (permalink)  
Old 09-30-2006, 12:52 AM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,410
Blog Entries: 56
Linuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond repute
Quote:
Originally Posted by raff1410
Hi... automatic trend lines indicator...

Raff
Thanks Raff.

It´s working really good.
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 10-13-2006, 09:36 AM
Junior Member
 
Join Date: Sep 2006
Posts: 22
derekc is on a distinguished road
Ok I have found a way to calculate the highest high or lowest low for an indicator over a specified period.

If you wanted to find the highest high or lowest low for an indicator like the simple moving average you have to declare an array and fill a "for" loop with the calculated values for each bar of the period you are testing.
Then you have to use ArrayMaximum and ArrayMinimum to find the position of the high or low in the array and then find the value of that position using iHigh() and iLow().

//calculate the highest high of the moving average
int malookback=5; //4+1 - the number of bars to calc the value of the ma
int madailyPERIOD = 30; //moving average period
double madaily[5];//declare an array
double dhhv,dllv;

for(int i = 0; i < malookback; i++)
{
madaily[i]=iMA(NULL,PERIOD_D1,madailyPERIOD,0,MODE_SMA,PRICE _CLOSE,i);
dhhv=iHigh("EURUSD", PERIOD_D1,(ArrayMaximum(madaily,4, 1))) ;

//calculate the lowest low of the moving average

dllv=iLow("EURUSD", PERIOD_D1,(ArrayMinimum(madaily,4, 1))) ;
}
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 09-12-2007, 10:35 PM
robertinno's Avatar
Senior Member
 
Join Date: Jul 2006
Posts: 229
Blog Entries: 2
robertinno is on a distinguished road
i-HighLow Indicator

i-HighLow indicator draws the channel with borders correspond to highest high and lowest low values of the bar's shadows for the last N bars.

Indicators' parameters are:

extern int N = 20; - searching of highest/lowest bars for the last 20 bars
extern int N2 = 5; - drawing the borders with 5 points offset by price axis
Attached Images
File Type: gif hi_low1.gif (34.1 KB, 2053 views)
File Type: gif hi_low2.gif (37.3 KB, 2046 views)
Attached Files
File Type: mq4 i-HighLow.mq4 (2.9 KB, 282 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 01-03-2008, 05:12 AM
Member
 
Join Date: Oct 2005
Posts: 35
yaniv_av is on a distinguished road
HH HL LH LL indicator

Hi all !

Do you know an indicator (or Expert advisor) that mark the HH/HL/LH/LL on the chart?

Thanks,
Yan
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


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
Day High & Low indicator.. markt Indicators - Metatrader 4 7 04-06-2008 02:41 AM
Martingale and other high risk high reward systems TraderGeek General Discussion 15 05-03-2007 06:59 AM
High-High/Low-Low indicator trevman Indicators - Metatrader 4 5 01-07-2007 05:39 AM


All times are GMT. The time now is 11:43 PM.



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