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

 
Reshetov:
No way. Every kitchen has its quotidian.


And there's nowhere to get more or less real charts?

Sad...

 
Abzasc:

accuracy of indicator readings...
kopeck, for the selected dc, all relevant indicator readings will be absolutely fair.
 
Techno:
kopeck, for the selected dc, all relevant indicator readings will be absolutely fair.

if only...
 
Abzasc:

if...
what if? Indicators are built with absolute accuracy based on current readings. Trading is based on these same readings, what else is unclear?
 
Techno:
what if? Indicators are built with absolute accuracy based on current readings. Trading is based on these same readings, what else is unclear here ?

"with absolute accuracy based on current readings".

Let's be clear - unreliable readings. And if we do not work on average prices, the spread is very large.

Just compare two candlestick charts on, say, M15. For example with these

iMoningStar https://www.mql5.com/ru/code/9520

i3Indians https://www.mql5.com/ru/code/9695

iDragon https://www.mql5.com/ru/code/9617

And then tell me - how would an EA work on them?

 
Gun:

How do I find the opening price of the last order?

I did it like this, but when I close a series of orders by close, the price of the first order in the series comes out, but not the last...

Is there any other way to determine the last order?


//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 19.02.2008                                                     |
//|  Описание : Возвращает цену открытия последней открытой позиций.           |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (""   - любой символ,                   |
//|                                     NULL - текущий символ)                 |
//|    op - операция                   (-1   - любая позиция)                  |
//|    mn - MagicNumber                (-1   - любой магик)                    |
//+----------------------------------------------------------------------------+
double PriceOpenLastPos(string sy="", int op=-1, int mn=-1) {
  datetime t;
  double   r=0;
  int      i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (t<OrderOpenTime()) {
                t=OrderOpenTime();
                r=OrderOpenPrice();
              }
            }
          }
        }
      }
    }
  }
  return(r);
}
//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 28.11.2006                                                     |
//|  Описание : Возвращает цену установки последнего ордера или 0.             |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (""   - любой символ,                   |
//|                                     NULL - текущий символ)                 |
//|    op - операция                   (-1   - любая позиция)                  |
//|    mn - MagicNumber                (-1   - любой магик)                    |
//+----------------------------------------------------------------------------+
double GetOrderOpenPrice(string sy="", int op=-1, int mn=-1) {
  datetime t;
  double   r=0;
  int      i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()>1 && OrderType()<6) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (t<OrderOpenTime()) {
                t=OrderOpenTime();
                r=OrderOpenPrice();
              }
            }
          }
        }
      }
    }
  }
  return(r);
}
That's how you can...
 
there are no absolutely reliable ones. It's like the weather, in the same city may differ slightly in different parts. A profitable EA will work fine on either variant. What am I supposed to see on these charts? Charts are like charts.
 
Techno:
What was I supposed to see on these charts?
The difference in prices. As a consequence, different, to the contrary, indicator results...
 

Hi all. Is it possible to configure the terminal to display data on the chart only during the American trading session (from 17:30 to 24:00 Moscow timeframe)?

Thank you

 

Good afternoon, continuing to get to grips with coding, took the example EA from the tutorial section article, replaced the code from the example:

   // Торговые критерии
   MA_1_t=iMA(NULL,0,Period_MA_1,0,MODE_LWMA,PRICE_TYPICAL,0); // МА_1
   MA_2_t=iMA(NULL,0,Period_MA_2,0,MODE_LWMA,PRICE_TYPICAL,0); // МА_2

   if (MA_1_t > MA_2_t + Rastvor*Point)         // Если разница между
     {                                          // ..МА 1 и 2 большая
      Opn_B=true;                               // Критерий откр. Buy
      Cls_S=true;                               // Критерий закр. Sell
     }
   if (MA_1_t < MA_2_t - Rastvor*Point)         // Если разница между
     {                                          // ..МА 1 и 2 большая
      Opn_S=true;                               // Критерий откр. Sell
      Cls_B=true;                               // Критерий закр. Buy
     }

To an arbitrary one for training purposes:

   // Торговые критерии

   double MA_1[];

   MA_1[0]=iMA(NULL,0,Period_MA,0,MODE_EMA,PRICE_CLOSE,0);
   
   if (MA_1[1] < MA_1[0])
     {                                          // ..МА последнего бара выше предыдущего
      Opn_B=true;                               // Критерий откр. Buy
      Cls_S=true;                               // Критерий закр. Sell
     }
   if (MA_1[1] > MA_1[0])
     {                                          // ..МА последнего бара ниже предыдущего
      Opn_S=true;                               // Критерий откр. Sell
      Cls_B=true;                               // Критерий закр. Buy
     }
The trades don't show up, could you please tell me what's the reason, how to fix the code.