02.05.16
|
Neues Mitglied
|
|
Registriert seit: May 2016
Beiträge: 1
|
|
Werte werde nicht richtig ermitelt
Hallo, ich bin dabei mein ersten EA zu schreiben und habe ein Problem was ich nicht nachvollziehen kann.
Ich brauche für meinen EA 6 Werte , 5 werden richtig ermittelt nur l2 nicht.
Selbst wenn ich l1 und l2 die gleiche Formel(Shift auf 0) nehme ist der wert falsch.
Code:
//+------------------------------------------------------------------+
//| test2.mq4 |
//| |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
extern int Periods = 20;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int start()
{
double ma1 = iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);
double ma2 = iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,1);
double h1 = High[iHighest(NULL,0,MODE_HIGH,Periods,0)];
double h2 = High[iHighest(NULL,0,MODE_HIGH,Periods,1)];
double l1 = Low[iLowest(NULL,0,MODE_LOW,Periods,0)];
double l2 = Low[iLowest(NULL,0,MODE_LOW,Periods,1)];
Comment(StringFormat("Aktuelle Werte\nh1 = %G\nh2 = %G\nl1 = %G\nl2 =%d",h1,h2,l1,l2));
return(0);
}
|