//+------------------------------------------------------------------+ //| Cycle_Cross Value.mq4 | //| Copyright © 2010, AKA TradeForexFx | //| | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, AKA TradeForexFx" #property link "" //#property indicator_chart_window #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_minimum 0.0 #property indicator_maximum 100.0 //---- input parameters extern int Period_=0; extern int UpperCrossValue=80; extern int LowerCrossValue=20; bool UseAlert=false; //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,233); SetIndexBuffer(0,ExtMapBuffer1); SetIndexEmptyValue(0,0.0); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,234); SetIndexBuffer(1,ExtMapBuffer2); SetIndexEmptyValue(1,0.0); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //-- Check for Start of a new Bar //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- main loop for(int i=0; i UpperCrossValue && FastPeriod_0_Current1 < UpperCrossValue ) ExtMapBuffer1[i] = 50.0; // ExtMapBuffer1[i] = iLow(NULL, 0, i+1); if (FastPeriod_0_Current < LowerCrossValue &&FastPeriod_0_Current1 >LowerCrossValue ) ExtMapBuffer2[i] =50.0; // ExtMapBuffer2[i] =iHigh(NULL, 0, i+1); } return(0); } //+------------------------------------------------------------------+