//+------------------------------------------------------------------+ //| LasyATR.mq5 | //| LasyATR v1.0 Copyright 2017, fxborg | //| http://fxborg-labo.hateblo.jp/ | //+------------------------------------------------------------------+ #property copyright "Copyright 2017, fxborg" #property link "http://fxborg-labo.hateblo.jp/" #property version "2.2" #property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_type1 DRAW_NONE #property indicator_color1 clrRed #property indicator_width1 1 //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ input int InpPeriod=50; // Period double LATR[]; double LAtrAlpha=2.0/(InpPeriod+1.0); //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit() { SetIndexBuffer(0,LATR,INDICATOR_DATA); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ 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[]) { for(int i=(int)MathMax(prev_calculated-1,0); i