Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 765

 
Apparently, no one can help me here! Everyone is just pointing at a textbook. it's like a student asking a teacher to help him learn a topic he does not understand and the teacher tells him to look in a book. it makes me wonder why he needs a teacher, this forum and this topic!!!
 
logut:
Apparently no one here can help me! Everyone is just pointing at a textbook. This is tantamount to a pupil asking his teacher to help him learn a topic he does not understand and the teacher telling him to look in a book.

The branch is very good and helpful. There are many kind people here. Tell me your question again.

 
ikatsko:
There are two MT4 terminals on the same laptop: one with 4 decimal places and one with 5 decimal places. In the same time the traffic on the first one is 105/0 kb, on the second one 3450/0 kb. First one is CPU intensive by 6%, second one by 39%. What is the problem? Is this even a norm?
In six years you could have understood that the quotes with an extra sign need more resources. Unless of course they come more often and vary less.
 
Vinin:
You've understood for six years that you need more resources for a quote with an extra digit. Unless, of course, they come more often and vary less.

Thank you. I've known you for a long time too.

About the traffic, of course, the explanation is accepted and "in six years", in principle, I get it.

But what can be said about the CPU load? Doesn't the communication between terminal and internet (in order to provide info/traffic/quotes) have such an influence on CPU load by the terminal? (remind me, 4 digits load 6%, 5 digits load 39%. To clarify in advance, Samsung X15 laptop, 1400 MHz processor)

 
ikatsko:

The branch is very good and helpful. There are many kind people here. Repeat your question to me.

I need double lots = 0.01;
input int takeprofit = 100;
input int stoploss = 100;
extern int magic = 123;
//----------------+
int start()
{




//---------------+


int ticket=OrderSend(Symbol(),OP_BUYLIMIT,lots,Ask,3,Ask +stoploss* Point, Ask + takeprofit* Point,NULL,123,120,CLR_NONE);






return(0);

}

I need some tips on how to write a tip with a pause I'm new to this business, I've been puzzling over it for a month, I have a sketch
 
ikatsko:

Thank you. I've known you for a long time too.

About the traffic, of course, the explanation is accepted and "in six years", in principle, I get it.

And what can be said about the CPU load? Doesn't the communication between terminal and Internet (in order to provide info/traffic/quotes) have such an influence on CPU load by the terminal? (remember, 4 digits load 6%, 5 digits load 39%. To clarify in advance, Samsung X15 laptop, 1400 MHz processor)

Looks like just indicators are consuming resources. Calculations became more. Although - well, I don't really need them, but they're demanding.
 
logut:
I need input double lots = 0.01;
input int takeprofit = 100;
input int stoploss = 100;
extern int magic = 123;
//----------------+
int start()
{




//---------------+


int ticket=OrderSend(Symbol(),OP_BUYLIMIT,lots,Ask,3,Ask +stoploss* Point, Ask + takeprofit* Point,NULL,123,120,CLR_NONE);






return(0);

}

I need some tips on how to write a tip with a pending order. I am new to this business and have been puzzling over it for a month.

You were given a tip on the documentation.

The trailing stop triggers when it reaches a certain level (the deviation from the current price). And you're trying to use the current one. You can search for grid or grid tools.

 

Hello, here's a question: is the prev_calculated parameter always passed correctly in indicators?

Here is a simple example: (here Extern Int BarsAtOnce = 3)

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   //bool success;
   int tocalc; // сколько должно быть посчитано
   int i;
//---

   if (ArraySetAsSeries(time,true) & ArraySetAsSeries(open,true) & ArraySetAsSeries(high,true) & ArraySetAsSeries(low,true) & ArraySetAsSeries(close,true))
   {
      tocalc=prev_calculated+BarsAtOnce;
      if (tocalc>rates_total) tocalc=rates_total;
      
      Print("rates_total "+IntegerToString(rates_total)+" prev_calculated "+IntegerToString(prev_calculated)+" tocalc "+IntegerToString(tocalc));
      
      for (i=prev_calculated; i<tocalc; i++)
      {
         Label1Buffer[i]=open[i];
      }
      return(tocalc);
   }
   else
   {
      Alert("Fail");
      return(0);
   }
  }

Result:

2014.11.06 20:35:07.984 Analysis EURUSD,M1: initialized
2014.11.06 20:35:08.000 Analysis EURUSD,M1: rates_total 65013 prev_calculated 0 tocalc 3
2014.11.06 20:35:08.015 Analysis EURUSD,M1: rates_total 65013 prev_calculated 65013 tocalc 65013

I.e. the control system considers that the buffer has been fully counted?

Необходимо отметить связь между значением, возвращаемым функцией OnCalculate() и вторым входным параметром prev_calculated. Параметр prev_calculated при вызове функции содержит значение, которое вернула функция OnCalculate() на предыдущем вызове. Это позволяет реализовать экономные алгоритмы расчета пользовательского индикатора с тем, чтобы избежать повторных расчетов для тех баров, которые не изменились с предыдущего запуска этой функции.

Для этого обычно достаточно вернуть значение параметра rates_total, которое содержит количество баров при текущем вызове функции.

The task is to make a "gradual" calculation of the indicator, so as not to slow down the application at the moment of its start.

 
Awwl:

Hello, here's a question: is the prev_calculated parameter always passed correctly in indicators?

Here is a simple example: (here Extern Int BarsAtOnce = 3)

Result:

I.e. the control system considers that the buffer has been fully counted?

The task is to make a "gradual" calculation of the indicator, so as not to slow down the application at the moment of its start.

Are you sure thatArraySetAsSeries()returns what you need. Or you think that you need it. Maybe it doesn't even come to calculation

 
Vinin:
Are you sure thatArraySetAsSeries()returns what you need. Or maybe you think that's what you need. Maybe it doesn't even come to calculation.

Calculation happens, Alert is never triggered, all calls to ArraySetAsSeries() return True. Only last bars in BarsAtOnce number are displayed, and further, after first return from OnCalculate function, terminal thinks that all bars are calculated (according to log).

The solution is simple - to create own variable similar to prev_calculated, but I wonder why the regular one doesn't work?

The effect is observed on 711 and 745 versions (no others available)

Reason: