Re: Metatrader 5 Versions of indicators.

146
society wrote: Thu Jun 01, 2017 10:01 am Is this the only place MT5 stuff is posted? If not maybe we can make a short list?
No,this thread is not the only thread for mt5 indicators but mt5 indicators are posted in other threads too where it comes in topic and yes agree regarding short list but may be impossible as they are spread every where
"news from all sections" thread is specific for new indicators too including mt5 stuff - here
https://www.forex-station.com/viewtopic ... indicators
Indicator is just a tool.

Use it only if it can benefit you. Leave it if you don't know how to use it optimally.

Re: Metatrader 5 Versions of indicators.

150
Is there an MT5 version of this indicator avaiable: AMASLOPE
_______________________________________________________________

Code: Select all

//+------------------------------------------------------------------+
//|                                                AMA optimized.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|AMA optimized final             Copyright © 2004, by konKop,wellx |
//+------------------------------------------------------------------+
//mod slope 
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "optimized by Rosh"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Gray
#property indicator_color2 Blue
#property indicator_color3 Red

#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1


//---- input parameters
extern int       periodAMA=10;
extern double    nfast=2.0;
extern double    nslow=30.0;
extern double    G=2.0;
extern double    dK=2.0;
extern int       PriceType=0; // öåíà, îò êîòîðîé ñòðîèòñÿ 
extern int       AMA_Trend_Type=1;  //deltaAMA 0:(dK*Point) 1:dK*StdAMA
//PRICE_CLOSE 0 Öåíà çàêðûòèÿ 
//PRICE_OPEN 1 Öåíà îòêðûòèÿ 
//PRICE_HIGH 2 Ìàêñèìàëüíàÿ öåíà 
//PRICE_LOW 3 Ìèíèìàëüíàÿ öåíà 
//PRICE_MEDIAN 4 Ñðåäíÿÿ öåíà, (high+low)/2 
//PRICE_TYPICAL 5 Òèïè÷íàÿ öåíà, (high+low+close)/3 
//PRICE_WEIGHTED 6 Âçâåøåííàÿ öåíà çàêðûòèÿ, (high+low+close+close)/4 
extern string  note_Price_ = "0C 1O 2H 3L 4Md 5Tp 6WghC: Md(HL/2)4,Tp(HLC/3)5,Wgh(HLCC/4)6";
extern string  Trend_Type_ = "deltaAMA: dK*Point(0) dK*StdAM(1)";
//---- buffers
double AMAbuffer[];
double upAMA[];
double downAMA[];
double AbsBuffer[];

double AMA2Buffer[];
double SumAMABuffer[];
double StdAMA[];
double AMASlopeBuffer[];

double slowSC,fastSC,dFS;

