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:

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 );[/CODE]

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?

 

Arrays

newdigital:
Codersguru,

I have a question.

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

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 );[/CODE]

So, I wrote the following:

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 );[/CODE]

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:

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 100items and initialize all the items to 0.

 

Thanks,

I will continue to convert this indicator. I will post it. But I want to try to convert by myself first.

Reason: