Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > 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 Thread Tools Display Modes
  #1 (permalink)  
Old 01-21-2007, 04:53 AM
Member
 
Join Date: Feb 2006
Posts: 53
icm63 is on a distinguished road
Data in Array converted to btw 0 and 1 ( normalisation) !

hi,

I have EURUSD close only data in an array. like Data[]

But the numbers are all EURUSD closes for all the records.

How can I convert or normalise all data in the array to between a minimum of 0 and maxium of 1.

Then I can draw data in Indictor box. And other reasons ???

I know I need Max number in Data[] and Min number in Data[] and then spread data based on a ratio back into array ??

Any ideas ???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-21-2007, 07:04 AM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 280
ralph.ronnquist is on a distinguished road
data[ i ] = ( data[ i ] - min ) / ( max - min )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-21-2007, 08:12 AM
Member
 
Join Date: Feb 2006
Posts: 53
icm63 is on a distinguished road
Thanks just cracked it at 10.12 pm NZD time

// Normalise data between 0 and 100
void Normalise(double& InData[])
{
double max, min, range;
int count = ArraySize(InData);
int k, m;
double Temp[];
k = ArrayMaximum(InData,512,0);
max = InData[k];
m = ArrayMinimum(InData,512,0);
min = InData[m];
range = max - min;
ArrayResize(Temp, count);

for(int i=0; i<count; i++)
{
Temp[i] = NormalizeDouble((((InData[i] - min) / range)*100),2) ;
}
ArrayCopy(InData, Temp);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-21-2007, 09:53 AM
Senior Member
 
Join Date: Jun 2006
Posts: 1,136
prasxz is on a distinguished road
hi

Quote:
Originally Posted by icm63
Thanks just cracked it at 10.12 pm NZD time

// Normalise data between 0 and 100
void Normalise(double& InData[])
{
double max, min, range;
int count = ArraySize(InData);
int k, m;
double Temp[];
k = ArrayMaximum(InData,512,0);
max = InData[k];
m = ArrayMinimum(InData,512,0);
min = InData[m];
range = max - min;
ArrayResize(Temp, count);

for(int i=0; i<count; i++)
{
Temp[i] = NormalizeDouble((((InData[i] - min) / range)*100),2) ;
}
ArrayCopy(InData, Temp);
}
Hi,

do you want to use that normalisation in pattern recognition system or Neural Network Data feed ?

===================
Forex Indicators Collection
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-22-2007, 01:25 AM
Member
 
Join Date: Feb 2006
Posts: 53
icm63 is on a distinguished road
Nope, I need to normalise data for correlation calculations.

Thx
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 Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Function that returns an Array? charliev Metatrader 4 14 Yesterday 10:53 PM
RSI data to CSV arjang General Discussion 5 07-22-2008 09:59 PM
Great indicator - partly converted from MQ3 leeb Indicators - Metatrader 4 11 01-24-2007 06:48 PM
Array search helper functions for your use... cubesteak Metatrader 4 3 09-04-2006 04:55 AM


All times are GMT. The time now is 04:57 AM.



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