Welcome to the Traders Laboratory.

Coding Forum Collaborate, receive help, or discuss indicators and other coding-related topics

Reply
Old 04-25-2009, 06:04 PM   #9
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 466
Ignore this user

Thanks: 243
Thanked 354 Times in 151 Posts

Re: Array (EasyLanguage)

ThanX for your notes Mister TAMS

I like it hard !

Starting point = ending point = OK for a day H/L

but

Date + time must start the day before

Code:
// Draw High and Low lines of the day before 
// version 1.0
// Author: aaa
// Date: 20090425

Var:
count(       0 ),
count.end(   2 );

Arrays: 
Line.ID[2](  	0 ),
level[2](	0 ),
Color[2]( 	0 ),
Size[2]( 	0 ),
Style[2]( 	0 );

level[1] = HighD(1);
level[2] = LowD(1);

Color[1] = blue;
Color[2] = red ;

Size[1] = 2 ;
Size[2] = 2 ;

Style[1] = 1 ;
Style[2] = 1 ;

for count = 1 to count.end
begin
	Line.ID[count] = TL_New( d[1] , t[1] , level[count], d , t , level[count]);
	
	TL_SetColor( Line.ID[count] , Color[count] );
	TL_SetSize(  Line.ID[count] , Size[count]  );
	TL_SetStyle( Line.ID[count] , Style[count] );	
end;
aaa is offline  
Reply With Quote
Old 04-25-2009, 06:16 PM   #10
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 466
Ignore this user

Thanks: 243
Thanked 354 Times in 151 Posts

Re: Array (EasyLanguage)

It's a Great idea to create topics like this

Sorry, if it's not a really original indicator....

It is only an exercice with arrays
aaa is offline  
Reply With Quote
Old 04-25-2009, 06:21 PM   #11
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 466
Ignore this user

Thanks: 243
Thanked 354 Times in 151 Posts

Re: Array (EasyLanguage)

Code:
// Draw High and Low lines of the day before 
// version 1.01
// Author: aaa
// Date: 20090425

Inputs:
Color.High(	blue 	),
Color.low(	red 	),
Size.HL(	2   	),
Style.HL(	1 	);

Var:
count(       0 ),
count.end(   2 );

Arrays: 
Line.ID[2](  	0 ),
level[2](	0 ),
Color[2]( 	0 ),
Size[2]( 	0 ),
Style[2]( 	0 );

level[1] = HighD(1);
level[2] = LowD(1);

Color[1] = Color.High;
Color[2] = Color.low;

Size[1] = Size.HL ;
Size[2] = Size.HL ;

Style[1] = Style.HL ;
Style[2] = Style.HL ;

for count = 1 to count.end
begin
	Line.ID[count] = TL_New( d[1] , t[1] , level[count], d , t , level[count]);
	
	TL_SetColor( Line.ID[count] , Color[count] );
	TL_SetSize(  Line.ID[count] , Size[count]  );
	TL_SetStyle( Line.ID[count] , Style[count] );	
end;
aaa is offline  
Reply With Quote
Old 04-25-2009, 06:36 PM   #12

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 4,052
Ignore this user

Thanks: 2,275
Thanked 1,666 Times in 1,010 Posts

Re: Array (EasyLanguage)

Quote:
Originally Posted by aaa »
It's a Great idea to create topics like this
Sorry, if it's not a really original indicator....
It is only an exercice with arrays
it is fun just to plot lines here and there...
you'd never know, you might come up with a Nobel Prize winner by accident.
Tams is offline  
Reply With Quote
Old 04-26-2009, 04:54 AM   #13
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 466
Ignore this user

Thanks: 243
Thanked 354 Times in 151 Posts

Re: Array (EasyLanguage)

Tams,

I think that I am in the wrong way

I have now the yesterday HL during 2 days

The code looks complicate and if I want lines during x days it should be very long

The goal is to have the Yesterday HL during x days

Are arrays the solution ?

Is a counter a solution ?

Code:
Inputs:
Color.HL(	blue 	),
Size.HL(	2   	),
Style.HL(	1 	);

Var:
count(       0 ),
count.end(   4 );

Arrays: 
Line.ID[4](  	0 ),
level[4](	0 ),
DaysAfter[4](	0 ),
TimeAfter[4](	0 ),
DaysBefore[4](0 ),
TimeBefore[4](0 );

