My automatic TREND LINES for the CANDLES of FOREX MARKET charts

0
(0)
Name:
My automatic TREND LINES for the CANDLES of FOREX MARKET charts
Author: puncher (2011.09.08 11:56)
Downloaded: 14771
Download:
My automatic TREND LINES for the CANDLES of FOREX MARKET charts 1
 linie_wsparcia_oporu_v2.mq4 (7.3 Kb) View

Description:

The indicator draws the support (lower) and resistance (upper) lines taking into acount the Low and High of the candles.

It can make trend lines for the chosen CANDLES RANGE - without any manual precision. If the trend lines are not too precise, then you can change (inrease or decrease) only linia_dolna_do and/or linia_gorna_do values.


For the trend lines it is as simple as possible indicator I think.

 

Image:

My automatic TREND LINES for the CANDLES of FOREX MARKET charts 2


Much better is my v2 version of this indicator. If you have still free money enjoy it all 🙂

4 comments  To post a new comment, please log in or register

I tried it repaints a lot.
06.03.2012 23:53 perfume73

the program has some bugs.

14.09.2011 19:19 eastore

yangshu:
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
extern int speriod=1,lperiod=144;
extern string Support="Support",Resistance="Resistance";
extern color Sup_Line_Color=Green,Res_Line_Color=Red;
double low,low1,low2,low3;
datetime p1,p2,p3,p4;
int init()
...
return(0);
}

 

albo i tak ...

10.09.2011 15:12 puncher

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Green
extern int speriod=1,lperiod=144;
extern string Support="Support",Resistance="Resistance";
extern color Sup_Line_Color=Green,Res_Line_Color=Red;
double low,low1,low2,low3;
datetime p1,p2,p3,p4;
int init()
{
return(0);
}
int deinit()
{
ObjectDelete("Support");
ObjectDelete("Resistance");
return(0);
}
int start()
{
p2=iTime(NULL,0,speriod);
p4=iTime(NULL,0,speriod);
low1=iLow(NULL,0,speriod);
low2=iLow(NULL,0,speriod);
int i,j=speriod;
for(i=speriod;i<=lperiod;i++)
{
if(iLow(NULL,0,i)<low1)
{
j=i;low1=iLow(NULL,0,j);
p2=iTime(NULL,0,j);
}
}
for(i=speriod;i<j;i++)
{
if(iLow(NULL,0,i)<low2)
{
low2=iLow(NULL,0,i);
p4=iTime(NULL,0,i);
}
}

ObjectCreate(Support,OBJ_TREND,0,p2,low1,p4,low2);
for(i=j;i>=speriod;i--)
{
if(ObjectGetValueByShift(Support,i)>iClose(NULL,0,i))
{
ObjectDelete(Support);
}
p4=iTime(NULL,0,i);
low2=iLow(NULL,0,i);
ObjectCreate(Support,OBJ_TREND,0,p2,low1,p4,low2);
}
ObjectSet(Support,OBJPROP_COLOR,Sup_Line_Color);
ObjectSet(Support,OBJPROP_WIDTH,1);
ObjectSet(Support,OBJPROP_STYLE,STYLE_SOLID);
p1=iTime(NULL,0,speriod);
p3=iTime(NULL,0,speriod);
low=iLow(NULL,0,speriod);
low3=iLow(NULL,0,speriod);
int k,n=speriod;
for(k=speriod;k<=lperiod;k++)
{
if(iHigh(NULL,0,k)>low)
{
n=k;low=iHigh(NULL,0,n);
p1=iTime(NULL,0,n);
}
}
for(k=speriod;k<n;k++)
{
if(iHigh(NULL,0,k)>low3)
{
low3=iHigh(NULL,0,k);
p3=iTime(NULL,0,k);
}
}
ObjectCreate(Resistance,OBJ_TREND,0,p1,low,p3,low3);
for(k=n;k>=speriod;k--)
{
if(ObjectGetValueByShift(Resistance,k)<iClose(NULL,0,k))
{
ObjectDelete(Resistance);
}
p3=iTime(NULL,0,k);
low3=iHigh(NULL,0,k);
ObjectCreate(Resistance,OBJ_TREND,0,p1,low,p3,low3);
}
ObjectSet(Resistance,OBJPROP_COLOR,Res_Line_Color);
ObjectSet(Resistance,OBJPROP_WIDTH,1);
ObjectSet(Resistance,OBJPROP_STYLE,STYLE_SOLID);
return(0);
}

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?



Author: Forex Wiki Team
We are a team of highly experienced Forex Traders [2000-2023] who are dedicated to living life on our own terms. Our primary objective is to attain financial independence and freedom, and we have pursued self-education and gained extensive experience in the Forex market as our means to achieve a self-sustainable lifestyle.