//+------------------------------------------------------------------+
//| âîçâðàùàåò öåíó                                                  |
//+------------------------------------------------------------------+
double Price(int shift)
  {
//----
   double res;
//----
   switch (PriceType)
      {
      case PRICE_OPEN: res=Open[shift]; break;
      case PRICE_HIGH: res=High[shift]; break;
      case PRICE_LOW: res=Low[shift]; break;
      case PRICE_MEDIAN: res=(High[shift]+Low[shift])/2.0; break;
      case PRICE_TYPICAL: res=(High[shift]+Low[shift]+Close[shift])/3.0; break;
      case PRICE_WEIGHTED: res=(High[shift]+Low[shift]+2*Close[shift])/4.0; break;
      default: res=Close[shift];break;
      }
   return(res);
  }
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(8);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,AMASlopeBuffer);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,159);
   SetIndexBuffer(1,upAMA);
   SetIndexEmptyValue(1,0.0);
   SetIndexStyle(2,DRAW_ARROW);
   SetIndexArrow(2,159);
   SetIndexBuffer(2,downAMA);
   SetIndexEmptyValue(2,0.0);
   
   SetIndexBuffer(3,AbsBuffer);
   SetIndexBuffer(4,AMA2Buffer);
   SetIndexBuffer(5,SumAMABuffer);
   SetIndexBuffer(6,StdAMA);
   SetIndexBuffer(7,AMAbuffer);
   
   slowSC=(2.0 /(nslow+1));
   fastSC=(2.0 /(nfast+1));
   dFS=fastSC-slowSC;
   
      IndicatorShortName("AMAopt Slope ("+periodAMA+")");

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   int i,limit,limit2;
   double Noise,ER,SSC;
   double SredneeAMA,SumKvadratAMA;
   double val1,val2;
   double dipersion;
   static bool debug=false;
   
   if (debug) return;
   if (counted_bars>0) 
      {
      limit=Bars-counted_bars; 
      limit2=limit;
      }
   if (counted_bars==0)
      {
      ArrayInitialize(AMAbuffer,0);
      ArrayInitialize(upAMA,0);
      ArrayInitialize(downAMA,0);
      ArrayInitialize(AbsBuffer,0);
      ArrayInitialize(AMA2Buffer,0);
      ArrayInitialize(SumAMABuffer,0);
      ArrayInitialize(StdAMA,0);
      
      limit=Bars-1;
      limit2=Bars-periodAMA-1;
      }
   limit--;
   limit2--;
   for (i=limit;i>=0;i--)
      {
      AbsBuffer[i]=MathAbs(Price(i)-Price(i+1));
      }   
   for (i=limit2;i>=0;i--)
      {
      Noise=iMAOnArray(AbsBuffer,0,periodAMA,0,MODE_SMA,i)*periodAMA;
      if (Noise!=0) ER=MathAbs(Price(i)-Price(i+periodAMA))/Noise; else ER=0;
      SSC=MathPow(ER*dFS+slowSC,G);
      AMAbuffer[i]=Price(i)*SSC+AMAbuffer[i+1]*(1-SSC);
      AMA2Buffer[i]=AMAbuffer[i]*AMAbuffer[i]+AMA2Buffer[i+1];// íàêàïëèâàåì ñóììó êâàäðàòîâ ÀÌû
      SumAMABuffer[i]=SumAMABuffer[i+1]+AMAbuffer[i];
      AMASlopeBuffer[i]=AMAbuffer[i]-AMAbuffer[i+1];
  
  
      }   
   for (i=limit2;i>=0;i--)
      {
      val1=0;
      val2=0;
      SredneeAMA=(SumAMABuffer[i]-SumAMABuffer[i+periodAMA])/periodAMA;
      SumKvadratAMA=AMA2Buffer[i]-AMA2Buffer[i+periodAMA];
      dipersion=SumKvadratAMA/periodAMA-SredneeAMA*SredneeAMA;
      if (dipersion<0)
         {
         StdAMA[i]=0;

         if (IsTesting()&&false)
            {
            Print("Bar;Price;AbsBuffer;AMAbuffer;AMA2Buffer;SumAMABuffer;SredneeAMA");
            for (int Z=Bars-1;Z>=i;Z--) Print(Z,";",Price(Z),";",AbsBuffer[Z],";",AMAbuffer[Z],";",AMA2Buffer[Z],";",SumAMABuffer[Z],";",(SumAMABuffer[Z]-SumAMABuffer[Z+periodAMA])/periodAMA);
            }

         }
      else StdAMA[i]=MathSqrt(dipersion);

      if (AMA_Trend_Type!=0)
         {
         if (MathAbs(AMAbuffer[i]-AMAbuffer[i+1])>dK*Point)
            {
            if (AMAbuffer[i]-AMAbuffer[i+1]>0) val1=AMASlopeBuffer[i];
            else val2=AMASlopeBuffer[i];
            } 
         }
      else
         {
         if (MathAbs(AMAbuffer[i]-AMAbuffer[i+1])>dK*StdAMA[i])
            {
            if (AMAbuffer[i]-AMAbuffer[i+1]>0) val1=AMASlopeBuffer[i];
            else val2=AMASlopeBuffer[i];
            } 
         }         
      upAMA[i]=val1;
      downAMA[i]=val2;
      }


//----
   return(0);
  }
//+------------------------------------------------------------------+
Attachments


Who is online

Users browsing this forum: No registered users and 1 guest