Hi Nikolay,
Thank you for a outstanding article. If you would like to use indicators with HTF at the end of the name in EA, write values to .csv and read .csv from EA.
Again, well done!!
Hi Nikolay,
great stuff - thanks a lot! However, when I use the functions JJMASeries () and JurXSeries () within my own indicators and then call the indicators from within an EA some strange error messages show up in the log:
2008.05.27 00:04:01 FXRangeSpotX USDCAD,Daily: JurX.Series number =0. Îøèáêà!!! Ïàðàìåòð nJurX.limit ôóíêöèè JurX.Series() áîëüøå ÷åì íåîáõîäèìî íà 1
2008.05.27 00:04:01 NNSignal USDCAD,Daily: JurXSeries number =0. Êîä îøèáêè = 4002. èíäåêñ ìàññèâà íå ñîîòâåòñòâóåò åãî ðàçìåðó
2008.05.27 00:04:01 NNSignal USDCAD,Daily: JurXSeries number =0. Ïðè èñïîëíåíèè ôóíêöèè JurXSeries() ïðîèçîøëà îøèáêà!!!
2008.05.27 00:01:47 FXRangeSpotX GBPUSD,H1: JurX.Series number =0. Îøèáêà!!! Ïàðàìåòð nJurX.limit ôóíêöèè JurX.Series() áîëüøå ÷åì íåîáõîäèìî íà 1
2008.05.27 00:01:47 NNSignal GBPUSD,H1: JurXSeries number =0. Êîä îøèáêè = 4002. èíäåêñ ìàññèâà íå ñîîòâåòñòâóåò åãî ðàçìåðó
2008.05.27 00:01:47 NNSignal GBPUSD,H1: JurXSeries number =0. Ïðè èñïîëíåíèè ôóíêöèè JurXSeries() ïðîèçîøëà îøèáêà!!!
I have followed your instructions exactly but cannot get rid of the error messages... Key question is: is there a bug in the functions or am I doing something wrong. Here is the indicator code that causes the problem when called from an EA:
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Yellow
//---- input parameters
extern int IndexPeriod = 10;
extern int Length_0 = 5;
extern int Length_1 = 10;
extern int Input_Price_Customs = 0;
#include <SmoothAlg.mqh>
//---- buffers
double Buffer1[], Buffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string name = "FXRangeSpotX";
IndicatorShortName(name);
IndicatorBuffers(2);
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Buffer1);
SetIndexShift(0, 0);
SetIndexEmptyValue(0, 0.0);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(1,Buffer2);
SetIndexShift(1, 0);
SetIndexEmptyValue(1, 0.0);
SetIndexLabel(0,name);
SetIndexDrawBegin(0,IndexPeriod);
JurXSeriesResize(1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, limit, counted_bars;
double bulls, bears;
double dMA;
counted_bars =IndicatorCounted();
/*
Print("Bars: " + Bars + "; Counted: " + counted_bars);
Print("Time of Bars[0]: " + TimeToStr(Time[0]));
Print("Time of Bars[Bars-1]: " + TimeToStr(Time[Bars-1]));
*/
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- the last counted bar will be recounted
if(counted_bars>0)
counted_bars--;
limit=Bars-counted_bars;
if (Bars <= IndexPeriod) { //set index buffer to 0
for (i = 0; i < limit; i++) {
Buffer1[i] = 0.0;
Buffer2[i] = 0.0;
}
return (0);
}
for (i = 0; i < limit; i++) {
Buffer1[i] = iSomeIndicator(NULL, 0, IndexPeriod, i) / 100.0;
Buffer2[i] = Buffer1[i];
}
smoothJurX(Buffer1, Length_0, counted_bars);
smoothJurX(Buffer2, Length_1, counted_bars);
return(0);
}
Hey Jurik,
its just lately that i started to get into your ideas. Very interesting & effective. Thanks a lot for sharing.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Effective Averaging Algorithms with Minimal Lag: Use in Indicators has been published:
Author: Nikolay Kositsin