//------------------------------------------------------------------ #property link "www.forex-station.com" #property copyright "www.forex-station.com" //------------------------------------------------------------------ #property indicator_separate_window #property indicator_buffers 2 #property indicator_label1 "Blau Tsi" #property indicator_type1 DRAW_LINE #property indicator_color1 clrLimeGreen #property indicator_width1 2 #property indicator_label2 "Blau Tsi signal" #property indicator_type2 DRAW_LINE #property indicator_style2 STYLE_DOT #property indicator_color2 clrPaleVioletRed #property strict // // // // // input int Fast = 8; // Macd fast period input int Slow = 21; // Macd slow period input int Signal = 5; // Macd signal input int Period1 = 8; // Period 1 input int Period2 = 5; // Period 2 input int Period3 = 5; // Signal period input ENUM_APPLIED_PRICE Price = PRICE_CLOSE; // Price to use double tsi[],sig[]; //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int OnInit() { SetIndexBuffer(0,tsi,INDICATOR_DATA); SetIndexBuffer(1,sig,INDICATOR_DATA); IndicatorSetString(INDICATOR_SHORTNAME,"Blau ergodic TSI Macd ("+(string)Period1+","+(string)Period2+") Trigger (" + (string)Period3 +")"); return(INIT_SUCCEEDED); } void OnDeinit(const int reason){ } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // 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 &tick_volume[], const long &volume[], const int &spread[]) { int i=fmin(rates_total-prev_calculated+1,rates_total-2); for (; i>=0 && !_StopFlag; i--) { double priceDiff=0; if (i