//*****************************************************************************// //*****************************************************************************// //* BS_Living Now.mq4 *// //* Copyright © 2013, Backspace *// //* Success Version *// //*****************************************************************************// //*****************************************************************************// //* Торгуй тренды *// //* Уменьшай потери *// //* Давай прибыли расти *// //* Управляй рисками *// //*****************************************************************************// //*****************************************************************************// #property copyright "Copyright © 2013, Backspace" // #property link "Success Version" // // #property indicator_chart_window // #property indicator_buffers 4 // #property indicator_color1 Red // #property indicator_color2 Yellow // #property indicator_color3 Red // #property indicator_color4 Yellow // //******************// Ввод параметров индикатора extern int BQuant=48; // - кол-во просчитываемых баров //******************// Составные части индикатора double ExtrimHi[], // - экстремум High ExtrimLo[], // - экстремум Low BreakHi[], // - экстремум High BreakLo[]; // - экстремум Low //*****************************************************************************// //**************************-Indicator Initialization-*************************// //*****************************************************************************// // int init() // { // Comment("BS_Living Now"); // //******************// Настройки графического отображения IndicatorBuffers (4); // SetIndexLabel (0,"ExtrimHi"); // SetIndexBuffer (0,ExtrimHi); // SetIndexStyle (0,DRAW_ARROW,EMPTY,2); // SetIndexArrow (0,159); // SetIndexLabel (1,"ExtrimLo"); // SetIndexBuffer (1,ExtrimLo); // SetIndexStyle (1,DRAW_ARROW,EMPTY,2); // SetIndexArrow (1,159); // SetIndexLabel (2,"BreakHi"); // SetIndexBuffer (2,BreakHi); // SetIndexStyle (2,DRAW_NONE,EMPTY,1); // заменить на DRAW_ARROW SetIndexArrow (2,224); // SetIndexLabel (3,"BreakLo"); // SetIndexBuffer (3,BreakLo); // SetIndexStyle (3,DRAW_NONE,EMPTY,1); // заменить на DRAW_ARROW SetIndexArrow (3,224); // //*********// return(0); // } // // //*****************************************************************************// //*************************-Indicator Deinitialization-************************// //*****************************************************************************// // int deinit() // { // Comment(""); // //*********// return(0); // } // // //*****************************************************************************// //*********************************-Living Now-********************************// //*****************************************************************************// // int start() // { int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit-=1+BQuant; // for(int s=limit; s>=1; s--) // { // Comment("Living Now\n","Spread =",MarketInfo(Symbol(),MODE_SPREAD)); // Extrim_Detect(s+1); //******************// Определение экстремумов } // //*********// return(0); // } // // //*****************************************************************************// //*********************************-SubPogramms-*******************************// //*****************************************************************************// // double Extrim_Detect(int t) //***********************************// Определение экстремумов { // if((TimeDayOfWeek(Time[t])==5 && TimeHour(Time[t])>=20)|| // (TimeDayOfWeek(Time[t])==1 && TimeHour(Time[t])<=1)) // {ExtrimHi[t] =0; ExtrimLo[t] =0;} // else // { // if(iHigh(NULL,0,t)>=High[iHighest(NULL,0,2,BQuant,t+1)] && // iHigh(NULL,0,t)>iHigh(NULL,0,t-1)) // { // ExtrimHi[t] =iHigh(NULL,0,t); // Break_Detect(t,1); //******************// Определение точек прорыва } // if(iLow(NULL,0,t)<=Low[iLowest(NULL,0,1,BQuant,t+1)] && // iLow(NULL,0,t)Low[iLowest(NULL,0,1,BQuant,a+r+1)]) // {BreakLo[a] =High[iHighest(NULL,0,2,r+2,a-1)]; r=BQuant;} // } // //*********// return(0); // } // // //*****************************************************************************// //**************************************************************************BS*// //*****************************************************************************//