Пересечение двух средних. - страница 2

 
valex >>:
Я такой же программист как и ты.Но я хоть не умничаю и не хамлю на форумах.

Извини пожа..

Я просто вначале думал, что ты в правду учишься писать программы.

С чужих заготовок можна, и может быть даже нужно, начинать.

Потому и ответил, типа - как избавится от ошибок..

Но ошибок тут больше...

и если хотел звук, и знаеш какой оператор его породит, зачем блееш?

;)

Кто кому хамил?

И главный вопрос - зачем?

 

попробуй так


extern int iMAFastPeriod = 1;
extern int iMAFastShift = 0;
extern int iMAFastMetod = 0;
extern int iMAFastPrice = 0;
extern int iMASlowPeriod = 2;
extern int iMASlowShift = 0;
extern int iMASlowMetod = 0;
extern int iMASlowPrice = 0;

//+------------------------------------------------------------------+
int init() {
  return(0);
}

//+------------------------------------------------------------------+
int deinit() {
  return(0);
}

//+------------------------------------------------------------------+
int start() {
  static datetime LastTimeBar = D'01.01.2004 00:00:00';
  if (LastTimeBar < Time[0]) {
    LastTimeBar = Time[0];
    double DeltaMA = iMA(Symbol(), 0, iMAFastPeriod, iMAFastShift, iMAFastMetod, iMAFastPrice, 1) - 
                   iMA(Symbol(), 0, iMASlowPeriod, iMASlowShift, iMASlowMetod, iMASlowPrice, 1);
double DeltaMA_Old = iMA(Symbol(), 0, iMAFastPeriod, iMAFastShift, iMAFastMetod, iMAFastPrice, 2) - 
                   iMA(Symbol(), 0, iMASlowPeriod, iMASlowShift, iMASlowMetod, iMASlowPrice, 2);

    if (DeltaMA > 0 && DeltaMA_Old < 0) 
      {
      Alert("UP");
      PlaySound("alert.wav"); 
      }
    if ((DeltaMA < 0 && DeltaMA_Old > 0) 
      {
      Alert("DOWN");
      PlaySound("alert.wav");
      }
   
  }
  return(0);
}
 
Snubist >>:

попробуй так


уже лучше ;)

 
avatara >>:

уже лучше ;)

Что бы остался один звук убери

Alert("UP");
Alert("DOWN");

 

В продолжение темы:

EURUSD M15


M30 хуже пока


Файлы: