Ускорить индюка АМА

MQL5 Indicatori Script

Specifiche

//+------------------------------------------------------------------+
//|                                                          AMA.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, by konKop,wellx"
#property link      "http://www.metaquotes.net"
 
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Sienna
#property indicator_color2 DeepSkyBlue
#property indicator_color3 Gold
 
//---- input parameters
extern int       periodAMA=9;
extern int       nfast=2;
extern int       nslow=30;
extern double    G=2.0;
extern double    dK=2.0; 
 
//---- buffers
double kAMAbuffer[];
double kAMAupsig[];
double kAMAdownsig[];
 
//+------------------------------------------------------------------+
 
int    cbars=0, prevbars=0, prevtime=0;
 
double slowSC,fastSC;
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,0,2);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,159);
   SetIndexStyle(2,DRAW_ARROW);
   SetIndexArrow(2,159);
   //SetIndexDrawBegin(0,nslow+nfast);
   SetIndexBuffer(0,kAMAbuffer);
   SetIndexBuffer(1,kAMAupsig);
   SetIndexBuffer(2,kAMAdownsig);
   
   
   IndicatorDigits(4);
   
   //slowSC=0.064516;
   //fastSC=0.2;
   //cbars=IndicatorCounted();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i,pos=0;
   double noise=0.000000001,AMA,AMA0,signal,ER;
   double dSC,ERSC,SSC,ddK;
   
   if (prevbars==Bars) return(0);
    
//---- TODO: add your code here
   slowSC=(2.0 /(nslow+1));
   fastSC=(2.0 /(nfast+1));
   cbars=IndicatorCounted();
   if (Bars<=(periodAMA+2)) return(0);
//---- check for possible errors
   if (cbars<0) return(-1);
//---- last counted bar will be recounted
   if (cbars>0) cbars--;
   pos=Bars-periodAMA-2;
   AMA0=Close[pos+1];
   while (pos>=0)
     {
      if(pos==Bars-periodAMA-2) AMA0=Close[pos+1];
      signal=MathAbs(Close[pos]-Close[pos+periodAMA]);
      noise=0.000000001;
      for(i=0;i<periodAMA;i++)
       {
        noise=noise+MathAbs(Close[pos+i]-Close[pos+i+1]);
       }
      ER =signal/noise;
      dSC=(fastSC-slowSC);
      ERSC=ER*dSC;
      SSC=ERSC+slowSC;
      AMA=AMA0+(MathPow(SSC,G)*(Close[pos]-AMA0));
      kAMAbuffer[pos]=AMA;
 
      ddK=(AMA-AMA0);
      if ((MathAbs(ddK)) > (dK*Point) && (ddK > 0)) kAMAupsig[pos] =AMA; else kAMAupsig[pos]=0;
      if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0; 
 
     
      AMA0=AMA;
      pos--;
     }
//----
   prevbars=Bars;
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                          AMA.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"

#property indicator_chart_window
#property indicator_buffers 3

#property indicator_color1 Sienna
#property indicator_type1   DRAW_LINE
#property indicator_width1  2

#property indicator_color2 DeepSkyBlue
#property indicator_type2   DRAW_ARROW

#property indicator_color3 Gold
#property indicator_type3   DRAW_ARROW




//---- input parameters
input int periodAMA=9;
input int nfast=3;
input int nslow=13;
input double G=2.0;
input double dK=2.0;

//---- buffers
double kAMAbuffer[];
double kAMAupsig[];
double kAMAdownsig[];

//+------------------------------------------------------------------+

int cbars=0, prevbars=0, prevtime=0;
double slowSC, fastSC;


#property indicator_plots   3

//--- indicator buffers

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);

