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

 
artmedia70:
If you have experience, look here and figure it out. You will find a lot for yourself, and then you can optimise it for yourself.

thanks

It's a very large forum, you can't find it all at once.

 

what the lines mean: 1) if (Volume [0]>1) return;

2) if (Open [1]>ma) ; ?

thank you!

 
okvseok:

what the lines mean: 1) if (Volume [0]>1) return;

2) if (Open [1]>ma) ; ?

thank you!


1) If volume on zero candle is more than 1, then return.

2) If the opening price of the first candle is higher than the value in the variable ma. The construct

 if (Open [1]>ma) ;

has no right to exist, since nothing follows from the condition. It is not clear to the processor what it will have to do, if the condition is fulfilled or not.

 
okvseok:

what the lines mean: 1) if (Volume [0]>1) return;

2) if (Open [1]>ma) ; ?

thank you!

Usually condition 1 is applied to determine if a new bar has opened. In your example if current bar volume >1 then exit the program and the program will not work at all. In the second one, after if (...) but before ; you need to describe some action.
 
drknn:
That's a bit of a misnomer. The question is how to prescribe in an EA, not in an indicator. But thanks anyway, although the question remains open.

 
kwadrad:
That's not quite the point. The question is how to write it in an EA, not in an indicator. But thanks anyway, although the question remains open.

You asked for the code - I gave you the code.

This is also doable in an EA. You need to declare an array, fill it with RSI values, and then you can process this array however you want. Including the iMAOnArray() function

 
drknn:

You asked for the code - I gave you the code.

This is also doable in an EA. You need to declare an array, fill it with RSI values, and then you can process this array however you want. Including using the iMAOnArray() function

It is the subtleties in declaring and filling with array values that cause difficulties, i.e. they don't work on the chart. Maybe I'm filling the array from the wrong side or my spelling is out of order. It works in the indicator. It is not working in the EA.
 
kwadrad:
It is the subtleties in declaring and filling the array with values that cause difficulties, i.e. they don't work in the graph. Maybe I'm filling the array on the wrong side or the spelling is crooked. It works in the indicator. It is not in an EA.
Have you read articles on this subject?
Code Transfer of an Indicator to Code of an Expert Advisor. Construction of an indicator.
Transferring of the indicator code to the Expert Advisor code. General schemes of construction of an Expert Advisor and indicator functions
 
kwadrad:
It is the subtleties in declaring and filling the array with values that cause difficulties, i.e. they don't work in the graph. Maybe I'm filling the array on the wrong side or the spelling is crooked. It works in the indicator. It is not working in the EA.
// перед блоком инициализации советника пишем:
  extern int RazmerMassiva=10;// размер будущего массива
  double Massiv[1];//Перед блоком инициализации объявляем массив
  // в старте советника пишем:
  if(ArrayResize(Massiv,RazmerMassiva)==(-1)){
    Print("Ошибка № ",GetLastError()," при изменении размерности массива - размерность не изменена");
  }
  else{// заполняем массив значениями
    for(int i=0;i<RazmerMassiva;i++){
      Massiv[i]=iRSI(/* Сюда вставить нужные параметры */);
      // сразу проверяем что у нас в массив внесено
      Print("Massiv[",i,"] = ",Massiv[i]);
    }
  }
  // далее точно так же организзуем цикл, заполняющий другой массив значениями, возвращаемыми
  // функцией iMAOnArray() и точно так же сразу принтуем результат. Если принты показывают
  //биллеберду, то становится понятно в каком направлении искать. Без принтов Вы не разберётесь,
  //как работать с iMAOnArray()
 
What the fuck is this: 2012.07.20 07:15:00 '*****': order sell 0.10 EURUSD opening at 1.2256 sl: 0.0000 tp: 0.0000 failed [Trade context is busy], but for buy orders not busy?

And now, the opposite: 2012.07.20 07:51:13 '*****': order buy 0.10 EURUSD opening at 1.2258 sl: 0.0000 tp: 0.0000 failed [Trade context is busy]

What could this be about?