sr_KG_H1_H4_D1.mq4
This is detail page for
sr_KG_H1_H4_D1.mq4
indicator for Metatrader 4.
Check if there is already an
expert advisor using
sr_KG_H1_H4_D1.mq4
indicator
Added on:
31 January 2011
Downloaded:
169
times
Screenshot of this indicator with default settings:
sr_KG_H1_H4_D1.mq4
source code:
//+------------------------------------------------------------------+ //| KG Support & Resistance.mq4 | //| Copyright ? 2007, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Kang_Gun" #property link "http://www.free-knowledge.com" #property indicator_chart_window #property indicator_buffers 6 #property indicator_color1 DarkGreen #property indicator_width1 1 #property indicator_color2 Maroon #property indicator_width2 1 #property indicator_color3 Green #property indicator_width3 2 #property indicator_color4 Crimson #property indicator_width4 2 #property indicator_color5 MediumSeaGreen #property indicator_width5 3 #property indicator_color6 OrangeRed #property indicator_width6 3 //---- input parameters //---- buffers double ExtMapBuffer3[]; double ExtMapBuffer4[]; double ExtMapBuffer5[]; double ExtMapBuffer6[]; double ExtMapBuffer7[]; double ExtMapBuffer8[]; int KG; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexDrawBegin(0,KG-1); SetIndexBuffer(0,ExtMapBuffer3); SetIndexLabel(0,"Resistance H1"); SetIndexArrow(0, 158); SetIndexStyle(1,DRAW_ARROW); SetIndexDrawBegin(1,KG-1); SetIndexBuffer(1,ExtMapBuffer4); SetIndexLabel(1,"Support H1"); SetIndexArrow(1, 158); SetIndexStyle(2,DRAW_ARROW); SetIndexDrawBegin(2,KG-1); SetIndexBuffer(2,ExtMapBuffer5); SetIndexLabel(2,"Resistance H4"); SetIndexArrow(2, 158); SetIndexStyle(3,DRAW_ARROW); SetIndexDrawBegin(3,KG-1); SetIndexBuffer(3,ExtMapBuffer6); SetIndexLabel(3,"Support H4"); SetIndexArrow(3, 158); SetIndexStyle(4,DRAW_ARROW); SetIndexDrawBegin(4,KG-1); SetIndexBuffer(4,ExtMapBuffer7); SetIndexLabel(4,"Resistance D1"); SetIndexArrow(4, 158); SetIndexStyle(5,DRAW_ARROW); SetIndexDrawBegin(5,KG-1); SetIndexBuffer(5,ExtMapBuffer8); SetIndexLabel(5,"Support D1"); SetIndexArrow(5, 158); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //------------------------------------------------------------------ bool Fractal (string M,int P, int shift) { if (Period()>P) return(-1); P=P/Period()*2+MathCeil(P/Period()/2); if (shift<P)return(-1); if (shift>Bars-P)return(-1); for (int i=1;i<=P;i++) { if (M=="U") { if (High[shift+i]>High[shift])return(-1); if (High[shift-i]>=High[shift])return(-1); } if (M=="L") { if (Low[shift+i]<Low[shift])return(-1); if (Low[shift-i]<=Low[shift])return(-1); } } return(1); } //------------------------------------------------------------------ int start() { int D1=1440, H4=240, H1=60; KG=Bars; while(KG>=0) { if (Fractal("U",H1,KG)==1) ExtMapBuffer3[KG]=High[KG]; else ExtMapBuffer3[KG]=ExtMapBuffer3[KG+1]; if (Fractal("L",H1,KG)==1) ExtMapBuffer4[KG]=Low[KG]; else ExtMapBuffer4[KG]=ExtMapBuffer4[KG+1]; if (Fractal("U",H4,KG)==1) ExtMapBuffer5[KG]=High[KG]; else ExtMapBuffer5[KG]=ExtMapBuffer5[KG+1]; if (Fractal("L",H4,KG)==1) ExtMapBuffer6[KG]=Low[KG]; else ExtMapBuffer6[KG]=ExtMapBuffer6[KG+1]; if (Fractal("U",D1,KG)==1) ExtMapBuffer7[KG]=High[KG]; else ExtMapBuffer7[KG]=ExtMapBuffer7[KG+1]; if (Fractal("L",D1,KG)==1) ExtMapBuffer8[KG]=Low[KG]; else ExtMapBuffer8[KG]=ExtMapBuffer8[KG+1]; KG--; } return(0); } //+------------------------------------------------------------------+
return
back to the list
Use and copyright disclaimer:
All listed content was freely found on the web, created, or submitted by our users. MetaTrader™ is a trademark of MetaQuotes™ www.metaquotes.net. This list of metatrader indicators and expert advisors has been created by their copyright owners and are free for personal non-commercial use. You agree by downloading not to sell these files or modify the copyright information found within. All files and content within this site are to be used at your own risk! Neither AllForexIndicators.com nor the creators of it's files, indicators or expert advisors grant you any promise of earnings or otherwise. Some files listed on our web site may be outdated. There is no guarantee of their working condition. Trading Futures, Options on Futures, and Foreign Exchange involves substantial risk of loss and may not be suitable for all investors. You should carefully consider whether trading is suitable for you in light of your circumstances, knowledge, and financial resources. Opinions, market data, and recommendations are subject to change at any time. This website and its pages does not constitute a solicitation to buy or sell by AllForexIndicators.com and/or its affiliates, and is not to be available to individuals in a jurisdiction where such availability would be contrary to local regulation or law. Attention Owners/Authors: To request your Indicator or Expert Advisor to be removed click here