level[1] = HighD(1);
level[2] = LowD(1);
level[3] = HighD(2);
level[4] = LowD(2);

DaysBefore[1] = d[1] ;
DaysBefore[2] = d[1] ;
DaysBefore[3] = d[2] ;
DaysBefore[4] = d[2] ;

TimeBefore[1] = t[1] ;
TimeBefore[2] = t[1] ;
TimeBefore[3] = t[2] ;
TimeBefore[4] = t[2] ;

DaysAfter[1] = d[1] ;
DaysAfter[2] = d[1] ;
DaysAfter[3] = d[2]  ;
DaysAfter[4] = d[2] ;

TimeAfter[1] = t[1]  ;
TimeAfter[2] = t[1] ;
TimeAfter[3] = t[2]  ;
TimeAfter[4] = t[2] ;


for count = 1 to count.end
begin
	Line.ID[count] = TL_New( DaysBefore[count] , TimeBefore[count] , level[count], DaysAfter[count]  , TimeAfter[count]  , level[count]);
	
	TL_SetColor( Line.ID[count] , Color.HL);
	TL_SetSize(  Line.ID[count] , Size.HL  );
	TL_SetStyle( Line.ID[count] , Style.HL );	
end;
aaa is offline  
Reply With Quote
Old 04-26-2009, 05:01 AM   #14
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 466
Ignore this user

Thanks: 243
Thanked 354 Times in 151 Posts

Re: Array (EasyLanguage)

Quote:
it is fun just to plot lines here and there...
you'd never know, you might come up with a Nobel Prize winner by accident.
Let's try the Tams Prize before !
aaa is offline  
Reply With Quote
Old 04-26-2009, 02:53 PM   #15

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 4,052
Ignore this user

Thanks: 2,275
Thanked 1,666 Times in 1,010 Posts

Re: Array (EasyLanguage)

Quote:
Originally Posted by aaa »
Tams,
I think that I am in the wrong way
I have now the yesterday HL during 2 days
The code looks complicate and if I want lines during x days it should be very long
The goal is to have the Yesterday HL during x days
Are arrays the solution ?
Is a counter a solution ?

if you only need 2 lines across... array might be an overkill.
edit: let me give it some thought on the alternative... will post later.


array is useful when you are dealing with a lot of data,
and that you need to access those data in a non-sequential manner.

the Zigzag indicator is a good example where an array is used to keep track of the trendline coordinates.

Last edited by Tams; 04-26-2009 at 03:27 PM.
Tams is offline  
Reply With Quote
Old 04-26-2009, 04:21 PM   #16
aaa

aaa's Avatar

Join Date: Jun 2008
Location: Switzerland
Posts: 466
Ignore this user

Thanks: 243
Thanked 354 Times in 151 Posts

Re: Array (EasyLanguage)

Yes I reached my limits with arrays and I don't understand zigzag

I tried "my" indicator with 10 days long

It looks interesting especially scalping in 1 mn : the price stops always for a short break at highest last 1, 2 3 or more past days (cf picture below)

If you have time Could you make a correct code ?

Here is my terrible one

It works but slows down dramatically the software

Also the style is off

Code:
Inputs:
Days.Nbr(	2 	),
Color.HL(	blue 	),
Size.HL(	2   	),
Style.HL(	1 	);

Var:
count(       0 ),
count.end(   Days.Nbr * 2 );

Arrays: 
Line.ID[20](  0 ),
level[20](	0 ),
DaysAfter[20](0 ),
TimeAfter[20](0 ),
DaysBefore[20](0 ),
TimeBefore[20](0 );
 
level[1] = HighD(1);
level[2] = LowD(1);
level[3] = HighD(2);
level[4] = LowD(2);
level[5] = HighD(3);
level[6] = LowD(3);
level[7] = HighD(4);
level[8] = LowD(4);
level[9] = HighD(5);
level[10] = LowD(5);
level[11] = HighD(6);
level[12] = LowD(6);
level[13] = HighD(7);
level[14] = LowD(7);
level[15] = HighD(8);
level[16] = LowD(8);
level[17] = HighD(9);
level[18] = LowD(9);
level[19] = HighD(10);
level[20] = LowD(10);

