[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 63

 

Hint how to make a check condition by the minute for example, just need the script to run for example once a minute, not on every tick.

this is what i was thinking, but it's not working, sorry about that ;)

  			int teme;
                     
                        if ( teme ==  Minute())
                        {
                            teme =  Minute();
                            Alert("раз", Minute());
                            teme=teme+1;
                        }
                        else
                        {
                              teme=teme+1;
                        }

I understand that i need to do it in a loop, just can't get to it, i'd appreciate it !

 
Roll:
if ( condition) { ... Alert("once", Minute());Sleep(60000);}
Will the program check after this condition? Is this condition located in the middle of the listing, or should it be placed at the end of the program? Can we make the program work on every tick, but certain code fragments will be checked cyclically, and if they don't coincide, then it will proceed further in the program?
 
Roll:
For the script I think so.
wrote to the PM
 
Can someone tell me how to make an EA to give out for example an alert every hour, but not by sleep, the script itself calculates at every tick and does its job at every new hour and gives the result in alert. how can I do it?
 
frixer:
Can someone tell me how to make an EA to alert every hour, for example, but not by sleep, the script itself calculates at every tick and does its job at every new hour and gives the result in Alert. how can I do it?

A script or an Expert Advisor? Different approaches
 
sorry councillor...
 
alsu:
This is not an oversight)) On the contrary, it is reported that the Math_Lib on the USDCHF1 chart has been successfully loaded))
))) Thank you.
 
frixer:
sorry councillor...

int start(){

  if (nevHour()) Alert();

  return(0);
}

bool nevHour(){
   static int prevtime=0;
   if (prevtime==0) {
      prevtime=iTime(NULL, PERIOD_H1,0);
   } else if (prevtime!=iTime(NULL, PERIOD_H1,0)) {
      prevtime=iTime(NULL, PERIOD_H1,0);
      return(true);
   }
   return(false);
}
 
Guys, how do you make an RSI with a period of 7200 as a code?
 
bikrus13:
Guys, how do you make an RSI with a period of 7200 as a code?
Have a look in the terminal, RSI "as code" is standard.
Reason: