[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 15

 
Novice >> :
What is the error here and how can it be implemented?

Actually, you've already implemented it), all that's left is to bring the final lot to an acceptable form...

 
Novice wrote(a) >>

What is the error here and how can it be implemented?

forgot to put ; at the end of each line !!!

 
neoclassic >> :
Can you tell me if it is possible to output a jpeg on a graph?
 
You can't, you can create your own font like Wingding as a picture and output...
 
xrust >> :

What exactly are you trying to implement?


Auto lot counting: 0.01 lots for every 50 balance units.
Figar0 >> :

Yes actually you have already implemented), all that's left is to bring the final lot to an acceptable form...


It gave 5 errors when compiling, I didn't understand why.

keekkenen wrote >>

forgot to put ; at the end of each line !!!


Thank you very much. It worked.
 
Good afternoon, gentlemen programmers. Please help with the program. It's a timer, but it's not on MKL4, it's a lefty of some sort. That is, it's just a program. This timer counts down equal time intervals and gives a signal. But the intervals are very short. The longest one is 120 seconds, but the intervals should be longer, up to half an hour. Is it possible to do something? Thank you in advance.
Files:
tim_ngtrrg.rar  213 kb
 

here's an example of a function

bool isTime(int sec){
   bool res = false;
   static datetime time = 0;
   double min = 0;
   if (TimeCurrent() >= time){
      min = MathFloor( sec / 60);
      if ( min==0) min = 1.0;         
      time = iTime(NULL,PERIOD_H1,0) + (MathFloor(Minute()/ min) + 1) * min * 60;
      res = true;
   } 
   return( res);
}


the function returns true if a given number of seconds has passed since the last call of the function.

it is done this way, if ( ! isTime(Period()*60) ) return(0); this is true for any timeframe...


in the function the starting point is always the beginning of the current hour(iTime(NULL,PEROD_H1,0))

For example, if you want to have an alert popping up every 111 seconds from the beginning of the first start, you may want to modify this function...

so it would be as follows

bool isTime(int startTime, int sec){
   bool res = false;
   static datetime time = 0;
   double min = 0; 
   if (TimeCurrent() >= time){
      min = MathFloor( sec / 60);
      if ( min==0) min = 1.0;          
      time = startTime + (MathFloor(Minute()/ min) + 1) * min * 60;
      res = true;
   }  
   return( res);
}

so that an alert will pop up every 111 seconds is done as follows

int startTime = 0;

int init (){
   startTime = TimeCurrent();
}

int start(){

   if (! isTime(111)) return(0);

   Alert("Прошло 111 или более секунд !");
}
 
keekkenen >> :

here's an example of a function


the function returns true if a given number of seconds have passed since the last time the function was called.

if ( ! isTime(Period()*60) ) return(0); this behaviour applies to any timeframe.


in the function the starting point is always the beginning of the current hour(iTime(NULL,PEROD_H1,0))

for example, if you want an alert to popup every 111 seconds after the first start, you need to modify this function...

we get the following

so that the alert will pop up every 111 seconds





Thank you, could you tell me how to format it: as a script or as an advisor?

 
Well, it's up to you where you want to use it... it will work there and there...
 

Can you tell me if it is possible to increase the number of lots in a market order without opening new ones?

Reason: