Disliked{quote} This indicator is working without the v4 indicator. Is not the same indicator like the 3 indicators that you send me.Ignored
Don't try to be smart when you are not!
You don't need the Ganns_Signal_Trend_v4.ex4 to be on your chart. It only must be in the Indicators folder.
Without this one, the one you posted does nothing.
Here is the code:
Inserted Code
int init()
{
SetIndexBuffer(0,valueUp); SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(1,valueDn); SetIndexStyle(1,DRAW_HISTOGRAM);
indicatorFileName = WindowExpertName();
returnBars = TimeFrame=="returnBars"; if (returnBars) { return(0); }
timeFrame = stringToTimeFrame(TimeFrame);
return(0);
}
//
//
//
//
//
int start()
{
int i,counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit = MathMin(Bars-counted_bars,Bars-1);
if (returnBars) { valueUp[0] = limit+1; return(0); }
if (timeFrame != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrame,indicatorFileName,"returnBars",0,0)*timeFrame/Period()));
for (i=limit; i>=0; i--)
{
int y = iBarShift(NULL,timeFrame,Time[i]);
valueDn[i] = iCustom(NULL,timeFrame,"Ganns_Signal_Trend_v4",AdxPeriod,MomPeriod,MacdFastEma,MacdSlowEma,MacdSignalPeriod,MaxBars,0,y);
valueUp[i] = iCustom(NULL,timeFrame,"Ganns_Signal_Trend_v4",AdxPeriod,MomPeriod,MacdFastEma,MacdSlowEma,MacdSignalPeriod,MaxBars,1,y);
}
return(0);
} You can compare the source codes yourself in Meta Editor.
So, if you think that you know better, I won't help you any more!
Because, if you know better, you can do it yourself!
For comparison, here is the code from gann_signal_trend_mtf_alerts_2:
Inserted Code
int init()
{
SetIndexBuffer(0,valueUp);
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(1,valueDn);
SetIndexStyle(1,DRAW_HISTOGRAM);
indicatorFileName = WindowExpertName();
returnBars = TimeFrame=="returnBars"; if (returnBars) { return(0); }
TimeFrame = MathMax(TimeFrame,_Period);
return(0);
}
//---------------------------------------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit = MathMin(Bars-counted_bars,Bars-1);
if (returnBars) { valueUp[0] = limit+1; return(0); }
if (TimeFrame != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,TimeFrame,indicatorFileName,-99,0,0)*TimeFrame/Period()));
for (i=limit; i>=0; i--)
{
int y = iBarShift(NULL,TimeFrame,Time[i]);
valueDn[i] = iCustom(NULL,TimeFrame,"Ganns_Signal_Trend_v4_1",AdxPeriod,MomPeriod,MacdFastEma,MacdSlowEma,MacdSignalPeriod,MaxBars,0,y);
valueUp[i] = iCustom(NULL,TimeFrame,"Ganns_Signal_Trend_v4_1",AdxPeriod,MomPeriod,MacdFastEma,MacdSlowEma,MacdSignalPeriod,MaxBars,1,y);
if(Alerts)
{
static datetime previousTime;
if (previousTime != Time[0]&&i==0)
{
previousTime = Time[0];
Print("valueDn[1] = ",valueDn[1],"valueUp[0] = ",valueUp[0]);
Print("valueUp[1] = ",valueUp[1],"valueDn[0] = ",valueDn[0]);
if(valueUp[2]==0.0000&&valueDn[2]==0.0800&&valueUp[1]==0.0800&&valueDn[1]==0.0800)
Alert(_Symbol+Tf_as_string(TimeFrame)+" Gann signal Sell!");
if(valueUp[2]==0.0800&&valueDn[2]==0.0000&&valueDn[1]==0.0800)
Alert(_Symbol+Tf_as_string(TimeFrame)+" Gann signal Buy!");
}
}
}
return(0); And, we can not see the code of those ex4 files, so we can not know what the difference is.
But, I found the bundle with the Ganns_Signal_Trend_v4.ex4 and placed both files on the chart:
There is absolutely no difference.
.ex4/.ex5 files can't be fixed or modified / I'm not a coder!