[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 289

 
GarKain:
Do I understand correctly, if I write i instead of Time[i], I get the bar number?

And if I use such a script in an EA, then when a new crossing occurs, the value of i will change to a new one?
can you give me a simple yes/no answer to these two questions so that i dont get confused. Thanks
 
Yes, and check it out here :
Documentation
 

Hi! I'm trying to create an indicator function and I have a question: the indicator draws arrows when curves cross, but how do I get this signal from the indicator function via iCustom? (1)

I was wondering if I could transfer this signal using a true/false condition? (2)

But then how do I transfer this signal through iCustom? Do I still have to specify both indicator variables in the indicator function and in iCustom and declare arrays?

(1) else
               { // если выполнено условие нисходящего пересечения
               Print("  Up выполнены условия истинности пересечения ");

                CrossDownBuffer[index_up_1]=Cr1+5*Point;// ставим стрелку вниз 
                // 

(2) else
               { // если выполнено условие нисходящего пересечения
               Print("  Up выполнены условия истинности пересечения ");

                CrossDownBuffer[index_up_1]=Cr1+5*Point;// ставим стрелку вниз 
                //  
                CrossDownSignal = true;
//тогда
if
{
Ind_Value = iCustom(NULL, 0, "MaSignalFunction", true 0, 2); 
{ticket = OrderSend(....
 
FAQ thanks.
 
Folks, please pull up for newcomer answers. The previous shift is exhausted.
 
And how do you find the minimum and maximum values of an indicator over a certain period?
 
Similarly, if the value is less than the minimum, the minimum is updated (minimum=value), and the maximum is the same, only if it is greater
 
Like this?

//+------------------------------------------------------------------+
//| 00003.mq4 |
//| Copyright 2012, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
#property show_inputs
extern int Depth=100;
extern inttern ExtRVIPeriod=10;
double mini=0;
double maxi=0;
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start() {
//----
if(Depth>Bars-1) Depth=Bars-1;
for(int i=1; i<Depth; i++) {
double RVI = iRVI(NULL,0,ExtRVIPeriod,MODE_MAIN,i);
if(RVI < mini){
mini=RVI;
}
if(RVI > maxi){
maxi=RVI;
}
}
//----
Alert (mini," : ",maxi);
return(0);
}
//+------------------------------------------------------------------+
 
granit77:
Folks, please pull up for beginner's answers. The previous shift is exhausted.

It's true - these answers sometimes make you feel so tired that you feel like you've really been on a work shift :)
 
GarKain:
Like this?
.......... .........
Alert (mini," : ",maxi);
return(0);
}
Yeah, but if we put Alert after the loop's parentheses, it will only return the values in those variables after the loop has been executed. And if you put it in the loop, and also add the variable i in it, we'll see these values at each candlestick, and even know its number. And since your loop goes from the present to the past, the values closest to the market can be seen on the chart using the "crosshair" tool - it will show (with the left mouse button pressed) how many candles it is away from the current position