//------------------------------------------------------------------ #property copyright "mladen" #property link "www.forex-tsd.com" #property version "1.0" //------------------------------------------------------------------ #property indicator_chart_window #property indicator_buffers 2 #property indicator_plots 1 #property indicator_label1 "Kijun-sen" #property indicator_type1 DRAW_COLOR_LINE #property indicator_color1 clrDeepSkyBlue,clrSandyBrown #property indicator_style1 STYLE_SOLID #property indicator_width1 2 // // // // // input int Kijun = 26; // Calculation period input bool alertsOn = false; // Turn alerts on? input bool alertsOnCurrent = true; // Alert on current bar? input bool alertsMessage = true; // Display messageas on alerts? input bool alertsSound = false; // Play sound on alerts? input bool alertsEmail = false; // Send email on alerts? input bool alertsNotify = false; // Send push notification on alerts? double MaBuffer[],ColorBuffer[]; //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int OnInit() { SetIndexBuffer(0,MaBuffer,INDICATOR_DATA); SetIndexBuffer(1,ColorBuffer,INDICATOR_COLOR_INDEX); IndicatorSetString(INDICATOR_SHORTNAME,"Kijun-Sen ("+(string)Kijun+")"); return(0); } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int OnCalculate(const int rates_total,const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &TickVolume[], const long &Volume[], const int &Spread[]) { if (Bars(_Symbol,_Period)=0; k++) { if(khi < high[i-k]) khi = high[i-k]; if(klo > low [i-k]) klo = low[i-k]; } if ((khi+klo) > 0.0) MaBuffer[i] = (khi + klo)/2; else MaBuffer[i] = 0; // // // // // ColorBuffer[i] = (close[i]>MaBuffer[i]) ? 0 : (close[i]