Wert wird in EA nicht erkannt
Sehr geehrte Wissende,
ich habe einen EA erstellt. Die benötigten Daten kommen von einem Indicator, natürlich. Nun ist es so, das die Werte i+1, i+2, usw. korrekt erkannt werden. Den Wert von i+0 bekommt / oder verarbeitet der EA aber nicht richtig. Kann das am Indicator liegen? Läst sich das korrigieren? Danke im Voraus!!
Hier der Indicator:
------------------------
#property copyright "Copyright © 2014, Gehtsoft USA LLC"
#property link "http://fxcodebase.com"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
#property indicator_width1 2
#property strict
extern int One_Percentage=60;
double PPF[];
int init()
{
IndicatorShortName("Percentage Price Follower");
IndicatorDigits(Digits);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,PPF);
return(0);
}
int deinit()
{
return(0);
}
int start()
{
if(Bars<=3) return(0);
int ExtCountedBars=IndicatorCounted();
if (ExtCountedBars<0) return(-1);
int limit=Bars-2;
if(ExtCountedBars>2) limit=Bars-ExtCountedBars-1;
int i;
i=limit;
while(i>=0)
{
if (i>Bars-4)
{
PPF[i]=Close[i];
}
else
{
if (PPF[i+1]<Close[i])
{
PPF[i]=PPF[i+1]+(High[i]-Low[i])*One_Percentage/100;
}
else
{
if (PPF[i+1]>Close[i])
{
PPF[i]=PPF[i+1]-(High[i]-Low[i])*One_Percentage/100;
}
else
{
PPF[i]=PPF[i+1];
}
}
}
i--;
}
return(0);
}
------------------------------------------------
|