Coding help - page 371

 

2014.10.15 12:36:23.875 Tester: Cannot load Experts\Fisher Auto EA v1 m11

 

2014.10.15 12:36:23.875 Cannot open file 'C:\Program Files\Forex Broker Inc MT4 Client Terminal\MQL4\Experts\Fisher Auto EA v1 m11.ex4' [2]

 
grego:
2014.10.15 12:36:23.875 Cannot open file 'C:\Program Files\Forex Broker Inc MT4 Client Terminal\MQL4\Experts\Fisher Auto EA v1 m11.ex4' [2]

If your EA is complied and as I saw it can be loaded on a live chart, the only thing that can cause that is a new metatrader 4 and its back tester bugs. But check if the EA is correctly compiled

 

declaration of 'LeftNum1' hides global declaration at line 20 fisher m111.mq4 119 8

maybe problem between expert and indicator!?

 
grego:
2014.10.15 12:36:23.875 Cannot open file 'C:\Program Files\Forex Broker Inc MT4 Client Terminal\MQL4\Experts\Fisher Auto EA v1 m11.ex4' [2]

Quick visual back test of that EA

It is working and it is opening (and closing) orders. Default parameters used

Files:
backtest.gif  66 kb
 

Hi guys again... another small request:

can someone tell me how to remove duplicate values from a string array?

Please

Thanks!

 
AtApi:
Hi guys again... another small request:

can someone tell me how to remove duplicate values from a string array?

Please

Thanks!

You can not remove an array element(s) unless it is / they are the last element(s) of the array. Since that is not going to be the case in 99.999% of cases, you have to create a new empty array and add only unique elements of the existing array to that newly created array

 

Thanks mladen for your reply.. so should i do something like this?

int numDups = 0, prevIndex = 0;

string tempArray[];

for (int x = 0; x < ArraySize(myArray); x++)

{

bool foundDup = false;

for (int j = 0; j < x; j++)

{

if (myArray[x] == myArray[j])

{

foundDup = true;

numDups++; // Increment means Count for Duplicate found in array.

continue;

}

}

if (foundDup == false)

{

tempArray[prevIndex] = myArray[x]; prevIndex++;

}

}

 
AtApi:
Thanks mladen for your reply.. so should i do something like this?

int numDups = 0, prevIndex = 0;

string tempArray[];

for (int x = 0; x < ArraySize(myArray); x++)

{

bool foundDup = false;

for (int j = 0; j < x; j++)

{

if (myArray[x] == myArray[j])

{

foundDup = true;

numDups++; // Increment means Count for Duplicate found in array.

continue;

}

}

if (foundDup == false)

{

tempArray[prevIndex] = myArray[x]; prevIndex++;

}

}

[/CODE]

Try something like this :

[CODE] string tempArray[];

for (int i = 0; i < ArraySize(myArray); i++)

for (int j = i+1; j < ArraySize(myArray); j++)

if (myArray == myArray[j]) myArray[j]="remove";

for (i = 0; i < ArraySize(myArray); i++)

if (myArray != "remove") { ArrayResize(tempArray, ArraySize(tempArray)+1); tempArray[ArraySize(tempArray)-1]=myArray; }

 
mladen:
Try something like this :
string tempArray[];

for (int i = 0; i < ArraySize(myArray); i++)

for (int j = i+1; j < ArraySize(myArray); j++)

if (myArray == myArray[j]) myArray[j]="remove";

for (i = 0; i < ArraySize(myArray); i++)

if (myArray != "remove") { ArrayResize(tempArray, ArraySize(tempArray)+1); tempArray[ArraySize(tempArray)-1]=myArray; }

Thanks mladen!

the problem this way is that it doesnt really remove the string from the array it just change the value of the string to "remove" on both original and duplicate value...so if i want later filter them i will remove the original value as well.. i hope i m clear..