Список форумов AmiSite.ru AmiSite.ru
Форум по Ами
 FAQ  •  Поиск  •  Пользователи  •  Группы   •  Регистрация  •  Профиль  •  Войти и проверить личные сообщения  •  Вход
 Xprofuter рисует будующее! Следующая тема
Предыдущая тема
Начать новую тему  Ответить на тему
Автор Сообщение
Vladimir



Зарегистрирован: 30.10.2008
Сообщения: 62

СообщениеДобавлено: Пн Мар 23, 2009 3:25 am Ответить с цитатой Вернуться к началу

Кто нибудь знает что-то про Xprofuter он рисует будующее.
Цитата:
индикатор XProfuter, который наглядно, с достоверностью в 92%, указывает дальнейшее движение рынка, то есть визуально на графике прочерчивает на 12 баров вперёд

http://www.dollaromania.com/forex/xprofuter.htm

вот код из МТ4, сможит кто-нибудь в Ами перевести?
Код:
/*
 * Filename:    XprofuterDD.mq4
 */

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1  Gold
#property indicator_color2  White
#property indicator_color3  DodgerBlue

extern int per        = 14;  // Period for signal
extern int drawShift  = 14;  // Forward shift
extern int useMA      = 0;   // 1 = use MA
extern int maPeriod   = 34;  // Moving average period
extern int useSignal2 = 0;   // Show current close - open shifted forward

// Buffers for signals
double ExtMapBuffer[];
double maBuffer[];
double closeBuffer[];
   
int init() {
   string title = "XProfuter(" + per + ")";
   
   // Signal and MA are normal lines
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, ExtMapBuffer);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(1, maBuffer);
   
   // Signal2 is a dotted line
   SetIndexStyle(2, DRAW_LINE, 2, 1);
   SetIndexBuffer(2, closeBuffer);
   
   // Shift everything forward
   SetIndexShift(0, drawShift);
   SetIndexShift(1, drawShift);
   SetIndexShift(2, drawShift);
   
   // Titles for each line
   SetIndexLabel(0, "Signal(" + per + ")");
   SetIndexLabel(1, "MA(" + maPeriod + ")");
   SetIndexLabel(2, "Signal2(" + per + ")");
   
   if(useMA == 1) {
      title = title + " MA(" + maPeriod + ")";
   }
   
   IndicatorShortName(title);
   return(0);
}

int start() {
   int    counted_bars = IndicatorCounted();
   int    shift, i, imp, limit, lim;

   // This is to make sure we go back and update bars that have already been drawn.
   // This was missing in the original release. If it's not done the live signal line
   // will be the same as Signal2.
   if(counted_bars > per) {
      limit = Bars - counted_bars + per;
   } else {
      limit = Bars - 1;
   }

   // Loop through and calculate the signals. Everytime this runs we recalculate the
   // current and all future signals. The future is not set :)
   for(shift = limit; shift >= 0; shift--) {
      imp = 0;

      // This isn't really needed but makes sure we don't look for future,
      // non-existant open and close points. It's just proper coding. You never know
      // how a program will handle variables that don't exist. MT4 currently sets them
      // to zero but you don't know if that will change.
      if(shift - per <0>= lim; i--) {
         imp = imp + (Close[i] - Open[i]) / Point;
      }

      ExtMapBuffer[shift] = imp;
     
      // If Signal2 is being used set it.
      if(useSignal2 == 1) {
         closeBuffer[i] = (Close[i] - Open[i]) / Point;
      }
   }
   
   // If we're using the MA calculate it.
   if(useMA == 1) {
      for(shift = Bars - counted_bars - 1; shift >= 0; shift--) {
         if(shift < Bars - maPeriod && shift < Bars - per) {
            maBuffer[shift] = iMAOnArray(ExtMapBuffer, 0, maPeriod, 0, MODE_SMA, shift);
         }
      }
   }
   
   return(0);
}
Посмотреть профиль Отправить личное сообщение
Vladimir



Зарегистрирован: 30.10.2008
Сообщения: 62

СообщениеДобавлено: Пн Мар 23, 2009 3:44 am Ответить с цитатой Вернуться к началу

Вот второй код:

Код:
/*
 * Filename:    XprofuterOverlay.mq4
 */

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Magenta

extern int per    = 14;  // Period for signal
extern int update = 1;   // 1 = continuously update, 0 = freeze

// Buffers for signals
double drawBuffer[];
   
int init() {
   string title = "XProfuter(" + per + ")";
   
   SetIndexStyle(0, DRAW_LINE, 0, 2);
   SetIndexBuffer(0, drawBuffer);
   
   // Shift everything forward
   SetIndexShift(0, per);
   
   // Titles for each line
   SetIndexLabel(0, "Signal(" + per + ")");
   
   IndicatorShortName(title);
   return(0);
}

int start() {
   int    counted_bars = IndicatorCounted();
   int    shift, i, limit, lim;
   double prevSignal = -1, barClose = -1, imp;

   if(update == 1) {
      imp = iCustom(NULL, 0, "XprofuterDD", per, 0, 0, 0, 0, 0, per) * Point;

      barClose = Close[0] - iCustom(NULL, 0, "XprofuterDD", per, 0, per) * Point;

      // Loop through and calculate the signals. Everytime this runs we recalculate the
      // current and all future signals. The future is not set :)
      for(shift = per - 1; shift >= 0; shift--) {
         imp = iCustom(NULL, 0, "XprofuterDD", per, 0, shift) * Point;
         
         drawBuffer[shift] = barClose + imp;
      }
   }
     
   return(0);
}
Посмотреть профиль Отправить личное сообщение
kosbar



Зарегистрирован: 17.03.2009
Сообщения: 356

СообщениеДобавлено: Пт Мар 27, 2009 11:01 pm Ответить с цитатой Вернуться к началу

Vladimir писал(а):
Кто нибудь знает что-то про Xprofuter он рисует будующее. Индикатор XProfuter, который наглядно, с достоверностью в 92%, указывает дальнейшее движение рынка, то есть визуально на графике прочерчивает на 12 баров вперёд

Нафиг рисовать, если индюк даёт 92% точности, то это просто мега система! Бери торгуй! Хотя и возможно только для форекса, там больше каналов и пр. повторений уровней.
Вот если бы кто перевёл на слова этот алгоритм, я бы попробовал перевести в Ами, хотя, если будут циклы, придётся потужится...
Посмотреть профиль Отправить личное сообщение ICQ Number
Показать сообщения:      
Начать новую тему  Ответить на тему


 Перейти:   



Следующая тема
Предыдущая тема
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Вы не можете вкладывать файлы
Вы не можете скачивать файлы


Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme :: Часовой пояс: GMT + 3

File Attachment © by Meik Sievertsen