Einzelnen Beitrag anzeigen
  #5 (permalink)  
Alt 19.11.20
RetepM RetepM ist offline
Mitglied
 
Registriert seit: Feb 2016
Beiträge: 240
RetepM befindet sich auf einem aufstrebenden Ast
Standard

Zitat:
Zitat von berlin Beitrag anzeigen
geile antwort
berlin
Du musst dir wahrscheinlich erst einen Wunsch erfüllen lassen...

Hier was aus meinen Beständen. Das Teil ist schon älter, aber in unzähligen Variationen im Markt:
//+------------------------------------------------------------------+
//| Support and Resistance.mq4 |
//+------------------------------------------------------------------+
//| Support and Resistance |
//| Copyright 2004/5 Barry Stander |
//| index.htm |
//+------------------------------------------------------------------+

#property copyright "Support and Resistance Barry_Stander_4@yahoo.com"
#property link "http://www.4Africa.net/4meta/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 DodgerBlue

//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i;
int counted_bars = IndicatorCounted();

int init()
{

IndicatorBuffers(2);

SetIndexArrow(0, 119);
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, EMPTY, Red);
SetIndexDrawBegin(0, i - 1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "Resistance");

SetIndexArrow(1, 119);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, EMPTY, DodgerBlue);
SetIndexDrawBegin(1, i - 1);
SetIndexBuffer(1, v2);
SetIndexLabel(1, "Support");

return (0);
}

int start()
{
int counted_bars = IndicatorCounted();
//---- last counted bar will be recounted
if (counted_bars > 0)
counted_bars--;

i = Bars - counted_bars;

while ( i >= 0 )
{
val1 = iFractals(NULL, 0, MODE_UPPER, i);

if (val1 > 0)
v1[i] = High[i];
else
v1[i] = v1[i + 1];

val2 = iFractals(NULL, 0, MODE_LOWER, i);

if (val2 > 0)
v2[i] = Low[i];
else
v2[i] = v2[i + 1];

i--;
}

return (0);
}

//+------------------------------------------------------------------+
Grüße