Support & Resistance Indicator


#property copyright "Copyright © 2012, Wiwin Wijaya"
#property link "http://forexiswhat.blogspot.com"
#property indicator_color1 Gold
#property indicator_color2 DarkOrange
#property indicator_chart_window
#property indicator_buffers 2

//---- buffers
double w1[];
double w2[];
double x1;
double x2;
int Y;
int init()
{ IndicatorBuffers(2);
//---- drawing settings
SetIndexArrow(0, 119);
SetIndexArrow(1, 119);
SetIndexStyle(1,DRAW_LINE,STYLE_DASH,1,DarkOrange) ;
SetIndexDrawBegin(1,Y-1);
SetIndexBuffer(1, w2);
SetIndexLabel(1,"Support");
SetIndexStyle(0,DRAW_LINE,STYLE_DASH,1,Gold);
SetIndexDrawBegin(0,Y-1);
SetIndexBuffer(0, w1);
SetIndexLabel(0,"Resistance");
return(0); }

int start()
{
Y=Bars;
while(Y>=0)
{
x1 = iFractals(NULL, 0, MODE_UPPER,Y);
if (x1 > 0)
w1[Y]=High[Y];
else
w1[Y] = w1[Y+1];
x2 = iFractals(NULL, 0, MODE_LOWER,Y);
if (x2 > 0)
w2[Y]=Low[Y];
else
w2[Y] = w2[Y+1];

Y--;
}
return(0);
}

//+------------------------------------------------------------------+



2 comments:

  1. Hi,

    I hope this message finds you well,

    My name is Neil; I'm the affiliate manager @ BinaryOffers.com
    I saw that you are promoting few interesting offers,
    So I'd like to take this opportunity and invite you to join us.

    We offer an Extremely high commissions and the best service online.

    I'll be more than happy to start working with you and introduce to you few of our offers.
    You can send me an email or add me to your Skype (aff.binaryoffers) so we can discuss.

    All the best my friend,
    Neil
    neil@binaryoffers.org

    ReplyDelete