Hey Guys,
From the teachings in this forum and personal excersice i have discovered how to build a grid indicator, But there is a little problem Im having : building the indicator as a single variable it worked correctely but when i tried to convert each grid line into individual element (array) so i can apply it to an EA, its saying array out of range.
Here are the samples :
GridLine Indicator as Variable
MQL4 arrays need to be resized before they can be populated.
In init() -> ArrayResize(gridLine, SIZE);
In start() and deinit() -> for(int i = 0; i < SIZE; i++) {}
thanks
In init() -> ArrayResize(gridLine, SIZE);
In start() and deinit() -> for(int i = 0; i < SIZE; i++) {}
Thanks to all, i appreciate your comment
Okasana Berenko, thanks so much,i realy appreciate your comment,now i have desing the grid indicator in array formatt...
int OnInit()
{
//---
TickSize = MarketInfo(Symbol(),MODE_TICKSIZE);
if(TickSize ==0.00001 || Point == 0.001)
pips= TickSize * 10;
else pips= TickSize;
//---
ArrayResize(gridLine, Size);// as you said, i should apply the ArrayResize function on the init...
return(INIT_SUCCEEDED);
}
and on the denint and the start i also did as you said :
for( i = 0; i < Size; i++) //on init and denit
//..................... But it still saying array is out of range pls take a look at it
int OnInit()
{
//---
TickSize = MarketInfo(Symbol(),MODE_TICKSIZE);
if(TickSize ==0.00001 || Point == 0.001)
pips= TickSize * 10;
else pips= TickSize;
//---
ArrayResize(gridLine, Size);// as you said, i should apply the ArrayResize function on the init...
return(INIT_SUCCEEDED);
}
and on the denint and the start i also did as you said :
for( i = 0; i < Size; i++) //on init and denit
//..................... But it still saying array is out of range pls take a look at itMQL4 arrays need to be resized before they can be populated.
int OnInit()
{
//---
TickSize = MarketInfo(Symbol(),MODE_TICKSIZE);
if(TickSize ==0.00001 || Point == 0.001)
pips= TickSize * 10;
else pips= TickSize;
//---
ArrayResize(gridLine, Size);// as you said, i should apply the ArrayResize function on the init...
return(INIT_SUCCEEDED);
}
and on the denint and the start i also did as you said :
for( i = 0; i < Size; i++) //on init and denit
//..................... But it still saying array is out of range pls take a look at it
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
From the teachings in this forum and personal excersice i have discovered how to build a grid indicator, But there is a little problem Im having : building the indicator as a single variable it worked correctely but when i tried to convert each grid line into individual element (array) so i can apply it to an EA, its saying array out of range.
Here are the samples :
GridLine Indicator as Variable