Use ArrayGetAsSeries Not ArrayIsSeries:
#property indicator_chart_window #property indicator_buffers 1 #property indicator_plots 1 //---- plot Label1 #property indicator_label1 "Label1" #property indicator_type1 DRAW_LINE #property indicator_color1 clrRed #property indicator_style1 STYLE_SOLID #property indicator_width1 1 //--- indicator buffers double Label1Buffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //--- indicator buffers mapping //--- } //+------------------------------------------------------------------+ //| 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[]) { //--- ArraySetAsSeries(open, true); if(ArrayGetAsSeries(open)) Print("open[] is timeseries"); else Print("open[] is not timeseries!!!"); ArraySetAsSeries(open, false); if(ArrayGetAsSeries(open)) Print("open[] is timeseries"); else Print("open[] is not timeseries!!!"); //--- return value of prev_calculated for next call return(rates_total); }
ArrayIsSeries: The function checks whether an array is a timeseries.
ArrayGetAsSeries: It checks direction of an array index.
Yashar Seyyedin #:
ArrayIsSeries: The function checks whether an array is a timeseries.
ArrayGetAsSeries: It checks direction of an array index.
thank you
yes it works with ArrayGetAsSeries.
would you please look at my previous topic on :: https://www.mql5.com/en/forum/465601#comment_53087642
I can not read my custom indicators buffers in my experts in back test !!
despit of my expert advisor that only alert base on last value of indicators or despide of plotting corectly on the chart.

problem with iCustom
- 2024.04.14
- Mehrdad Sarrafi
- www.mql5.com
hi here I have a custom indicator , But when I use it in my expert 's backtest, I only receve maximum one signal...
Don't use those functions on buffers in OnInit. The buffers have not yet been created.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Here I have written some codes to show that ArraySetAsSeries function does not have any effect in Arrays!!
any boddy can help me?
why this function has no effect in my metatrader???