//--- indicator buffers mapping
   SetIndexBuffer(0,kAMAbuffer,INDICATOR_DATA);
   SetIndexBuffer(1,kAMAupsig,INDICATOR_DATA);
   SetIndexBuffer(2,kAMAdownsig,INDICATOR_DATA);
   
   PlotIndexSetInteger(1, PLOT_ARROW, 159);
   PlotIndexSetInteger(2, PLOT_ARROW, 159);
   
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---
    // if (prevbars==rates_total) return (0);
  
 // Print("prev_calculated="+prev_calculated+";prevbars="+prevbars  );   
      int i, pos=0;
      double noise=0.000000001, AMA, AMA0, signal, ER;
      double dSC, ERSC, SSC, ddK;
  

      
      //---- TODO: add your code here
      slowSC=(2.0 /(nslow+1));
      fastSC=(2.0 /(nfast+1));

      //cbars=IndicatorCounted(prev_calculated);

      if(prev_calculated>0) cbars = prev_calculated-1;
      if(prev_calculated==0) cbars = 0;
      cbars=0;
      //Print(cbars);
      
      if (rates_total<=(periodAMA+2)) return (0);
      //---- check for possible errors
      if (cbars<0) return (-1);
      //---- last counted bar will be recounted
      if (cbars>0) cbars--;
      pos=periodAMA+2;
  
     /*
         if (rates_total<=(periodAMA+2)) return (0);
      pos=periodAMA+2;
      if(prev_calculated>0) pos = prev_calculated-1;
   */
      AMA0=close[pos-1];
      
      while (pos<rates_total)
      {
      //Print("pos="+pos+";rates_total="+rates_total);
      
         if (pos==periodAMA-2) AMA0=close[pos-1];
         signal=MathAbs (close[pos]-close[pos-periodAMA]);
         
         
         noise=0.000000001;
         for (i=0; i< periodAMA; i++)
         {
            noise=noise+MathAbs (close[pos-i]-close[pos-i-1]);
         }
         ER =signal/noise;
         dSC=(fastSC-slowSC);
         ERSC=ER*dSC;
         SSC=ERSC+slowSC;
         AMA=AMA0+(MathPow (SSC, G)*(close[pos]-AMA0));
         kAMAbuffer[pos]=AMA;
   
         ddK=(AMA-AMA0);
         if ((MathAbs (ddK)) > (dK*_Point) &&(ddK > 0)) kAMAupsig[pos] =AMA; else kAMAupsig[pos]=0;
         if ((MathAbs (ddK)) > (dK*_Point) &&(ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0;
   
   
         AMA0=AMA;
         pos++;
      }
      
      

     
     prevbars=rates_total;
     
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
  {
//---
   
  }
//+------------------------------------------------------------------+

тормозить дико в сравнении со встроенными индюками

Con risposta

1
Sviluppatore 1
Valutazioni
(46)
Progetti
73
16%
Arbitraggio
13
8% / 92%
In ritardo
37
51%
Gratuito
2
Sviluppatore 2
Valutazioni
(280)
Progetti
650
28%
Arbitraggio
111
19% / 61%
In ritardo
319
49%
Gratuito
3
Sviluppatore 3
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
4
Sviluppatore 4
Valutazioni
(2)
Progetti
5
20%
Arbitraggio
2
50% / 0%
In ritardo
0
Gratuito
5
Sviluppatore 5
Valutazioni
(15)
Progetti
18
61%
Arbitraggio
4
0% / 100%
In ritardo
8
44%
Gratuito
Ordini simili
dify indicator MA_Cloud for mt4 and mt5, give source code with comments 1)Need to change alerts and arrows for cross price only true 2 MA without crossing (direction from small to big) 2)Fix the error when change to any timeframe for MA (disapeer) and for arrows (in history is very big on vertically out of see screenshot) 3)Add alerts for crossing of 2 MA (MA Small cross MA big) Arrows, Message, Sound - (True/False)
Изменить графический интерфейс утилиты, исправить расположение кнопок, изменить вид некоторых окон и добавить новые. Сохранить текущую адаптивность и работоспособность кнопок. Подробнее расскажу в ТЗ с наглядными скриншотами, что и где поменять. Правки нужно внести в МТ4 и МТ5 версии. Спасибо за ваши заявки, рассмотрю каждую
Мне нужен робот, который будет иметь следующие необходимые параметры: 1. робот должен работать на MT5 2. минимальный депозит $100 3. количество транзакций в день на депозит $100 с лотом 0,01 минимум 1000 4. макс прасат 15%
написать индикатор распознования флета. выявления флета из трёх частей проверки. в каждой части свой расчёт, по барам, по количеству поинтов, по ширине (высоте) баров, по минимальным значениям... когда все расчеты сошлись и не вышли из пропорций, тогда рисуется флет. Задание готово, отправлю подходящему кандидату. передача оплаты, когда индикатор будет работать без проблем, по всем параметрам расчетов. возможны не
был старый работоспособный скрипт на очень старом МТ4... есть необходимость переписать его на MQL5, чтобы проверить теоретическую работоспособность в современном мире описание вроде бы где-то сохранилось кто-нибудь сможет помочь с этим вопросом и за какие деньги

Informazioni sul progetto

Budget
10 - 20 USD
Per lo sviluppatore
9 - 18 USD
Scadenze
da 1 a 3 giorno(i)