So, nun mal das komplette Prog in MQL4. Ich bekomme nicht einmal ein Rechteck angezeigt... Hier für EMA 2 und 4 auf M1 (Zu Testzwecken ):
PHP-Code:
#property copyright "Angel"
#property link "https://www.mql5.com"
#property version "1.00"
#property indicator_chart_window
datetime time1,time2;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
void OnInit()
{
ObjectsDeleteAll();
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
ObjectsDeleteAll();
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
int start()
{
double EMA10_1 = iMA(NULL, 2, 1, 0, 1, 0, 1); // "NULL"= (Current Chart) , Timeframe , Periode ("0"=Current , "1"=M1 usw), MA_Shift , MA_Method ("0"=SMA,"1"=EMA usw) , Enum_Applied_Price ("0"=Close , "1"=Open usw) , shift)
double EMA10_2 = iMA(NULL, 4, 1, 0, 1, 0, 2);
double EMA20_1 = iMA(NULL, 2, 1, 0, 1, 0, 1);
double EMA20_2 = iMA(NULL, 4, 1, 0, 1, 0, 2);
if (EMA10_2 > EMA20_2 && EMA10_1 < EMA20_1) time1 = Time[1];
if (EMA10_2 < EMA20_2 && EMA10_1 > EMA20_1) time1 = Time[1];
{
ObjectCreate(0,"Rechteck",OBJ_RECTANGLE,0,Time[1],1.19100,Time[1],1.20100);
ObjectSetInteger(0,"Rechteck",OBJPROP_COLOR,clrBlueViolet );
ObjectSetInteger(0,"Rechteck",OBJPROP_WIDTH,1 );
ObjectSetInteger(0,"Rechteck",OBJPROP_SELECTABLE,true);
ObjectSetInteger(0,"Rechteck",OBJPROP_BACK,true);
}
return(0);
}