#property copyright "" #property link "" #property description "" #property description "" #property description " " #property description "" #property description "" #property description "" #property version "" //#property strict#property indicator_separate_window //chart_window #property indicator_buffers 8//------#property indicator_color1 clrLime //White //SpringGreen //LightGreen //LightCyan //SpringGreen //Aqua //Lime //Aqua //White //Gold#property indicator_color2 clrYellow //SlateGray //SeaGreen //LightSeaGreen //LimeGreen //DarkGray //MediumSeaGreen //CornflowerBlue //SpringGreen //LightSteelBlue //DeepSkyBlue //Brown //DeepPink //LightSkyBlue //Magenta //SkyBlue#property indicator_color3 clrNONE#property indicator_color4 clrRed //DeepPink //MediumVioletRed //PaleVioletRed //SpringGreen //DarkOrchid //MediumVioletRed //HotPink //Orchid //HotPink //Magenta //SkyBlue#property indicator_color5 clrLightCyan //HotPink //HotPink //MediumSeaGreen //MediumOrchid //Magenta //DeepPink //HotPink //Violet //Crimson //MediumVioletRed //DarkOrchid //SeaGreen //LightSteelBlue //Gold#property indicator_color6 clrNONE#property indicator_color7 clrAqua //Lime#property indicator_color8 clrGold //Red//---#property indicator_width1 2#property indicator_width2 2#property indicator_width3 17#property indicator_width4 2#property indicator_width5 2#property indicator_width6 17#property indicator_width7 1#property indicator_width8 1//---#property indicator_style1 STYLE_SOLID#property indicator_style2 STYLE_SOLID#property indicator_style3 STYLE_SOLID#property indicator_style4 STYLE_SOLID#property indicator_style5 STYLE_SOLID#property indicator_style6 STYLE_SOLID#property indicator_style7 STYLE_SOLID#property indicator_style8 STYLE_SOLID//---//#property indicator_level1 25//#property indicator_levelcolor clrDimGray //DarkSlateGray //C'0,66,0' //clrDarkSlateBlue //SteelBlue //Sienna //C'60,61,62' //C'66,122,177' // //#property indicator_levelwidth 0//#property indicator_levelstyle STYLE_DOT//****************************************************************************//*** Custom indicator ENUM settings ***//****************************************************************************enum MAtype { nHide,/*hide these*/ nLines,/*as Lines*/ nCloud/*as Cloud*/ };//---enum setARR { onOFF,/*Arrows OFF*/ onInduk,/*on Indicator*/ onChart,/*on Chart*/ onBoth/*on Indicator & Chart*/ }; enum showAR { HideArrows,/*Hide Arrows*/ INSIDE,/*Inside*/ CENTER,/*Center*/ OUTSIDE/*Outside*/ }; //enum showAR { aDoNotCALC, HideArrows, aOnCHART, aOnINDIK }; //****************************************************************************//*** Custom indicator input parameters ***//**************************************************************************** extern int History = 0; //288=D1/M5 //576=D2/M5; //864=D3/M5; //1152=D4/M5; //1440=D5/M5;extern string PAIR = "";extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT;extern int Signal1 = 15, //0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711; Signal2 = 45, Signal3 = 135; //0.1454, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0, 1.272, 1.414, 1.618, 2.058, 2.618, 3.32, 4.236, 5.35, 6.853.... extern ENUM_MA_METHOD Method1 = MODE_LWMA, Method2 = MODE_LWMA, Method3 = MODE_LWMA; extern double PipStep = 1.0; extern MAtype Line12type = nCloud, //nLines; //Первая, Вторая МАшка - Тип Отрисовки Line34type = nLines; //nCloud; //Третья Машка и Индекс - Тип Отрисовки extern int Shift1 = 0, Shift2 = 0, Shift3 = 0, ShiftW = 0;//extern ENUM_STO_PRICE Price = STO_CLOSECLOSE; //STO_LOWHIGH;//extern ENUM_APPLIED_PRICE CCIprice = PRICE_CLOSE; //extern int HotLevel = 200; //extern int ExtLevel = 400; extern setARR DrawArrows = onBoth; //onOFF; //onChart; //onInduk; //extern int ARROWBAR = 0; //На каком баре рисовать Стрелку: =0 - рисовать на текущем (до закрытия - может исчезнуть)extern showAR ShowArrows = OUTSIDE; //HideArrows; //IN extern int ArrowGapChart = 3; //Дистанция от High/Low свечи extern int ArrowGapSubwin = 5; //Дистанция от High/Low свечи extern color ColorBUY = clrDeepSkyBlue, //White, //Aqua, //SpringGreen, //LightCyan, //Turquoise, //LightSkyBlue, //White, //LimeGreen, //FireBrick, // ColorSELL = clrOrangeRed; //Red; //Gold; //HotPink; //Magenta; //LightSalmon; //Salmon; //HotPink; //Orange; //Orange; //SlateBlue; //extern int CodeBUY = 233, CodeSELL = 234, ArrowSize = 1; extern string SoundFile = "alert2.wav"; //"news.wav"; //"expert.wav"; // //"stops.wav" //extern int ALERTBAR = 1; //На каком баре сигналить....extern bool AlertsMessage = true, //false, AlertsSound = true, //false, AlertsEmail = false, AlertsMobile = false;extern color buttColor = clrRed; //Button text colorextern int buttSize = 9; //Button text widthextern color backColor = clrWhite; //Button background color extern int axisX = 0; //Button X axisextern int axisY = 15; //Button Y axisextern ENUM_BASE_CORNER buttCorner = CORNER_LEFT_UPPER; //Button base cornerextern int buttWindow = 1; //Button in which windowextern string buttName = "WADSEDOV"; //Button text//clrLightCyan //clrCrimson //clrSpringGreen //clrMediumVioletRed//****************************************************************************//*** Custom indicator buffers ***//****************************************************************************double SIG11[], SIG22[], FAKE1[], SIG33[], MAIN[], FAKE2[], ARRUP[], ARRDN[], FLAG[], PONT, DGTS; int TFK, MAX, ARB, SGB; string sTFR, cTFR, TWIN, PREF; datetime TimeBar=0, NewTime=0; int TikKont=2;bool boHist1=false, boHist2=false; int nType12=0, nType34=0, nSize12=0, nSize34=0;//---string ShortName = "["+(string)Signal1+"+"+(string)Signal2+"+"+(string)Signal3+"]"; //+"±"+(string)Periud+//****************************************************************************//*** Custom indicator initialization function ***//****************************************************************************int init(){ TimeFrame = fmax(TimeFrame,_Period); TFK = TimeFrame/_Period; sTFR = StringSubstr(EnumToString(TimeFrame),7); cTFR = StringSubstr(EnumToString(ENUM_TIMEFRAMES(_Period)),7); //IndikName = WindowExpertName(); //--- TWIN = (PAIR=="") ? _Symbol : StringUpper(PAIR); //--- Signal1 = fmax(Signal1,0)*TFK; //Percent = fmax(1,fmin(Percent,999)); Signal2 = fmax(Signal2,0)*TFK; Signal3 = fmax(Signal3,0)*TFK; //Slow = fmax(Slow,1); //if (Slow==Fast) Slow+=1; //--- MAX = Signal1+Signal2+Signal3+TFK; //fmax(PricePeriod,PipFilter); //--- ARB = ARROWBAR*TFK; SGB = ALERTBAR*TFK; //--- PONT = SymbolInfoDouble(TWIN,SYMBOL_POINT)*pow(10,SymbolInfoInteger(TWIN,SYMBOL_DIGITS)%2); DGTS = SymbolInfoInteger(TWIN,SYMBOL_DIGITS)-SymbolInfoInteger(TWIN,SYMBOL_DIGITS)%2; //--- boHist1 = Line12type>1 && Signal1>0 && Signal2>0 ? true : false; //enum MAtype { nHide, nLines, nCloud }; boHist2 = Line34type>1 && Signal3>0 ? true : false;//---//------ IndicatorBuffers(9); IndicatorSetInteger(INDICATOR_DIGITS,DGTS); //Digits-Digits%2); //------ 5 распределенных буфера индикатора //enum showCD { LINE, HISTO }; nType12 = boHist1 ? DRAW_HISTOGRAM : Line12type==1 || (Line12type==1&&!boHist1) ? DRAW_LINE : DRAW_NONE; nSize12 = boHist1 ? 17 : 2; SetIndexBuffer(0,SIG11); SetIndexStyle(0,nType12,EMPTY,nSize12); SetIndexBuffer(1,SIG22); SetIndexStyle(1,nType12,EMPTY,nSize12); color fake = ChartGetInteger(0,CHART_COLOR_BACKGROUND); SetIndexBuffer(2,FAKE1); SetIndexStyle(2,boHist1?DRAW_HISTOGRAM:DRAW_NONE,EMPTY,nSize12,fake); //--- nType34 = boHist2 ? DRAW_HISTOGRAM : Line34type==1 || (Line34type==1&&!boHist2) ? DRAW_LINE : DRAW_NONE; nSize34 = boHist2 ? 17 : 2; SetIndexBuffer(3,SIG33); SetIndexStyle(3,nType34,EMPTY,nSize34); SetIndexBuffer(4,MAIN); SetIndexStyle(4,nType34,EMPTY,nSize34); SetIndexBuffer(5,FAKE2); SetIndexStyle(5,boHist2?DRAW_HISTOGRAM:DRAW_NONE,EMPTY,nSize34,fake); //--- SetIndexBuffer(6,ARRUP); SetIndexStyle(6,DrawArrows%2!=0&&ShowArrows>0?DRAW_ARROW:DRAW_NONE,EMPTY,ArrowSize,ColorBUY); SetIndexArrow(6,CodeBUY); SetIndexBuffer(7,ARRDN); SetIndexStyle(7,DrawArrows%2!=0&&ShowArrows>0?DRAW_ARROW:DRAW_NONE,EMPTY,ArrowSize,ColorSELL); SetIndexArrow(7,CodeSELL);//------ 4 дополнительных буфера индикатора, используются для подсчета SetIndexBuffer(8,FLAG); for (int i=8; i<9; i++) SetIndexStyle(i,DRAW_NONE);////------ настройка параметров отрисовки уровней// SetLevelValue(0,-HotLevel); // SetLevelValue(1, HotLevel);// SetLevelValue(2,-ExtLevel); // SetLevelValue(3, ExtLevel);// SetLevelValue(4, 0); //------ установка сдвига линий при отрисовке SetIndexShift(0,Shift1*TFK); SetIndexShift(1,Shift2*TFK); SetIndexShift(2,fmax(Shift1,Shift2)*TFK); SetIndexShift(3,Shift3*TFK); SetIndexShift(4,ShiftW*TFK); SetIndexShift(5,fmax(Shift3,ShiftW)*TFK);//------ пропуск отрисовки первых баров for (i=0; i<9; i++) { //indicator_buffers //SetIndexStyle(i,DRAW_LINE); //--- настройка параметров отрисовки SetIndexEmptyValue(i,0); //--- значение 0 отображаться не будет //SetIndexShift(11,SperiodShift); //--- установка сдвига линий при отрисовке if (History>MAX) SetIndexDrawBegin(i,Bars-History); //--- пропуск отрисовки первых баров if (History<=MAX) SetIndexDrawBegin(i,MAX*1); } //--- пропуск отрисовки первых баров //------ отображение в DataWindow SetIndexLabel(0,Signal1>0 ? TWIN+","+sTFR+": Signal1 "+StringSubstr(EnumToString(Method1),5)+","+(string)Signal1 : NULL); SetIndexLabel(1,Signal2>0 ? TWIN+","+sTFR+": Signal2 "+StringSubstr(EnumToString(Method2),5)+","+(string)Signal2 : NULL); SetIndexLabel(2,NULL); SetIndexLabel(3,Signal3>0 ? TWIN+","+sTFR+": Signal3 "+StringSubstr(EnumToString(Method3),5)+","+(string)Signal3 : NULL); SetIndexLabel(4,TWIN+","+sTFR+": WAD "+ShortName); SetIndexLabel(5,NULL); //--- SetIndexLabel(6,DrawArrows%2!=0 ? TWIN+","+sTFR+": Arrow BUY" : NULL); SetIndexLabel(7,DrawArrows%2!=0 ? TWIN+","+sTFR+": Arrow SELL" : NULL);//------ "короткое имя" для DataWindow и подокна индикатора + и/или "уникальное имя индикатора" // +WindowExpertName()+ IndicatorShortName(TWIN+","+sTFR+": Williams AD AG+TT "+ShortName+" "); //"±"+(string)cStep // //--- PREF = TWIN+","+sTFR+":WADSEDOV"+ShortName; ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,1);//------ рисуем Кнопку if (ObjectFind(0,PrefBT)<0) DrawBUTTON(0,PrefBT,buttName,buttColor,backColor,winTotal,true); //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//****************************************************************************return(0);}//****************************************************************************//*** Real Price Chart ***//**************************************************************************** void DrawHistoLine(){ if (!boHist2) return; int CHTSCL, HSTS; int wSZ, bSZ; //SZH;//------- получим значение свойства Масштаба графика CHTSCL = ChartGetInteger(0,CHART_SCALE,0); //------ АвтоМасштаб для гистограммы..... switch(CHTSCL) { case 0 : HSTS=0; wSZ=0; bSZ=0; break; case 1 : HSTS=2; wSZ=0; bSZ=0; break; case 2 : HSTS=2; wSZ=0; bSZ=2; break; case 3 : HSTS=4; wSZ=0; bSZ=3; break; case 4 : HSTS=8; wSZ=0; bSZ=6; break; case 5 : HSTS=16; wSZ=2; bSZ=13; break; default: HSTS=2; wSZ=0; bSZ=3; break; } //--- //SZH = (HistoAutoSize) ? HSTS : HistoSize; //------ настройка параметров отрисовки //int HSLT = (HistoSize>=0) ? DRAW_HISTOGRAM : DRAW_NONE; //enum showCD { LINE, HISTO }; //--- SetIndexStyle(3,nType34,EMPTY,bSZ); SetIndexStyle(4,nType34,EMPTY,bSZ); color fake = ChartGetInteger(0,CHART_COLOR_BACKGROUND); SetIndexStyle(5,boHist2?DRAW_HISTOGRAM:DRAW_NONE,EMPTY,bSZ,fake); } //****************************************************************************//*** Custom indicator deinitialization function ***//****************************************************************************//void OnDeinit(const int reason) { ObjectsDeleteAll(0,PREF,-1,-1); } //int deinit() { ALL_OBJ_DELETE(); Comment(""); return(0); }void OnDeinit(const int reason){ ALL_OBJ_DELETE(PREF); Comment(""); //--- switch(reason) { //case REASON_PARAMETERS : case REASON_CHARTCHANGE : case REASON_RECOMPILE : case REASON_CLOSE : break; default : ObjectDelete(0,PrefBT); }} //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//****************************************************************************void ALL_OBJ_DELETE(string Pref){ string name; for (int s=ObjectsTotal(0,-1,-1)-1; s>=0; s--) { name=ObjectName(0,s,-1,-1); if (StringSubstr(name,0,StringLen(Pref))==Pref) ObjectDelete(0,name); }}//****************************************************************************//*** Custom indicator iteration function ***//****************************************************************************int start(){ if (buttYes && objSTATE(PrefBT)=="OFF") return(0); TikKont++; if (TikKont%3==0) { //--- int CountedBars=IndicatorCounted(); if (CountedBars<0) return(-1); //Стандарт+Tankk-Вариант!!! if (CountedBars>0) CountedBars--; int minBars=fmin(iBars(TWIN,0),iBars(TWIN,TimeFrame)); int limit=fmin(iBars(TWIN,0)-CountedBars-1+TFK,minBars-3-MAX); //+MAX*10*TFK if (History>MAX) limit=fmin(History+MAX*3,minBars-3-MAX); //Comment(limit); if (NewTime!=iTime(TWIN,0,0)+3) { ALL_OBJ_DELETE(PREF); if (History<=MAX) limit=minBars-1; NewTime=iTime(TWIN,0,0)+3; } //Time[0] //--- for (int i=0; i<9; i++) { SetIndexEmptyValue(i,0); //--- значение 0 отображаться не будет if (History>MAX) SetIndexDrawBegin(i,Bars-History); //--- пропуск отрисовки первых баров if (History<=MAX) SetIndexDrawBegin(i,MAX*1); } //--- пропуск отрисовки первых баров //+++======================================================================+++//+++ Williams AD +MA MTF TT [x3 AG] +++//+++======================================================================+++ for (i=limit; i>=0; i--) //for (i=0; i<limit; i++) { int y = iBarShift(TWIN,TimeFrame,iTime(TWIN,0,i+0),false); //int x = y; if (i<iBars(TWIN,0)-1) x = iBarShift(TWIN,TimeFrame,iTime(TWIN,0,i+1)); //if (i>iBars(TWIN,TimeFrame)-3) continue; //--- double TRH = fmax(iHigh(TWIN,TimeFrame,y), iClose(TWIN,TimeFrame,y+1)); double TRL = fmin(iLow(TWIN,TimeFrame,y), iClose(TWIN,TimeFrame,y+1)); double AD = 0; //--- //раньше был просто _Point, сейчас чуть-чуть запаздывает :-)) if (iClose(TWIN,TimeFrame,y) > iClose(TWIN,TimeFrame,y+1)+PONT*PipStep) AD = iClose(TWIN,TimeFrame,y)-TRL; if (iClose(TWIN,TimeFrame,y) < iClose(TWIN,TimeFrame,y+1)-PONT*PipStep) AD = iClose(TWIN,TimeFrame,y)-TRH; //--- MAIN[i]=0; MAIN[i] = fabs(MAIN[i+1]+AD); //MAIN[i+1]+AD; // } //*конец цикла* //+++======================================================================+++//+++ Williams AD +MA MTF TT [x3 AG] +++//+++======================================================================+++ for (i=limit; i>=0; i--) //for (i=0; i<limit; i++) { SIG11[i]=0; SIG11[i] = Signal1>0 ? iMAOnArray(MAIN,0,Signal1,0,Method1,i) : 0; SIG22[i]=0; SIG22[i] = Signal2>0 ? iMAOnArray(MAIN,0,Signal2,0,Method2,i) : 0; SIG33[i]=0; SIG33[i] = Signal3>0 ? iMAOnArray(MAIN,0,Signal3,0,Method3,i) : 0; //--- //--- //if (!boHist) continue; //enum MAtype { nHide, nLines, nCloud }; FAKE1[i] = boHist1 ? fmin(SIG11[i],SIG22[i]) : 0; FAKE2[i] = boHist2 ? fmin(SIG33[i],MAIN[i]) : 0; //--- //--- FLAG[i]=0; ARRUP[i]=0; ARRDN[i]=0; //--- if (DrawArrows<1 || SIG22[i]==0 || SIG33[i]==0 || i>iBars(TWIN,0)-3-MAX*1 || (History>MAX && i>History)) continue; //обрезал историю для стрелок... //--- double pMin = Line12type>0 || Line34type>0 ? fmin(fmin(MAIN[i],SIG11[i]!=0?SIG11[i]:MAIN[i]),fmin(SIG22[i],SIG33[i])) : MAIN[i]; //ShowMA>-1 ? fmin(Low[i],MAIN[i]) : Low[i]; double pMax = Line12type>0 || Line34type>0 ? fmax(fmax(MAIN[i],SIG11[i]!=0?SIG11[i]:MAIN[i]),fmin(SIG22[i],SIG33[i])) : MAIN[i]; //ShowMA>-1 ? fmax(High[i],MAIN[i]) : High[i]; //--- if (SIG22[i+ARB] > SIG33[i+ARB] && SIG22[i+1+ARB] <= SIG33[i+1+ARB]) { ARRUP[i] = SubWinARROW("buy",MAIN[i],pMin,i); GraphARROW(i,false,"ArrUP"); } if (SIG22[i+ARB] < SIG33[i+ARB] && SIG22[i+1+ARB] >= SIG33[i+1+ARB]) { ARRDN[i] = SubWinARROW("sell",MAIN[i],pMax,i); GraphARROW(i,true,"ArrDN"); } } //*конец цикла* //****************************************************************************//*** CCI Fastest ***//**************************************************************************** if (DrawArrows>0 && (AlertsMessage || AlertsEmail || AlertsMobile || AlertsSound)) { string sufix="", mesaga=""; // if (TimeBar!=iTime(TWIN,TimeFrame,0) && ARRUP[SGB]!=0) { mesaga = WindowExpertName()+" >> "+TWIN+", "+cTFR+" >> Arrow BUY"; //SymbolInfoString(TWIN,SYMBOL_DESCRIPTION) if (AlertsMessage) Alert(mesaga); if (AlertsEmail) SendMail(_Symbol,mesaga); if (AlertsMobile) SendNotification(mesaga); if (AlertsSound) PlaySound(SoundFile); //"stops.wav" //"news.wav" TimeBar=iTime(TWIN,TimeFrame,0); } //return(0); //--- else if (TimeBar!=iTime(TWIN,TimeFrame,0) && ARRDN[SGB]!=0) { mesaga = WindowExpertName()+" << "+TWIN+", "+cTFR+" << Arrow SELL"; if (AlertsMessage) Alert(mesaga); if (AlertsEmail) SendMail(_Symbol,mesaga); if (AlertsMobile) SendNotification(mesaga); if (AlertsSound) PlaySound(SoundFile); //"stops.wav" //"news.wav" TimeBar=iTime(TWIN,TimeFrame,0); } //return(0); } } if (TikKont>333) TikKont=0; //*конец* АЛЕРТОВ для всех..... //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//****************************************************************************return(0);}//****************************************************************************//*** MACD Fastest ***//****************************************************************************string StringUpper(string s) { int i, c, n, k=StringLen(s); for (i=0; i<k; i++) { n = 0; c = StringGetChar(s,i); if (c>96 && 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);}//****************************************************************************//*** AO Zotik v3 AA MTF TT ***//****************************************************************************double SubWinARROW(string BuySell, double MASTER, double SLAVE, int i) //double& SLAVE[], { //if (DrawArrows%2==0) return(0); //enum setARR { onOFF, onInduk, onChart, onBoth }; double arrUP, arrDN, exit, GAP=ArrowGapSubwin*PONT; //*SymbolInfoDouble(TWIN,SYMBOL_POINT)*pow(10,SymbolInfoInteger(TWIN,SYMBOL_DIGITS)%2); //_Point*pow(10,Digits%2); //--- switch(ShowArrows) { //enum showARR { HideArrows, aINSIDE, aCENTER, aOUTSIDE }; case 0: arrUP=888; arrDN=-888; break; case 1: arrUP=fmax(MASTER,SLAVE)+GAP; arrDN=fmin(MASTER,SLAVE)-GAP; break; case 2: arrUP=arrDN=MASTER; break; //(iHigh(TWIN,0,i)+iLow(TWIN,0,i))/2; case 3: arrUP=fmin(MASTER,SLAVE)-GAP; arrDN=fmax(MASTER,SLAVE)+GAP; break; } //--- if (BuySell=="buy") exit = arrUP; //&& MASTER[i] > SLAVE[i] && MASTER[i+1] <= SLAVE[i+1] if (BuySell=="sell") exit = arrDN; // && MASTER[i] < SLAVE[i] && MASTER[i+1] >= SLAVE[i+1]//--- return(exit);} //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%% Accumulation Distribution Level [ADL] %%%//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%bool GraphARROW(int i, bool DOWN, string Name) //, int ARRCOD, int ARRSIZE) //, double gap, color ARRCOLOR){ if (DrawArrows<2 || ShowArrows<1) return(false); //------ //int DGTS = Digits; if (Digits==3 || Digits==5) DGTS-=1; string objName = PREF+Name+(string)Time[i]; //TimeToStr(Time[i],TIME_MINUTES)+"_"+DoubleToStr(Close[i],DGTS); //double Gap = 2.0*iATR(NULL,0,20,z)/4.0; double gap=ArrowGapChart*_Point*pow(10,Digits%2); //(Digits%2==1) ? _Point*10 : _Point; //*_Point; if (Digits==3 || Digits==5) gap*=10; //--- // имя для Стрелки if (!ObjectCreate(0,objName,OBJ_ARROW, 0, Time[i], 0)) return(false); //--- // создать стрелку по заданным координатам //ObjectSetInteger(0,objName,OBJPROP_ARROWCODE, ARRCOD); // код стрелки //ObjectSetInteger(0,objName,OBJPROP_ANCHOR, ANCHOR_CENTER); // угол привязки стрелки //ObjectSetInteger(0,objName,OBJPROP_COLOR, ARRCOLOR); // цвет стрелки ObjectSetInteger(0,objName,OBJPROP_STYLE, STYLE_SOLID); // стиль окаймляющей линии ObjectSetInteger(0,objName,OBJPROP_WIDTH, ArrowSize); // размер стрелки ObjectSetInteger(0,objName,OBJPROP_BACK, false); // на заднем плане ObjectSetInteger(0,objName,OBJPROP_SELECTABLE, false); // объект можно выделять ObjectSetInteger(0,objName,OBJPROP_SELECTED, false); // выделить для перемещений ObjectSetInteger(0,objName,OBJPROP_HIDDEN, false); // скрыт в списке объектов ObjectSetInteger(0,objName,OBJPROP_ZORDER, 0); // приоритет на нажатие мышью //------ enum showAR { HideArrows, aINSIDE, aCENTER, aOUTSIDE }; double arHIGH = (ShowArrows==1) ? Low[i]-gap : (ShowArrows==2) ? (High[i]+Low[i])/2 : High[i]+gap; double arLOW = (ShowArrows==1) ? High[i]+gap : (ShowArrows==2) ? (High[i]+Low[i])/2 : Low[i] -gap;//------ if (DOWN) { ObjectSetDouble(0,objName,OBJPROP_PRICE1, arHIGH); ObjectSetInteger(0,objName,OBJPROP_ARROWCODE, CodeSELL); ObjectSetInteger(0,objName,OBJPROP_ANCHOR, ANCHOR_BOTTOM); ObjectSetInteger(0,objName,OBJPROP_COLOR, ColorSELL); ObjectSetText(objName, "setup for SELL", 10, "Verdana", clrRed); } //------ if (!DOWN) { ObjectSetDouble(0,objName,OBJPROP_PRICE1, arLOW); ObjectSetInteger(0,objName,OBJPROP_ARROWCODE, CodeBUY); ObjectSetInteger(0,objName,OBJPROP_ANCHOR, ANCHOR_TOP); ObjectSetInteger(0,objName,OBJPROP_COLOR, ColorBUY); ObjectSetText(objName, "setup for BUY", 10, "Verdana", clrWhite); } //------return(true);}//****************************************************************************//*** Custom indicator ChartEvent function ***//****************************************************************************string preState[2], buttON[2], PrefBT = "bWADSEDOV"+ShortName; //+StringConcatenate("[",History,">",ShowSupRes,"]"); //StringConcatenate("iSRSSR[",axisX,"x",axisY,"]","but"); //= "a"+PREF+"but"; //"bAKHR"+ShortName; //------void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if (id==CHARTEVENT_OBJECT_CLICK && sparam==PrefBT) getOnOff(0,PrefBT); //--- if (buttON[0]!="OFF" && id==CHARTEVENT_CHART_CHANGE && boHist2) { /*ChartSetInteger(0,CHART_FOREGROUND,0,false);*/ NewTime=0; DrawHistoLine(); ChartRedraw(0); } //--- if (id==CHARTEVENT_CHART_CHANGE && winTotal!=WindowsTotal()-1) { winTotal = WindowsTotal()-1; DrawBUTTON(0,PrefBT,buttName, (buttON[0]!="OFF"?buttColor:clrBlack), backColor,winTotal, (buttON[0]!="OFF"?true:false)); ChartRedraw(0); }}//****************************************************************************//*** CastIron PriceAction ***//****************************************************************************string objSTATE(string Name){ return( ObjectGetInteger(0,Name,OBJPROP_STATE) ? "ON" : "OFF" );}//****************************************************************************//*** Akomuto Hirovato ***//**************************************************************************** void getOnOff(int NB, string Name){ buttON[NB] = objSTATE(Name); if (buttON[NB]!=preState[NB]) if (buttON[NB]=="OFF") { InitZero(NB); ObjectSetInteger(0,Name,OBJPROP_COLOR, clrBlack); preState[NB] = buttON[NB]; ChartRedraw(0); } else { /*init();*/ TikKont=2; NewTime=0; /*BtfTime=0; TxtTime=0;*/ start(); ObjectSetInteger(0,Name,OBJPROP_COLOR, buttColor); preState[NB] = buttON[NB]; ChartRedraw(0); }}//****************************************************************************//*** MA 2Smoothed AA MTF TT ***//****************************************************************************bool buttYes = buttColor!=clrNONE && buttSize>4; int winTotal=0; double bLen=fmax(1,StringLen(buttName)*1.15); bool DrawBUTTON(int NB, string Name, string Text, color txtClr=clrWhite, color bckClr=clrBlack, int winTot=0, bool OnOff=false) { if (buttColor==clrNONE || buttSize<5) return(false); //--- string objName = Name; //PREF+ //+(string)i; //+TimeToStr(iTime(NULL,0,i),TIME_MINUTES)+"_"+(string)Close[i],DGTS); //--- пред-удаление обектов ObjectDelete(0,objName); //Comment( (string)bLen ); //--- создадим кнопку if (!ObjectCreate(0,objName,OBJ_BUTTON, fmax(0,fmin(buttWindow,winTot)), 0, 0)) return(false); //--- установим координаты кнопки double XX = (buttCorner==0||buttCorner==2) ? 5+axisX : 10*buttSize/1.35+axisX; double YY = (5+axisY)+buttSize*2.25*NB; ObjectSetInteger(0,objName,OBJPROP_XDISTANCE, (int)XX); // координата по оси X ObjectSetInteger(0,objName,OBJPROP_YDISTANCE, (int)YY); // координата по оси Y ObjectSetInteger(0,objName,OBJPROP_XSIZE, int(buttSize*bLen)); // ширина кнопки //133 ObjectSetInteger(0,objName,OBJPROP_YSIZE, int(buttSize*2.0)); // высота кнопки //33 ObjectSetInteger(0,objName,OBJPROP_CORNER, buttCorner); // угол графика для привязки кнопки //CORNER_LEFT_UPPER ObjectSetString (0,objName,OBJPROP_TEXT, Text); // текст ObjectSetString (0,objName,OBJPROP_FONT, "Arial Black"); // шрифт ObjectSetInteger(0,objName,OBJPROP_FONTSIZE, buttSize); // размер шрифта ObjectSetInteger(0,objName,OBJPROP_COLOR, txtClr); // цвет текста ObjectSetInteger(0,objName,OBJPROP_BGCOLOR, bckClr); // цвет фона //C'236,233,216' ObjectSetInteger(0,objName,OBJPROP_BORDER_COLOR, clrNONE); // цвет границы ObjectSetInteger(0,objName,OBJPROP_BACK, false); // на заднем плане ObjectSetInteger(0,objName,OBJPROP_SELECTABLE, false); // кнопку можно выделить ObjectSetInteger(0,objName,OBJPROP_SELECTED, false); // выделить для перемещений ObjectSetInteger(0,objName,OBJPROP_HIDDEN, false); // скрыт в списке объектов ObjectSetInteger(0,objName,OBJPROP_ZORDER, 0); // приоритет на нажатие мышью ObjectSetInteger(0,objName,OBJPROP_STATE, OnOff); // кнопка нажата/отжата //--- успешное выполнение return(true); } //****************************************************************************//*** ATRMA Levels MTF TT ***//****************************************************************************void InitZero(int NB){ ArrayInitialize(SIG11,0.0); ArrayInitialize(SIG22,0.0); ArrayInitialize(FAKE1,0.0); ArrayInitialize(SIG33,0.0); ArrayInitialize(MAIN,0.0); ArrayInitialize(FAKE2,0.0); ArrayInitialize(ARRUP,0.0); ArrayInitialize(ARRDN,0.0); ArrayInitialize(FLAG,0.0); //for (int i=0; i<Bars-1; i++) ObjectDelete(0,PREF+"day"+(string)i); if (NB<1) ALL_OBJ_DELETE(PREF); //ObjectsDeleteAll(0,PREF0,-1,-1); }=================================================+++由于时间有限加上对源码的追溯做不到最终解释权,所以我们提供的源码EA仅仅只能用来做模拟测试使用,严格禁止商业使用和跑实盘!