without diving into code meaning -
it compiles, which seems like a bug in MT5 version 2007 - not all paths return a value, and still compiles ok..
it compiles, which seems like a bug in MT5 version 2007 - not all paths return a value, and still compiles ok..
//+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double Func(double d,int typed) { //--- double typed // this variable is input //--- double d; // this variable is input double array[]; // length is 4 double numArray2[];// length is 4 double sourceArray[]; // length is 24 double destinationArray[]; // length is 5 double numArray5[]; // length is 5 int numArray1[]={32,4}; // length is 2 and valued double num2 = 2.0 * MathRound((MathSqrt(d / numArray1[typed]) / 2.0)); double num3 = MathFloor(MathSqrt(d)); double num4 = num3 - num2; double num5 = num3 + num2; for(int index=0; true; index++) // the 'true' means that no condition for checking { sourceArray[index]=MathPow(num4+((num2 *(index+1))/8.0),2.0); if(index>7) { for(int num9=8; true; num9++) { sourceArray[num9]=MathPow(num3+((num2 *(num9-7))/8.0),2.0); if(num9>15) { for(int num10=16; true; num10++) { sourceArray[num10]=MathPow(num5+((num2 *(num10-15))/8.0),2.0); if(num10>23) { for(int num11=0; true; num11++) { if((d>=sourceArray[num11]) && (d<sourceArray[num11+1])) { ArrayCopy(sourceArray,destinationArray,num11-5,0,5); // ArrayCopy(sourceArray,numArray5,num11+2,0,5); for(int num12=0; num12<=3; num12++) { array[num12]=MathAbs(MathRound((destinationArray[num12+1]-destinationArray[num12]))); numArray2[num12]=MathAbs(MathRound((numArray5[num12+1]-numArray5[num12]))); } } ArraySort(array); double num6=array[0]; ArraySort(numArray2); double num7=numArray2[ArraySize(numArray2)-1]; if(num11>22) { return(8.0*MathRound(((((16.0*MathRound((num6/16.0)))+(16.0*MathRound((num7/16.0))))/2.0)/8.0))); // } } } } } } } } }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all
I have a code that give two numbers and its result is a number
it is in java languageand not in Mql5 language. and i want to change it to an indicator that draw a line with result value.
the code is :
The Base code was in C# language. i change it to java and i couldnt change it to Mql5.
Thanks o lot
Best Regards