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

 
ScioMe:
Thanks a lot Roman, it all worked out! :) My name is "RAVI".
Yay! :-)
 

Good afternoon, gentlemen.

I need your advice on the following question:

I am writing an EA and I ran into a problem. My Expert Advisor should perform calculations every minute for a given number of minutes. After that, all data should be reset and calculations should be performed from the beginning.

And so the cycle by cycle. The time cycle is from 5 to 60 minutes. Please advise me how to describe this correctly in the code?

For now the loop of 5 minutes looks like this:

if ((TimeMinute(TimeCurrent()))==time1)

Price20=koef_10;

if ((TimeMinute(TimeCurrent()))==time2)

Price20=koef_10;

if ((TimeMinute(TimeCurrent()))==time3)

Price20=koef_10;

if ((TimeMinute(TimeCurrent()))==time4)

Price20=koef_10;

if ((TimeMinute(TimeCurrent()))==time5)

Price20=koef_10;


I would be grateful for any help.

 
Afternoon! What's wrong?
вершина =Low[iHighest( NULL, int timeframe, MODE_HIGH, i, start ) 

'MODE_HIGH' - variable expected C:\Program Files (x86)\FXstart - MetaTrader\experts\indicators\policyclics.mq4 (46, 52)

MODE_HIGH is the identifier taken from the corresponding table è....

 
why do you need an int in front of the timeframe ?
 
Thank you, it's a run!!!
 
Yes, that's right, THANK YOU!!!
 
extralifes:

Good afternoon, gentlemen.

I need your advice on this question:

I am writing an EA and I ran into a problem. My Expert Advisor should perform calculations every minute for a given number of minutes. After that, all data should be reset and calculations should be performed from the beginning.

And so the cycle by cycle. The time cycle is from 5 to 60 minutes. Please advise me how to describe this correctly in the code?

For now the loop of 5 minutes looks like this:

I would be grateful for any help.


I propose this solution:

//+------------------------------------------------------------------+
//|                                             Circle X Minutes.mq4 |
//|                                             Copyright 2012, Roll |
//|                                https://www.mql5.com/ru/users/roll |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, Roll"
#property link      "https://www.mql5.com/ru/users/roll"
extern int minut=5;datetime t;int k;
//+------------------------------------------------------------------+
int init(){t=0;k=minut;return(0);}int deinit(){return(0);}
//+------------------------------------------------------------------+
int start(){if(k>60)k=0;if(k==0)return(0);F1();if(k>0){if(F()==true)k--;}return(0);}
void F1(){if(t==0&&TimeSeconds(TimeCurrent())>=0)
  {Alert("цикл из ", minut," минут - УСТАНОВКА: время сервера - ",TimeToStr(TimeCurrent(),
   TIME_SECONDS));t=TimeCurrent();}}
bool F(){if(t!=0&&t<TimeCurrent()&&TimeSeconds(TimeCurrent())>=0)
  {Alert("цикл из ", minut," минут - ПРОВЕРКА: время сервера - ",TimeToStr(TimeCurrent(),
   TIME_SECONDS));t=TimeCurrent()+59;return(true);}} 
 
Roll:


I suggest this solution:

It's not working. Here's a screenshot:

The timing seems to be confused + after the end of the first cycle, a new one has not started.

 

I can't figure out how to calculate the lifetime from pattern formation to 0 bar.

If the pattern exists and there is no hard reference to price and time.

 

Good afternoon, gentlemen.

I need your advice on this question: How to write in the code of the Expert Advisor so that from the balance it was taking a predetermined amount, say our balance = $80 every time the balance = $80 + $10 Expert Advisor from the biggest minus took $5, reducing the lot and closing these 10 $ and a new report started at $85

Reason: