Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 26.12.18
begu begu ist offline
Neues Mitglied
 
Registriert seit: Aug 2016
Beiträge: 15
begu befindet sich auf einem aufstrebenden Ast
Standard Horizontallinie im Strategytester darstellen

Hallo,

ich versuch schon tagelang eine horizontale linie (breakout-linie) so zu programmieren das sie auch zum manuellen testen beim strategietester aufscheint aber schaffe das nicht ...muss man da was besonderes beachten ...bin ja mt4-anfänger aber das macht mich richtig fertig,wenn da nix geht ....am aktiven chart funktioniert das .....wie kann das sein ???

DANKE für HILFE

gruß

begu

hier der indicatorcode:
//+------------------------------------------------------------------+
//| Begu Alert.mq4 |
//+------------------------------------------------------------------+
#property copyright "begu"

#property indicator_chart_window
extern string LowLine = "MyLineL";
extern string HighLine = "MyLineH";
extern color LineColor = Red;
extern color LineColor1 = DodgerBlue;
extern int LineStyle = STYLE_SOLID;
extern int LineStyle1 = STYLE_SOLID;
extern int pipDistance = 300;
extern string AlertWav ="alert.wav";
extern int AccDigits = 5;
extern double LOWPrice = 0; //Eingabe LOWPrice
extern int TradingRange = 50;
extern string LowTimeBeginn = "06:00";
extern string LowTimeEnd = "12:00";
extern string HighTimeBeginn = "06:00";
extern string HighTimeEnd = "12:00";

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();


ObjectCreate(HighLine, OBJ_TREND, 0,StrToTime(HighTimeBeginn), Bid + pipDistance*Point,StrToTime(HighTimeEnd),Bid + pipDistance*Point);
ObjectSet(HighLine,OBJPROP_RAY_RIGHT,true);
ObjectSet(HighLine, OBJPROP_STYLE, LineStyle1);
ObjectSet(HighLine, OBJPROP_COLOR, LineColor1);
ObjectSet(HighLine,OBJPROP_WIDTH,3); // Linienbreite

ObjectCreate(LowLine, OBJ_TREND, 0,StrToTime(LowTimeBeginn), Bid - pipDistance*Point,StrToTime(LowTimeEnd),Bid - pipDistance*Point);
ObjectSet(LowLine, OBJPROP_STYLE, LineStyle);
ObjectSet(LowLine, OBJPROP_COLOR, LineColor);
ObjectSet(LowLine,OBJPROP_RAY_RIGHT,true);
ObjectSet(LowLine,OBJPROP_WIDTH,3);

double val = ObjectGet( LowLine, OBJPROP_PRICE1);
if (Bid <= val ) PlaySound(AlertWav);

double val1 = ObjectGet( HighLine, OBJPROP_PRICE1);
if (Bid >= val1 ) PlaySound(AlertWav);
//----
//----
return(0);
}