- June 10, 2013
- Posted by: Forex Wiki Team
- Category: FX Ind
Name: |
|
||
Author: | puncher (2011.09.08 11:56) | ||
Downloaded: | 14771 | ||
Download: |
|
||
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:
Much better is my v2 version of this indicator. If you have still free money enjoy it all 🙂 |
|||
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); } |