DaysBefore[1] = d[1] ;
DaysBefore[2] = d[1] ;
DaysBefore[3] = d[2] ;
DaysBefore[4] = d[2] ;
DaysBefore[5] = d[3] ;
DaysBefore[6] = d[3] ;
DaysBefore[7] = d[4] ;
DaysBefore[8] = d[4] ;
DaysBefore[9] = d[5] ;
DaysBefore[10] = d[5] ;
DaysBefore[11] = d[6] ;
DaysBefore[12] = d[6] ;
DaysBefore[13] = d[7] ;
DaysBefore[14] = d[7] ;
DaysBefore[15] = d[8] ;
DaysBefore[16] = d[8] ;
DaysBefore[17] = d[9] ;
DaysBefore[18] = d[9] ;
DaysBefore[19] = d[10] ;
DaysBefore[20] = d[10] ;

TimeBefore[1] = t[1] ;
TimeBefore[2] = t[1] ;
TimeBefore[3] = t[2] ;
TimeBefore[4] = t[2] ;
TimeBefore[5] = t[3] ;
TimeBefore[6] = t[3] ;
TimeBefore[7] = t[4] ;
TimeBefore[8] = t[4] ;
TimeBefore[9] = t[5] ;
TimeBefore[10] = t[5] ;
TimeBefore[11] = t[6] ;
TimeBefore[12] = t[6] ;
TimeBefore[13] = t[7] ;
TimeBefore[14] = t[7] ;
TimeBefore[15] = t[8] ;
TimeBefore[16] = t[8] ;
TimeBefore[17] = t[9] ;
TimeBefore[18] = t[9] ;
TimeBefore[19] = t[10] ;
TimeBefore[20] = t[10] ;

DaysAfter[1] = d[1] ;
DaysAfter[2] = d[1] ;
DaysAfter[3] = d[2] ;
DaysAfter[4] = d[2] ;
DaysAfter[5] = d[3] ;
DaysAfter[6] = d[3] ;
DaysAfter[7] = d[4] ;
DaysAfter[8] = d[4] ;
DaysAfter[9] = d[5] ;
DaysAfter[10] = d[5] ;
DaysAfter[11] = d[6] ;
DaysAfter[12] = d[6] ;
DaysAfter[13] = d[7] ;
DaysAfter[14] = d[7] ;
DaysAfter[15] = d[8] ;
DaysAfter[16] = d[8] ;
DaysAfter[17] = d[9] ;
DaysAfter[18] = d[9] ;
DaysAfter[19] = d[10] ;
DaysAfter[20] = d[10] ;

TimeAfter[1] = t[1] ;
TimeAfter[2] = t[1] ;
TimeAfter[3] = t[2] ;
TimeAfter[4] = t[2] ;
TimeAfter[5] = t[3] ;
TimeAfter[6] = t[3] ;
TimeAfter[7] = t[4] ;
TimeAfter[8] = t[4] ;
TimeAfter[9] = t[5] ;
TimeAfter[10] = t[5] ;
TimeAfter[11] = t[6] ;
TimeAfter[12] = t[6] ;
TimeAfter[13] = t[7] ;
TimeAfter[14] = t[7] ;
TimeAfter[15] = t[8] ;
TimeAfter[16] = t[8] ;
TimeAfter[17] = t[9] ;
TimeAfter[18] = t[9] ;
TimeAfter[19] = t[10] ;
TimeAfter[20] = t[10] ;

for count = 1 to count.end
begin
	Line.ID[count] = TL_New( DaysBefore[count] , TimeBefore[count] , level[count], DaysAfter[count]  , TimeAfter[count]  , level[count]);
	
	TL_SetColor( Line.ID[count] , Color.HL);
	TL_SetSize(  Line.ID[count] , Size.HL  );
//	TL_SetStyle( Line.ID[count] , Style.HL );	
end;
Attached Thumbnails
Array (EasyLanguage)-snap1.jpg  
aaa is offline  
Reply With Quote

Reply

Tags
array, easylanguage

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buy at Open with Easylanguage cleon Coding Forum 5 03-02-2011 12:16 PM
Antonio: Please help me on MP for easylanguage nasdaq5048 Market Profile 13 09-23-2010 10:50 AM
Can function in TS8 return array? ImXotep Technical Analysis 5 05-25-2009 03:13 AM
MT4 Indicator Array Problem. ForexSurfr Coding Forum 0 02-16-2009 01:19 PM
Some EasyLanguage Help Please jjthetrader Coding Forum 8 06-02-2008 05:20 PM

All times are GMT -4. The time now is 06:51 AM.
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
2006-2011 Traders Laboratory, All Rights Reserved.