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

 
chief2000 писал(а) >>


It's not 1 hour but 1 minute, the size of such a file is usually around 160 MBytes (10 year history) - maybe it has to do with disk space?





Thanks now I see! I downloaded the history because the tester wouldn't start without it.
 
Please help.
It does not close the positions. Comm shows both 2 and -2 in int GetTradeSignal_Strategija_1 . I tried and Ts Kim's functions. I do not know what is wrong.
Files:
pomogite.mq4  21 kb
 
Here is the ManagePositions_Strategija_1 algorithm.
 
Please help.
Why when I test my Expert Advisor I get this error:
invalid price 1.50615000 for OrderSend function
All quotes in the archive are four-digit, but the error message displays an eight-digit price?
 
LeRus >>:
Помогите пожалуйста.
Почему когда тестирую советник выдает такую ошибку:
invalid price 1.50615000 for OrderSend function
А архиве все котировки четырехзначные а ошибку выдает с восмизначной ценой??


NormalizeDouble(Price,Digit);

 
LeRus >>:
Помогите пожалуйста.
Почему когда тестирую советник выдает такую ошибку:
invalid price 1.50615000 for OrderSend function
А архиве все котировки четырехзначные а ошибку выдает с восмизначной ценой??



It is necessary to use:

NormalizeDouble(ПЕРЕМЕННАЯ, Digits)
 
Now everything is working. Thank you very much.
 
Hello, I have an indicator that I made to measure price movements over a certain time frame:
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1  White
#property indicator_color2  Blue

extern int MAPeriod = 14;

// buffers
double V[];           // Собственно значения
double SmoothedValues[];

int DigitsUsed = 8;


int init()
{
   // ассоциируем буферы
   SetIndexBuffer(0, V);
   SetIndexBuffer(1, SmoothedValues);   
   // задаем настройки для буферов
   SetIndexStyle(0, DRAW_LINE);     // Основной сигнал будет сплошной линией
   SetIndexStyle(1, DRAW_LINE);     // Основной сигнал будет сплошной линией   
   IndicatorDigits(DigitsUsed);

   return(0);
}

int start()
{
   int toCount = Bars - IndicatorCounted();  
   double P1,P2,P3;
   // Считаем значения
   for (int i = toCount - 1; i >=0; i--)
   {
      if(Open[i]>Close[i])
        {
         P1=High[i]-Low[i];
         P2=High[i]-Open[i];
         P3=Close[i]-Low[i];
        }
      if(Close[i]>Open[i])
        {
         P1=High[i]-Low[i];
         P2=High[i]-Close[i];
         P3=Open[i]-Low[i];
        }
      
      V[i] = P1+P2+P3;
   }
      
   // Считаем сглаженные значения
   for (i = toCount - 1; i >=0; i--)
   {
      SmoothedValues[i] = NormalizeDouble(iMAOnArray(V, 0, MAPeriod, 0, MODE_SMA, i), DigitsUsed);
   }
      
   
   return(0);
}
Where the mistake, I need this indicator to calculate the bar on the minutes, ie throw it on the 1 H and it adds all the minutes of the calculated indicator:
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1  White

// buffers
double V[];           // Собственно значения

int init()
{
   // ассоциируем буферы
   SetIndexBuffer(0, V);
   // задаем настройки для буферов
   SetIndexStyle(0, DRAW_HISTOGRAM);     // Основной сигнал будет сплошной линией  
   return(0);
}

int start()
{
   int toCount = Bars - IndicatorCounted(); 
   // Считаем значения
   for (int i = toCount - 1; i >=0; i--)
    {
     double t=0; //обнуляем счетчик
     int Minut1 = iBarShift(NULL,1,iTime(NULL,Period(),i),false);//Сколько минут прошло в баре
     int Minut0 = iBarShift(NULL,1,iTime(NULL,1,i),false);//нулевая минута в баре
     for(int k=Minut0; k<=Minut1;k++)
      {
       double K=iCustom(NULL,1,"V",14,0,k); //Сам индикатор
       t=t+K;
      } 
     V[i]=t; //забиваем в массив
    }   
   return(0);
}
Regards Alexander
 
Guys, help dummies, in the tutorial and on the forum to make it very clear - have not found it.

I modify the EA for a specific timeframe M1 and M5, there is a simple condition:

double m1=iMA(NULL,0,period1,0,1,0,0);
double m2=iMA(NULL,0,period2,0,1,0,0);
then if(m1>m2) {okbuy=1;} blah blah blah

No questions here.
But I need another MA condition (like above) but from a higher specific timeframe D1 (and the EA will work on M1)
How to request in the current timeframe and in the current pair, the indicator data from the current pair - but another timeframe? So that I can then use this data to make a condition.
I would be especially grateful, if you could suggest how to use older timeframes and other indicators in the current timeframe by analogy. Thanks
 
alfo13 >>:
Ребят, помогите чайнигу, в учебнике и на форуме чтобы сильно понятно - так и не нашел.

Переделываю советник под конкретный таймфрейм M1 и M5, там присутствует простое условие:

double m1=iMA(NULL,0,period1,0,1,0,0);
double m2=iMA(NULL,0,period2,0,1,0,0);
затем if(m1>m2) {okbuy=1;} бла бла бла

Здесь вопросов нет.
Но мне надо чтобы было еще одно условие по MA (по типу вышеописанного) но из старшего конкретного таймфрейма D1 (а советник будет работать на M1)
Как запросить в текущем таймфрейме и в текущей паре, данные индикатора из текущей пары - но другого таймфрема? Чтобы потом можно было по этим данным сделать условие.
Особо буду признателен, если еще подскажете как по аналогии использовать старшие таймфреймы и других индикаторов в текущем периоде. Спасибо


Where period1 or period2 insert PERIOD_D1