Einzelnen Beitrag anzeigen
  #7 (permalink)  
Alt 25.05.16
Trader6666 Trader6666 ist offline
Mitglied
 
Registriert seit: Apr 2014
Beiträge: 97
Trader6666 befindet sich auf einem aufstrebenden Ast
Standard

//+------------------------------------------------------------------+
//| werte auslesen.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict

int FontSize;
string FontStyle;
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
Obj();
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---

}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
double Fractal[5];

int start()
{
int count = 0, i = 0, F_Buffer;
double value;

while(count < 5)
{
i++;
for(F_Buffer = 1; F_Buffer <= 2; F_Buffer++)
{
value = iFractals(Symbol(),0,F_Buffer,i);
if (value > 0 && F_Buffer == 1)
{
Fractal[count] = value;

count++;

Alert(" High Fractal auf Kerze " + DoubleToString(High[count],5) +
" hat das Tief bei =" + DoubleToString( value,5));

break;
}
if (value > 0 && F_Buffer == 2)
{
Fractal[count] = value;

count++;

Alert(" Low Fractal auf Kerze " + DoubleToString(Low[count],5) +
" hat das Tief bei =" + DoubleToString( value,5));

break;

}
}
}
Ausgabe("Fractal[1]",DoubleToString(Fractal[1],5),clrYellow);
Ausgabe("Fractal[2]",DoubleToString(Fractal[2],5),clrYellow);
Ausgabe("Fractal[3]",DoubleToString(Fractal[3],5),clrYellow);
Ausgabe("Fractal[4]",DoubleToString(Fractal[4],5),clrYellow);
Ausgabe("Fractal[5]",DoubleToString(Fractal[5],5),clrYellow);


return(0);
}


void Ausgabe (string name, string wert, color col )
{
ObjectSetText(name,wert,FontSize,FontStyle,col);
}





void Obj()
{

// Obj1
ObjectCreate ("Fractal[1]",OBJ_LABEL,0,0,0);
ObjectSetText ("Fractal[1]",DoubleToString(Fractal[1],5),FontSize,FontStyle,clrYellow);
ObjectSet ("Fractal[1]",OBJPROP_CORNER,0);
ObjectSet ("Fractal[1]",OBJPROP_XDISTANCE,80);
ObjectSet ("Fractal[1]",OBJPROP_YDISTANCE,60);
ObjectCreate ("TFractal[1]",OBJ_LABEL,0,0,0);
ObjectSetText ("TFractal[1]","Fractal[1]: ",FontSize,FontStyle,clrYellow);
ObjectSet ("TFractal[1]",OBJPROP_CORNER,0);
ObjectSet ("TFractal[1]",OBJPROP_XDISTANCE,15);
ObjectSet ("TFractal[1]",OBJPROP_YDISTANCE,60);
// Obj2
ObjectCreate ("Fractal[2]",OBJ_LABEL,0,0,0);
ObjectSetText ("Fractal[2]",DoubleToString(Fractal[2],2),FontSize,FontStyle,clrYellow);
ObjectSet ("Fractal[2]",OBJPROP_CORNER,0);
ObjectSet ("Fractal[2]",OBJPROP_XDISTANCE,80);
ObjectSet ("Fractal[2]",OBJPROP_YDISTANCE,80);
ObjectCreate ("TFractal[2]",OBJ_LABEL,0,0,0);
ObjectSetText ("TFractal[2]","Fractal[2]: ",FontSize,FontStyle,clrYellow);
ObjectSet ("TFractal[2]",OBJPROP_CORNER,0);
ObjectSet ("TFractal[2]",OBJPROP_XDISTANCE,15);
ObjectSet ("TFractal[2]",OBJPROP_YDISTANCE,80);
// Obj3
ObjectCreate ("Fractal[3]",OBJ_LABEL,0,0,0);
ObjectSetText ("Fractal[3]",DoubleToString(Fractal[3],2) ,FontSize,FontStyle,clrYellow);
ObjectSet ("Fractal[3]",OBJPROP_CORNER,0);
ObjectSet ("Fractal[3]",OBJPROP_XDISTANCE,80);
ObjectSet ("Fractal[3]",OBJPROP_YDISTANCE,100);
ObjectCreate ("TFractal[3]",OBJ_LABEL,0,0,0);
ObjectSetText ("TFractal[3]","Fractal[3]: ",FontSize,FontStyle,clrYellow);
ObjectSet ("TFractal[3]",OBJPROP_CORNER,0);
ObjectSet ("TFractal[3]",OBJPROP_XDISTANCE,15);
ObjectSet ("TFractal[3]",OBJPROP_YDISTANCE,100);
// Obj4
ObjectCreate ("Fractal[4]",OBJ_LABEL,0,0,0);
ObjectSetText ("Fractal[4]",DoubleToString(Fractal[4],5),FontSize,FontStyle,clrYellow);
ObjectSet ("Fractal[4]",OBJPROP_CORNER,0);
ObjectSet ("Fractal[4]",OBJPROP_XDISTANCE,80);
ObjectSet ("Fractal[4]",OBJPROP_YDISTANCE,120);
ObjectCreate ("TFractal[4]",OBJ_LABEL,0,0,0);
ObjectSetText ("TFractal[4]","Fractal[4]: ",FontSize,FontStyle,clrYellow);
ObjectSet ("TFractal[4]",OBJPROP_CORNER,0);
ObjectSet ("TFractal[4]",OBJPROP_XDISTANCE,15);
ObjectSet ("TFractal[4]",OBJPROP_YDISTANCE,120);
// Obj5
ObjectCreate ("Fractal[5]",OBJ_LABEL,0,0,0);
ObjectSetText ("Fractal[5]",DoubleToString(Fractal[5],5),FontSize,FontStyle,clrRed);
ObjectSet ("Fractal[5]",OBJPROP_CORNER,0);
ObjectSet ("Fractal[5]",OBJPROP_XDISTANCE,80);
ObjectSet ("Fractal[5]",OBJPROP_YDISTANCE,140);
ObjectCreate ("TFractal[5]",OBJ_LABEL,0,0,0);
ObjectSetText ("TFractal[5]","Hinweis: ",FontSize,FontStyle,clrYellow);
ObjectSet ("TFractal[5]",OBJPROP_CORNER,0);
ObjectSet ("TFractal[5]",OBJPROP_XDISTANCE,15);
ObjectSet ("TFractal[5]",OBJPROP_YDISTANCE,140);
// Obj6
ObjectCreate ("Fractal[6]",OBJ_LABEL,0,0,0);
ObjectSetText ("Fractal[6]",DoubleToString(Fractal[5],5),FontSize,FontStyle,clrBlueViolet);
ObjectSet ("Fractal[6]",OBJPROP_CORNER,0);
ObjectSet ("Fractal[6]",OBJPROP_XDISTANCE,80);
ObjectSet ("Fractal[6]",OBJPROP_YDISTANCE,160);
ObjectCreate ("TFractal[6]",OBJ_LABEL,0,0,0);
ObjectSetText ("TFractal[6]","Fractal[6]: ",FontSize,FontStyle,clrYellow);
ObjectSet ("TFractal[6]",OBJPROP_CORNER,0);
ObjectSet ("TFractal[6]",OBJPROP_XDISTANCE,15);
ObjectSet ("TFractal[6]",OBJPROP_YDISTANCE,160);
}