Get line values from my indicator New comment Frans 2017.10.22 11:48 I wrote this indicator. It draws lines with a certain distance on the chart. How do I get the values of the lines? see screenshot. //+------------------------------------------------------------------+ //| Frans_Tops_Rev5.mq4 | //| Copyright 2017, Fortuna4x | //| https://www.fortuna4x.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2017, Fortuna4x" #property link "https://www.fortuna4x.com" #property version "1.00" #property strict #property indicator_chart_window #property indicator_buffers 2 extern int iRange=10; double tops[]; double bottoms[]; double CalcPoint; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { EventSetMillisecondTimer(1); SetIndexBuffer(0,tops); SetIndexStyle(0,DRAW_LINE,EMPTY,2,clrWhite); SetIndexBuffer(1,bottoms); SetIndexStyle(1,DRAW_LINE,EMPTY,2,clrWhite); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { EventKillTimer(); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ 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[]) { //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { CalcDigits(); plaatsBoxen(); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void CalcDigits() { int CalcDigits=(int)MarketInfo(Symbol(),MODE_DIGITS); if(CalcDigits == 2|| CalcDigits == 3) CalcPoint = 0.01; else if(CalcDigits==4 || CalcDigits==5) CalcPoint=0.0001; } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void plaatsBoxen() { double HighBand; double LowBand; datetime tHighBand; datetime tLowBand; HighBand=High[Bars-1]-((High[Bars-1] - Low[Bars-1])/2)+(iRange/2*CalcPoint); LowBand = Low[Bars-1]+((High[Bars-1] - Low[Bars-1])/2)-(iRange/2*CalcPoint); tHighBand= Time[Bars-1]; tLowBand = Time[Bars-1]; for(int i=Bars-1;i>=1;i--) { if(High[i]>=HighBand+(iRange*CalcPoint)) { // HighBand=High[i]; HighBand=HighBand+(iRange*CalcPoint); LowBand=HighBand -(iRange*CalcPoint); tHighBand= Time[i]; tLowBand = Time[i]; } if(Low[i]<LowBand-(iRange*CalcPoint)) { // LowBand=Low[i]; LowBand=LowBand-(iRange*CalcPoint); HighBand=LowBand+iRange*CalcPoint; tHighBand= Time[i]; tLowBand = Time[i]; } if(High[i]<HighBand && Low[i]>LowBand) { HighBand= HighBand; LowBand = LowBand; tHighBand= tHighBand; tLowBand = Time[i]; } tops[i]=HighBand; bottoms[i]=LowBand; } } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ I wrote this EA and use iCustom. What is wrong? Please help. Here is the EA: //+------------------------------------------------------------------+ //| Frans_Bloks_Rev1.mq4 | //| Copyright 2017, Fortuna4x | //| https://www.fortuna4x.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2017, Fortuna4x" #property link "https://www.fortuna4x.com" #property version "1.00" #property strict double dToparray[100]; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- create timer EventSetMillisecondTimer(1); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- destroy timer EventKillTimer(); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { ArraySetAsSeries(dToparray,true); for(int i=0;i<100;i++) { dToparray[i]= iCustom(NULL,0,"Frans_Tops_Rev5",10,0,i); } Comment(DoubleToStr(dToparray[3],5)); } //+------------------------------------------------------------------+ New comment