Hello,
I trying to code a very simple indicator, but i'm unable to call Laguerre value from H1.
what i want to do :
TF 1M
buy signal : Laguerre crossing 0.15 level head up and Laguerre H1 > 0.75
sell signal : Laguerre crossing 0.75 level head down and Laguerre H1 < 0.15
i made the indicator for the simple cross and it works, the problem is when i try to check the value from Laguerre H1: it's a mess!
Here is the code:
it doesn't work, the RED line is the problem, without the RED line it works perfectly.
i tried (iCustom(Symbol(),PERIOD_H1,"Laguerre",0,i) < .....)
(iCustom(Symbol(),PERIOD_H1,"Laguerre",0,0) < ....)
(iCustom(Symbol(),60,"Laguerre",0,i) < ....)
(iCustom(Symbol(),60,"Laguerre",0,0) < .....)
your help would be very welcome !
i attached the Laguerre indicator i use if you want give a try.
if someone is ready to recode it from scratch please don't hesitate
it's driving me nutz...
I trying to code a very simple indicator, but i'm unable to call Laguerre value from H1.
what i want to do :
TF 1M
buy signal : Laguerre crossing 0.15 level head up and Laguerre H1 > 0.75
sell signal : Laguerre crossing 0.75 level head down and Laguerre H1 < 0.15
i made the indicator for the simple cross and it works, the problem is when i try to check the value from Laguerre H1: it's a mess!
Here is the code:
Inserted Code
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 SeaGreen
#property indicator_color2 Red
#property indicator_width1 3
#property indicator_width2 3
double CrossUp[];
double CrossDown[];
extern bool SoundON=true;
double alertTag;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_ARROW, EMPTY,3);
SetIndexArrow(0, 233);
SetIndexBuffer(0, CrossUp);
SetIndexStyle(1, DRAW_ARROW, EMPTY,3);
SetIndexArrow(1, 234);
SetIndexBuffer(1, CrossDown);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start() {
int limit, i;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i = 0; i <= limit; i++) {
if ( (iCustom(NULL,0,"Laguerre",0.66,9500,0,i) > 0.15) && (iCustom(NULL,0,"Laguerre",0.66,9500,0,i+1) < 0.15)
&&[color=Red] (iCustom(Symbol(),PERIOD_H1,"Laguerre",0.66,9500,0,i) > 0.75)[/color]) //check for buy signal
{
CrossUp[i] = Close[i];
}
else if ( (iCustom(NULL,0,"Laguerre",0.66,9500,0,i) < 0.75) && (iCustom(NULL,0,"Laguerre",0.66,9500,0,i+1) > 0.75)
&& [color=Red](iCustom(Symbol(),PERIOD_H1,"Laguerre",0.66,9500,0,i) < 0.15)[/color]) //check for sell signal
{
CrossDown[i] = Close[i];
}
if (SoundON==true && i==1 && CrossUp[i] > CrossDown[i] && alertTag!=Time[0]){
Alert("SHORT signal on ",Symbol()," ",Period());
alertTag = Time[0];
}
if (SoundON==true && i==1 && CrossUp[i] < CrossDown[i] && alertTag!=Time[0]){
Alert("Long Signal on ",Symbol()," ",Period());
alertTag = Time[0];
}
}
return(0);
} i tried (iCustom(Symbol(),PERIOD_H1,"Laguerre",0,i) < .....)
(iCustom(Symbol(),PERIOD_H1,"Laguerre",0,0) < ....)
(iCustom(Symbol(),60,"Laguerre",0,i) < ....)
(iCustom(Symbol(),60,"Laguerre",0,0) < .....)
your help would be very welcome !
i attached the Laguerre indicator i use if you want give a try.
if someone is ready to recode it from scratch please don't hesitate
it's driving me nutz...
Attached File(s)
if you win you can share if you loose you can try to sell your shit.