Array: Table_value2[500,2](0);

 
hi,

i have problem with ArrMql4

MQl3:
Array: Table_value2[500,2](0);

MQL4 :

?


regards
Alex
 
Alex


double table[500][2];

for (int i= 0; i<500; i++) {
for (int j= 0; j<2; j++) {
table[i][j]= 0;
}
}


Btw, in case you're trying to convert the AscTrend indicator (I just say this because I saw an 500,2 array on the code recently when working on that), check out www.strategybuilderfx.com and look for the FxOverEasy thread in the MT4 section or check out the FXOE.ZIP archive on the file section there.



Markus
 
Hi,

Thanks

no i convert TrendTrader by Forex-experts.com to MQL 4

can you me help?
spasss@gmx.de
 
no i convert TrendTrader by Forex-experts.com to MQL 4
can you me help?


Those Trend thingies tend to be all the same under different names.

If this thing here sounds familiar


for(counter=i,TrueCount=0;counter<i+9 && TrueCount<1;counter++) if( MathAbs(Open[counter]-Close[counter+1])>=Range*2.0) TrueCount++;
if( TrueCount>=1) MRO1=counter ;
else MRO1=-1;

for(counter=i,TrueCount=0;counter<i+6 && TrueCount<1;counter++) if(MathAbs(Close[counter+3]-Close[counter])>=Range*4.6) TrueCount++;
if( TrueCount>=1) MRO2=counter;
else MRO2=-1;

if (MRO1>-1) value11=3;
else value11=value10;

if (MRO2>-1) value11=4;
else value11=value10;


then just pick any AscTrend from the sources quoted above.

Or use this implementation ... it does the same, but far more elegant (Kudos to Komposter who did the base work):


//+------------------------------------------------------------------+
//| ASC-Trend Indicator (based on work by komposter |
//| mailto:komposterius@mail.ru) |
//+------------------------------------------------------------------+
int AscTrend(int offset, int lastbar, double &signalslong[], double &signalsshort[], int risk)
{
// by Shimodax, based on "AscTrend1.mq4 by Komposter"
// original link "mailto:komposterius@mail.ru"

// see also:
// http://www.visualtradingcharts.com/forum/viewtopic.php?t=278
// http://www.wintick.com/6_0/hybrid_example.asp?M=Forex
// http://www.wintick.com/6_0/download/version6_0/manual.pdf


#define STATE_LONG 1
#define STATE_SHORT -1

int i, n,
signal= 0,
updown= 0,
rangedist= 10;

double wprdefperiod= 10,
wprperiod,
siglevelup=70,
sigleveldown=30,
avgrange, sum;


wprdefperiod= 3+risk*2;
siglevelup= 67+risk; // used to be 70
sigleveldown= 33-risk; // used to be 30

wprperiod= wprdefperiod;

lastbar= MathMax(offset+250, lastbar); // give it at least 250 bars to chew
lastbar= MathMin(Bars, lastbar);

for (i= lastbar; i>=offset; i--) {

avgrange= 0;
sum= 0;

signalslong[i]= 0; // clear possibly old signals
signalsshort[i]= 0; // (due to scrolling)

for (n=i ;n<=i+(rangedist-1); n++) {
sum= sum + MathAbs(High[n]-Low[n]);
}
avgrange= sum/rangedist;

wprperiod= wprdefperiod;

for (n= i; n<i+(rangedist-1); n++) {
if (MathAbs(Open[n]-Close[n+1])>=avgrange*2.0 ) {
wprperiod= 3;
break;
}
}

for (n= i; n<i+(rangedist-1-3); n++) {
if (MathAbs(Close[n]-Close[n+3])>=avgrange*4.6) {
wprperiod= 4;
break;
}
}

double wpr= iWPR(Symbol(), 0, wprperiod, i) + 100; // convert [-100 ... 0] => [0 ... 100]

signal= 0; // only used for function return value

if (wpr>siglevelup && updown!=STATE_LONG) { // upswing while not already long
signalslong[i]= Low[i] - 2*Point;
signal= STATE_LONG;
updown= STATE_LONG;
}

if (wpr<sigleveldown && updown!=STATE_SHORT) { // downswing while not already short
signalsshort[i]= High[i] + 2*Point;
signal= STATE_SHORT;
updown= STATE_SHORT;
}
}

if (DebugLogger)
Print(TimeOffset(offset), "FXOE-ASCTREND is ", updown+signal);

return(updown + signal);
}




Markus
Reason: