Добрый день !А можно сделать расчет по хаю и лоу ,а не по телу свечи ?
Изменил , но показывает только одни бары , зеленые , а красных нет. Менял настройки АТR , тоже самое показывает .
Файлы:
5rqabh_uxtlqa_f567n.png
12 kb
mdhb0c_v5l0ng_x569m.png
54 kb
Auma #:
Изменил , но показывает только одни бары , зеленые , а красных нет. Менял настройки АТR , тоже самое показывает .
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- Установка массивов буферов как таймсерий ArraySetAsSeries(open,true); ArraySetAsSeries(high,true); ArraySetAsSeries(low,true); ArraySetAsSeries(close,true); ArraySetAsSeries(time,true); //--- Проверка количества доступных баров if(rates_total<period_max) return 0; //--- Проверка и расчёт количества просчитываемых баров int limit=rates_total-prev_calculated; if(limit>1) { limit=rates_total-1; ArrayInitialize(BufferUP,EMPTY_VALUE); ArrayInitialize(BufferDN,EMPTY_VALUE); ArrayInitialize(BufferCandleOpen,EMPTY_VALUE); ArrayInitialize(BufferCandleHigh,EMPTY_VALUE); ArrayInitialize(BufferCandleLow,EMPTY_VALUE); ArrayInitialize(BufferCandleClose,EMPTY_VALUE); ArrayInitialize(BufferColors,2); ArrayInitialize(BufferATR,0); } //--- Подготовка данных int count=(limit>1 ? rates_total : 1),copied=0; copied=CopyBuffer(handle_atr,MAIN_LINE,0,count,BufferATR); if(copied!=count) return 0; //--- Расчёт индикатора static datetime last_time=0; for(int i=limit; i>=0 && !IsStopped(); i--) { BufferCandleOpen[i]=BufferCandleHigh[i]=BufferCandleLow[i]=BufferCandleClose[i]=EMPTY_VALUE; BufferColors[i]=2; double x=(InpMethod==IND_METHOD_ATR ? multiplier*BufferATR[i]/Point() : multiplier); double y=(high[i]-low[i])/Point(); double c=(close[i]-open[i])/Point(); if(y>x && c>=0 && InpUseLong) { BufferUP[i]=low[i]; BufferCandleOpen[i]=open[i]; BufferCandleHigh[i]=high[i]; BufferCandleLow[i]=low[i]; BufferCandleClose[i]=close[i]; BufferColors[i]=0; if(i==0 && last_time!=time[0]) { string message=Symbol()+", "+TimeframeToString(Period())+": Thrust Bullish Bar at "+TimeToString(TimeCurrent()); if(InpUseAlerts) Alert(message); if(InpSendMail && TerminalInfoInteger(TERMINAL_EMAIL_ENABLED)) SendMail("Thrust Bar Signal",message); if(InpSendPush && TerminalInfoInteger(TERMINAL_NOTIFICATIONS_ENABLED)) SendNotification(message); last_time=time[0]; } } if(y>x && c<0 && InpUseShort) { BufferDN[i]=high[i]; BufferCandleOpen[i]=open[i]; BufferCandleHigh[i]=high[i]; BufferCandleLow[i]=low[i]; BufferCandleClose[i]=close[i]; BufferColors[i]=1; if(i==0 && last_time!=time[0]) { string message=Symbol()+", "+TimeframeToString(Period())+": Thrust Bearish Bar at "+TimeToString(TimeCurrent()); if(InpUseAlerts) Alert(message); if(InpSendMail && TerminalInfoInteger(TERMINAL_EMAIL_ENABLED)) SendMail("Thrust Bar Signal",message); if(InpSendPush && TerminalInfoInteger(TERMINAL_NOTIFICATIONS_ENABLED)) SendNotification(message); last_time=time[0]; } } } //--- return value of prev_calculated for next call return(rates_total); }
Вроде получилось , никогда не менял и не писал индикаторы , с десятого раза получилось .Может его добавить его сюда, кому пригодится тоже ? Спасибо за внимание !
Файлы:
Thrust_Bar1.mq5
18 kb
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Thrust_Bar:
Индикатор Thrust Bar
Автор: Scriptor