Forex
Google

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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 12-12-2005, 10:54 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,388
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
mql2 to mql4

Codersguru,

I have a question.
I just starting to convert some indicator and have the following part of the code in the beginning:

Code:
Variable : StartBar( 1000 );
Variable : Shift( 0 );
Variable : TrendUP( true );
Variable : Extremum( 0 );
Variable : ChannelWidth( 0 );
Variable : TR( 0 );
Array : Values[ 100 ]( 0 );
Variable : Head( 0 );
So, I wrote the following:

Code:
int StartBar=1000;
int Shift=0;
bool TrendUP=true;
int Extremum=0;
double ChannelWidth=0;
double TR=0;
Array : Values[ 100 ]( 0 );
double Head( 0 );
But I could not translate this part of the code:

Array : Values[ 100 ]( 0 );


Because of
[100](0).

May you help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-13-2005, 11:54 AM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Exclamation Arrays

Quote:
Originally Posted by newdigital
Codersguru,

I have a question.
I just starting to convert some indicator and have the following part of the code in the beginning:

Code:
Variable : StartBar( 1000 );
Variable : Shift( 0 );
Variable : TrendUP( true );
Variable : Extremum( 0 );
Variable : ChannelWidth( 0 );
Variable : TR( 0 );
Array : Values[ 100 ]( 0 );
Variable : Head( 0 );
So, I wrote the following:

Code:
int StartBar=1000;
int Shift=0;
bool TrendUP=true;
int Extremum=0;
double ChannelWidth=0;
double TR=0;
Array : Values[ 100 ]( 0 );
double Head( 0 );
But I could not translate this part of the code:

Array : Values[ 100 ]( 0 );


Because of
[100](0).

May you help?
newdigital,

Great work!

You should translate this line:

Code:
Array : Values[ 100 ]( 0 );
From Mql2 to Mql4 like this:

Code:
double Values[100] = {0};
or
Code:
int Values[100] = {0};
Which means: declare an array (double type or integer type) that holds 100 items and initialize all the items to 0.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-13-2005, 04:31 PM
newdigital newdigital is online now
Administrator
 
Join Date: Sep 2005
Posts: 15,388
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Thanks,

I will continue to convert this indicator. I will post it. But I want to try to convert by myself first.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

vB 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Welcome to the MQL4 course codersguru Metatrader 4 mql 4 - Development course 84 05-18-2008 05:59 PM
Help for convert from VT to MQL4 M-E-C Expert Advisors - Metatrader 4 11 07-27-2007 06:53 PM
www.mql4.com DeSt Metatrader 4 18 02-01-2006 11:59 PM


All times are GMT. The time now is 11:01 AM.