[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 138

 
todem:
why do you specify 15??? you need 10

First I say:

ArrayResize(m, 10)

...

I fill 10 elements with values.

Then I find out I need more space for five more elements and say:

ArrayResize(m, 15).

So, the original 10 elements retain their values.

Got it ?

 
Adapted from KimIV's Useful Functions branch.
<br / translate="no">todem 22.02.2011 19:09
Can you tell me how to find out if the terminal is turned on and how to set all open orders and tickets created by the same EA?
 
I can't find error (I've tried everything until gut feeling method).
I have two stochastics on H4 and M15. When "H4 from 20 to 80 + going up" + "on M15 the main line crosses the signal line from bottom to top + M15 below 50" = this is a buy signal (vice versa - sell signal).

So for visual analysis on these signals I try to put vertical lines (I wanted green line to buy and red line to sell, but I failed). I am writing this as an EA and I always draw only 2 lines on the first 2 signals and that's it. I can not understand why all the signals are not plotted. I have tried different timeframes for tester (3, 6 months), the result is the same. Please tell me the error:

//--------------------
int init()
{

return(0);
}

int deinit()
{

return(0);
}

int start()
{
double SH4_0=iStochastic(0,PERIOD_H4,20,3,3,MODE_SMMA,1,MODE_SIGNAL,0);
double SH4_1=iStochastic(0,PERIOD_H4,20,3,3,MODE_SMMA,1,MODE_SIGNAL,1);
double M15_0=iStochastic(0,PERIOD_M15,17,5,5,MODE_SMA,1,MODE_MAIN,0);
double SM15_0=iStochastic(0,PERIOD_M15,17,5,5,MODE_SMA,1,MODE_SIGNAL,0);
double M15_1=iStochastic(0,PERIOD_M15,17,5,5,MODE_SMA,1,MODE_MAIN,1);
double SM15_1=iStochastic(0,PERIOD_M15,17,5,5,MODE_SMA,1,MODE_SIGNAL,1);
int i=1;

if((SH4_0>SH4_1)&&(SH4_0>20)&&(SH4_0<80)&&(SM15_1>M15_1)&&(SM15_0<M15_0)&&(SM15_0<50))
{
ObjectCreate("line "+i, OBJ_VLINE, 0, Time[0], 0);
i++;
}
if((SH4_0<SH4_1)&&(SH4_0>20)&&(SH4_0<80)&&(SM15_1<M15_1)&&(SM15_0>M15_0)&&(SM15_0>50))
{
ObjectCreate("line "+i, OBJ_VLINE, 0, Time[0], 0);
i++;
}
return(0);

}

 

put the i variable and its initialisation before start()

or put static int i=1;

 
alsu:

put the i variable and its initialisation before start()

or put static int i=1;

alsu, you won't believe it - it works! :))))) Thanks a lot! Although when I run on ticks, it overlaps several lines one on top of the other, but it's not fatal :)
 

I wonder why the average number of changes (sumpos+(-sumneg))/2 is not absolutely correlative

with their ratio in a 100-point scale sumpos/(sumpos+sumneg)*100 and which option is correct.

For the convenience of tracing the correlation, the first is multiplied by 2 (doubled amplitude) and 50 is subtracted from the second (i.e. the scale is from -50 to 50)

 
eddy:

is completely correlative


I have never seen such a term before in my life)) Explain the meaning?
 
does not absolutely correlate
 
eddy:
not absolutely correlated

LOL ))

Where (which industry) do you know the absolute correlation ;) call things by their proper names ).

Читаем https://ru.wikipedia.org/wiki/%D0%9A%D0%BE%D1%80%D1%80%D0%B5%D0%BB%D1%8F%D1%86%D0%B8%D1%8F

 
eddy:
is not absolutely correlated.
I think it is very correlated - the QC is close to 100%. Or do you mean "not exactly equal"?
Reason: