//+------------------------------------------------------------------+ //| _Symbol.mq4 | //| Copyright © 2012. XrustSolution. mail:xrustx@gmail.com | //| http://www.youtube.com/user/opmlv http://forexrust.info | //+------------------------------------------------------------------+ #property copyright "Copyright © 2012. XrustSolution. mail:xrustx@gmail.com" #property link "http://www.youtube.com/user/opmlv http://forexrust.info" //+------------------------------------------------------------------+ //| Super Global Variables | //+------------------------------------------------------------------+ #property indicator_chart_window #property indicator_buffers 4 #property indicator_width1 0 #property indicator_width2 0 //+------------------------------------------------------------------+ //| Extern Variables | //+------------------------------------------------------------------+ extern color Chart_Color = Teal ; extern string SYMBOL = "USDCHF" ; extern bool Mirror = false ; extern bool Sinshronise_Daily_Weekly = true ; extern double Scale_Multyplier = 1 ; extern int Bars_Back = 2000 ; //+------------------------------------------------------------------+ //| Defines & Global variavles | //+------------------------------------------------------------------+ #define empty EMPTY_VALUE //+------------------------------------------------------------------+ string _sy; int _per; //--- buffers double hi[]; double lo[]; double op[]; double cl[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void init(){_sy = StringUpper(SYMBOL); if(StringLen(_sy)<4){_sy = Symbol();} IndicatorShortName(_sy); IndicatorDigits(MarketInfo(_sy,MODE_DIGITS)); if(Sinshronise_Daily_Weekly){ _per = PERIOD_D1; }else{ _per = PERIOD_W1; } if(Scale_Multyplier==0){ Scale_Multyplier=1; } if(Scale_Multyplier > 1000){ Scale_Multyplier=1000; } //---- indicators SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,0,Chart_Color); SetIndexBuffer(0,hi); SetIndexEmptyValue(0,EMPTY_VALUE); SetIndexLabel(0,_sy); SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,0,Chart_Color); SetIndexBuffer(1,lo); SetIndexEmptyValue(1,EMPTY_VALUE); SetIndexLabel(1,_sy); SetIndexStyle(2,DRAW_HISTOGRAM,EMPTY,1,Chart_Color); SetIndexBuffer(2,op); SetIndexEmptyValue(2,EMPTY_VALUE); SetIndexLabel(2,_sy); SetIndexStyle(3,DRAW_HISTOGRAM,EMPTY,1,Chart_Color); SetIndexBuffer(3,cl); SetIndexEmptyValue(3,EMPTY_VALUE); SetIndexLabel(3,_sy); //---- return;} //+------------------------------------------------------------------+ void deinit(){return;} //+------------------------------------------------------------------+ void start(){ //---- Стандартный набор переменых static int pretime=0; static double prerp = 0; int i, ii = 0, counted = IndicatorCounted(); if (counted > 0) counted--; int limit = Bars - counted; int per = Period(); string sy = Symbol(); string txt=""; //---- Предварительные расчеты и объявления double op_1,op_2,_hi,_lo,_op,_cl; double ss = iOpen(sy,_per,0)/iOpen(_sy,_per,0); if(ss<1){ss=ss*MathPow(10,(Digits-MarketInfo(_sy,MODE_DIGITS)));} double sm, mno = (Point/MarketInfo(_sy,MODE_POINT))*ss*Scale_Multyplier; if(Bars_Back!=0){limit=Bars_Back;} if(limit < 5){limit=5;} //---- Масштабирование ширины гистограммы int width = GetChartScale(); SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,0); SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,0); SetIndexStyle(2,DRAW_HISTOGRAM,EMPTY,width); SetIndexStyle(3,DRAW_HISTOGRAM,EMPTY,width); //---- Основной расчет индикатора for(i=0;i96 && c<123) n=c-32; // a-z -> A-Z if (c>223 && c<256) n=c-32; // а-я -> А-Я if (c==184) n=168; // ё -> Ё if (n>0) s=StringSetChar(s, i, n); } return(s); } //+------------------------------------------------------------------+