Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   Wert wird in EA nicht erkannt (http://www.expert-advisor.com/forum/showthread.php?t=7319)

Klaus144 28.03.23 18:26

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);
}
------------------------------------------------

Klaus144 31.03.23 12:17

Die Frage hat sich erledigt. Habe es hinbekommen.


Alle Zeitangaben in WEZ +2. Es ist jetzt 09:30 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum