You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I would like to use an indicator written by Barry Stander that draws support and resistance lines based on Fractals. howeveer, the lines are very short. I would like them to extend to the right indefinitely. Actually I would prefer to be able to specify the number of bars that lines extend to the right, but indefinitely is better than the current situation. By specifying the number of bars I mean that if I specify 365 bars on a daily chart, the horizontal line would extend out a year. The code is below along with a Chart. I would like solid lines instead of dotted arrows.
Thanks for your help.
Ira Berenhaus
iberenhaus@comcast.net
(973) 566-0095
//| Support and Resistance |
//| Copyright © 2004/5 Barry Stander |
//| http://www.4Africa.net/4meta/ |
//+------------------------------------------------------------------+
#property link "http://www.4Africa.net/4meta/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
double v1[];
double v2[];
double val1;
double val2;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
//----
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexBuffer(0, v1);
SetIndexLabel(0,"Resistance");
SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexBuffer(1, v2);
SetIndexLabel(1,"Support");
//----
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
int i=Bars;
//----
while(i>=0)
{
val1=iFractals(NULL, 0, MODE_UPPER,i);
if (val1 > 0) v1[i]=High[i];
else v1[i]=v1[i+1];
if (val2 > 0) v2[i]=Low[i];
else v2[i]=v2[i+1];
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+