//+------------------------------------------------------------------+ //| ADX aComaS 1.mq4 | //| bfis108137 | //| baaaaaary at msn.com | //+------------------------------------------------------------------+ #property copyright "bfis108137" #property link "baaaaaary at msn.com" #property version "1.00" #property strict #property indicator_separate_window #property indicator_buffers 1 #property indicator_plots 1 //--- plot Line #property indicator_label1 "Line" #property indicator_type1 DRAW_LINE #property indicator_color1 clrRed #property indicator_style1 STYLE_SOLID #property indicator_width1 1 //--- input parameters input int AdxPeriods=14; input int AdxApplyTo=0; input int barsToCheck=1000; //--- indicator buffers double LineBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,LineBuffer); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| 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[]) { //--- int barsToCheckHere = rates_total-prev_calculated; barsToCheckHere = MathMin(barsToCheckHere,barsToCheck); for(int i=0;i