Hilfe zu Gap Indikator

 

Hallo zusammen. Ich benötige ein wenig Hilfe zu diesem Gap Indikator. Ich bin leider kein Programmieren und würde mich freuen wenn mir jemand kann helfen könnte. 


Der Indikator erstellt bei einem Gap einen kleinen Kreis. Ich benötige jedoch eine Trendlinie auf den "OHLC" Price der Close Candle vom Freitag. 


Aus der Eröffnung Kerze am Montag benötige ich in der Bewegung eine Trendlinie des "Open Price". Sobald die Montags Kerze schließt erst danach den Close, High, Low Price als Trendlinie. 



Die Trendlinie soll in der länge definierbar sein. 



Würde mich sehr freuen wenn mir jemand der das kann helfen könnte. 


Mit freundlichen Grüßen


//+------------------------------------------------------------------+
//|                                                        i-GAP.mq4 |
//|                                                                  |
//|                                                                  |
//|                                                                  |
//| 04.11.2005                                                       |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Lime

//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern int SizeGAP      = 100;      // Ðàçìåð ÃÝÏà
extern int NumberOfBars = 10000;  // Êîëè÷åñòâî áàðîâ îáñ÷¸òà (0-âñå)

//------- Ãëîáàëüíûå ïåðåìåííûå --------------------------------------
int ArrowInterval;

//------- Ïîêëþ÷åíèå âíåøíèõ ìîäóëåé ---------------------------------

//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double SigBuy[];
double SigSell[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init() {
  SetIndexBuffer(0, SigBuy);
  SetIndexStyle (0, DRAW_ARROW);
  SetIndexArrow (0, 162);
  SetIndexEmptyValue(0, EMPTY_VALUE);

  SetIndexBuffer(1, SigSell);
  SetIndexStyle (1, DRAW_ARROW);
  SetIndexArrow (1, 162);
  SetIndexEmptyValue(1, EMPTY_VALUE);

  ArrowInterval=GetArrowInterval();
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start() {
  double ms[2];
  int    LoopBegin, sh;

        if (NumberOfBars==0) LoopBegin=Bars-1;
  else LoopBegin=MathMin(NumberOfBars-1,Bars-2);

  for (sh=LoopBegin; sh>=0; sh--) {
    ms[0]=EMPTY_VALUE;
    ms[1]=EMPTY_VALUE;
    GetSignals(sh, ms);
    SigBuy[sh]=ms[0];
    SigSell[sh]=ms[1];
  }
}

//+------------------------------------------------------------------+
//| Âîçâðàùàåò ñèãíàëû                                               |
//+------------------------------------------------------------------+
void GetSignals(int nb, double& ms[]) {
  double Cl1=Close[nb+1];
  double Op0=Open [nb];

  if (Cl1>Op0+SizeGAP*Point) ms[0]=Low[nb]-ArrowInterval*Point;
  if (Cl1<Op0-SizeGAP*Point) ms[1]=High[nb]+ArrowInterval*Point;
}

//+------------------------------------------------------------------+
//| Âîçâðàùàåò èíòåðâàë óñòàíîâêè ñèãíàëüíûõ óêàçàòåëåé              |
//+------------------------------------------------------------------+
int GetArrowInterval() {
  int p=Period();

  switch (p) {
    case 1:     return(3);
    case 5:     return(5);
    case 15:    return(7);
    case 30:    return(10);
    case 60:    return(15);
    case 240:   return(20);
    case 1440:  return(50);
    case 10080: return(100);
    case 43200: return(200);
  }
}
//+------------------------------------------------------------------+

1.2

 

Das ist ein typischer Auftrag für die Freelancer oben.

Lies aber vorher die Regeln durch und dies hier:

https://www.mql5.com/de/articles/4368 // EA
https://www.mql5.com/de/articles/4304 // Indi

How to create Requirements Specification for ordering a trading robot
How to create Requirements Specification for ordering a trading robot
  • www.mql5.com
Trading robots are programs, which operate according to underlying algorithms. An algorithm is a set of actions that need to be performed in response to certain events. For example, the most common task in algo trading is the identification of the "New bar" event. When the event occurs, the robot checks the emergence of trading signals and acts...
Grund der Beschwerde: