Can You Please add a breadcrumb trail to this indicator before the close of the candle? A dash is fine.
Attached File(s)
I will code your scalping EAs for no charge 120 replies
Oanda MT4 - Indicators and EAs not showing 2 replies
I will code your pivot EAs for no charge 20 replies
EAs and indicators relating to moutaki... 22 replies
InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply
Disliked{quote} not working like before only for daily line nvm its okey i see when activate line is from weekly but can u make options to be only 1 line every monday to fridayIgnored
Disliked...how limit the length of the line from 09:15 to 22:00 or end of day? /////////// input string StartTime = "09:20"; // Start Trading Time input string StopTime = "22:00"; // Stop Trading Time...Ignored
//+------------------------------------------------------------------+ //| KiS_max_min_Channels.mq5 | //| Copyright :copyright: 2007, KCBT | //| http://www.kcbt.ru/forum/index.php?/ | //+------------------------------------------------------------------+ #property copyright "Copyright :copyright: 2007, KCBT" #property link "http://www.kcbt.ru/forum/index.php?/" #property description "KiS_max_min_Channels" //---- indicator version number #property version "1.00" //---- drawing the indicator in the main window #property indicator_chart_window //---- number of indicator buffers #property indicator_buffers 3 //---- only three plots are used #property indicator_plots 3 //+-----------------------------------+ //| Indicator drawing parameters | //+-----------------------------------+ //---- drawing the indicator as a line //#property indicator_type1 DRAW_LINE //---- Purple color is used as the color of the indicator line //#property indicator_color1 clrPurple //---- indicator line is a solid curve //#property indicator_style1 STYLE_SOLID //---- indicator line width is equal to 1 //#property indicator_width1 1 //---- displaying the indicator label //#property indicator_label1 "KiS_max_min_Channels Middle" //+--------------------------------------------------+ //| Envelope levels indicator drawing parameters | //+--------------------------------------------------+ //---- drawing the levels as lines #property indicator_type2 DRAW_LINE #property indicator_type3 DRAW_LINE //---- selection of levels colors #property indicator_color2 clrBlue #property indicator_color3 clrDarkOrange //---- óðîâíè - ñïëîøíûå êðèâûå #property indicator_style2 STYLE_SOLID #property indicator_style3 STYLE_SOLID //---- levels width is equal to 1 #property indicator_width2 1 #property indicator_width3 1 //---- display levels labels #property indicator_label2 "KiS_max_min_Channels Upper" #property indicator_label3 "KiS_max_min_Channels Lower" //+-----------------------------------+ //| Declaration of constants | //+-----------------------------------+ #define RESET 0 // The constant for returning the indicator recalculation command to the terminal //+-----------------------------------+ //| INDICATOR INPUT PARAMETERS | //+-----------------------------------+ input int Shift=0; // horizontal shift of the indicator in bars //+-----------------------------------+ //---- declaration of a dynamic array that further // will be used as an indicator buffer double ExtLineBuffer0[]; //---- declaration of dynamic arrays that will further be // used as indicator buffers double ExtLineBuffer1[],ExtLineBuffer2[]; //---- Declaration of integer variables of data starting point int min_rates_total; //+------------------------------------------------------------------+ //| KiS_max_min_Channels indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //---- Initialization of variables of the start of data calculation min_rates_total=50; //---- set dynamic array as an indicator buffer //SetIndexBuffer(0,ExtLineBuffer0,INDICATOR_DATA); //---- moving the indicator 1 horizontally //PlotIndexSetInteger(0,PLOT_SHIFT,Shift); //---- performing the shift of beginning of indicator drawing //PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,min_rates_total); //---- setting the indicator values that won't be visible on a chart //PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0); //---- indexing buffer elements as time series //ArraySetAsSeries(ExtLineBuffer0,true); //---- setting dynamic arrays as indicator buffers SetIndexBuffer(1,ExtLineBuffer1,INDICATOR_DATA); SetIndexBuffer(2,ExtLineBuffer2,INDICATOR_DATA); //---- set the position, from which the levels drawing starts PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,min_rates_total); PlotIndexSetInteger(2,PLOT_DRAW_BEGIN,min_rates_total); //---- restriction to draw empty values for the indicator PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,EMPTY_VALUE); PlotIndexSetDouble(2,PLOT_EMPTY_VALUE,EMPTY_VALUE); //---- indexing buffer elements as time series ArraySetAsSeries(ExtLineBuffer1,true); ArraySetAsSeries(ExtLineBuffer2,true); //--- creation of the name to be displayed in a separate sub-window and in a pop up help IndicatorSetString(INDICATOR_SHORTNAME,"KiS_max_min_Channels"); //--- determining the accuracy of displaying the indicator values IndicatorSetInteger(INDICATOR_DIGITS,_Digits); //---- end of initialization } //+------------------------------------------------------------------+ //| KiS_max_min_Channels deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //---- Comment(""); //---- } //+------------------------------------------------------------------+ //| KiS_max_min_Channels iteration function | //+------------------------------------------------------------------+ int OnCalculate( const int rates_total, // amount of history in bars at the current tick const int prev_calculated,// amount of history in bars at the previous tick 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[] ) { //---- checking the number of bars to be enough for calculation if(rates_total<min_rates_total) return(RESET); //---- declaration of variables with a floating point double D1High[1],D1Low[1],D1Close[1],D1Open[1]; //---- time variables declaration datetime D1Time[1]; //---- Declaration of integer variables int limit,bar; static uint LastCountBar; //---- calculation of the starting number limit for the bar recalculation loop if(prev_calculated>rates_total || prev_calculated<=0)// checking for the first start of the indicator calculation { limit=rates_total-min_rates_total-1; // starting index for the calculation of all bars LastCountBar=rates_total; } else limit=int(LastCountBar)+rates_total-prev_calculated; // starting index for the calculation of new bars //---- indexing elements in arrays as timeseries ArraySetAsSeries(time,true); ArraySetAsSeries(close,true); //---- Main calculation loop of the indicator for(bar=limit; bar>=0 && !IsStopped(); bar--) { datetime previousDayTime = time[bar] - PeriodSeconds(PERIOD_D1); // Subtracts 1 day //---- copy newly appeared data into the arrays if(CopyTime(Symbol(),PERIOD_D1,time[bar],1,D1Time)<=0) return(RESET); if(CopyHigh(Symbol(),PERIOD_D1,previousDayTime,1,D1High)<=0) return(RESET); if(CopyLow(Symbol(),PERIOD_D1,previousDayTime,1,D1Low)<=0) return(RESET); ExtLineBuffer1[bar]=D1High[0]; //ExtLineBuffer0[bar]=(D1High[0]+D1Low[0])/2; ExtLineBuffer2[bar]=D1Low[0]; if(time[bar]>=D1Time[0] && time[bar+1]<D1Time[0]) LastCountBar=bar; } //---- copy newly appeared data into the arrays if(CopyOpen(Symbol(),PERIOD_D1,time[0],1,D1Open)<=0) return(RESET); //Comment("Daily high:",D1High[0]," Daily low:",D1Low[0],"\n","Channel middle:",ExtLineBuffer0[0]," Øèðèíà êàíàëà:", //(D1High[0]+D1Low[0])/_Point,"\n","From the channel middle to Open:",MathRound(MathAbs(ExtLineBuffer0[0]-D1Open[0])/_Point), //"\n","From the channel middle to Close:",MathRound(MathAbs(ExtLineBuffer0[0]-close[0])/_Point)); //---- return(rates_total); } //+------------------------------------------------------------------+
//+------------------------------------------------------------------+ //| Weekly_HILO_Shj | //| | //| http://www.metaquotes.ru | //+------------------------------------------------------------------+ #property copyright "Copyright :copyright: 2005, " #property link "http://" //---- #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Tomato #property indicator_color2 DeepSkyBlue #property indicator_color3 LimeGreen #property indicator_width1 2 #property indicator_width2 2 //---- input parameters //---- buffers extern bool Monatlich=false; extern bool Jaehrlich=false; extern bool Stuendlich=false; extern int space=44; extern bool Allert = true; extern string Sound_High="mtp1.wav"; extern string Sound_Low="mtp2.wav"; //extern string Sound_Mid="mtp3.wav"; extern bool Email = false; double PrevWeekHiBuffer[]; double PrevWeekLoBuffer[]; double PrevWeekMidBuffer[]; int fontsize=10; double x; double PrevWeekHi, PrevWeekLo, LastWeekHi, LastWeekLo,PrevWeekMid; string Space; //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { ObjectDelete("PrevWeekHi"); ObjectDelete("PrevWeekLo"); ObjectDelete("PrevWeekMid"); string WHLTrend="WHLTrend "+WindowHandle(Symbol(),0); if(GlobalVariableCheck(WHLTrend))GlobalVariableDel(WHLTrend); return(0); } //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; int y; //---- SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); //SetIndexStyle(2,DRAW_LINE, STYLE_DOT); SetIndexBuffer(0, PrevWeekHiBuffer); SetIndexBuffer(1, PrevWeekLoBuffer); //SetIndexBuffer(2, PrevWeekMidBuffer); short_name="Prev Hi-Lo levels"; IndicatorShortName(short_name); SetIndexLabel(0, short_name); //SetIndexDrawBegin(0,1); //---- for(y=0;y<=space;y++) { Space=Space+" "; } string WHLTrend="WHLTrend "+WindowHandle(Symbol(),0); if(GlobalVariableCheck(WHLTrend))GlobalVariableDel(WHLTrend); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int limit, i; if (counted_bars==0) { x=Period(); if (x>10080) return(-1); //ObjectCreate("PrevWeekHi", OBJ_TEXT, 0, 0, 0); //ObjectSetText("PrevWeekHi", Space+"HIGH",fontsize,"Arial", Tomato); //ObjectCreate("PrevWeekLo", OBJ_TEXT, 0, 0, 0); //DObjectSetText("PrevWeekLo", Space+"LOW",fontsize,"Arial", DeepSkyBlue); //ObjectCreate("PrevWeekMid", OBJ_TEXT, 0, 0, 0); //ObjectSetText("PrevWeekMid", Space+"50% hi-low ",fontsize,"Arial", LimeGreen); } limit=(Bars-counted_bars)-1; for(i=limit; i>=0;i--) { if (High[i+1]>LastWeekHi) LastWeekHi=High[i+1]; if (Low [i+1]<LastWeekLo) LastWeekLo=Low [i+1]; if(Monatlich){ if (TimeMonth(Time[i])!=TimeMonth(Time[i+1])) { //if(TimeDayOfWeek(Time[i])==1) //{ PrevWeekHi =LastWeekHi; PrevWeekLo =LastWeekLo; LastWeekHi =Open[i]; LastWeekLo =Open[i]; PrevWeekMid=(PrevWeekHi + PrevWeekLo)/2; //} } } else if(Jaehrlich){ if ( TimeYear(Time[i])!= TimeYear(Time[i+1]) ) { //if(TimeDayOfWeek(Time[i])==1) //{ PrevWeekHi =LastWeekHi; PrevWeekLo =LastWeekLo; LastWeekHi =Open[i]; LastWeekLo =Open[i]; PrevWeekMid=(PrevWeekHi + PrevWeekLo)/2; //} } } else if(Stuendlich){ if ( TimeDay(Time[i])!= TimeDay(Time[i+1]) ) { //if(TimeDayOfWeek(Time[i])==1) //{ PrevWeekHi =LastWeekHi; PrevWeekLo =LastWeekLo; LastWeekHi =Open[i]; LastWeekLo =Open[i]; PrevWeekMid=(PrevWeekHi + PrevWeekLo)/2; //} } } else { if (TimeDay(Time[i])!=TimeDay(Time[i+1])) { if(TimeDayOfWeek(Time[i])==1) { PrevWeekHi =LastWeekHi; PrevWeekLo =LastWeekLo; LastWeekHi =Open[i]; LastWeekLo =Open[i]; PrevWeekMid=(PrevWeekHi + PrevWeekLo)/2; } } } PrevWeekHiBuffer [i]=PrevWeekHi; PrevWeekLoBuffer [i]=PrevWeekLo; PrevWeekMidBuffer[i]=PrevWeekMid; //---- ObjectMove("PrevWeekHi" , 0, Time[i], PrevWeekHi); ObjectMove("PrevWeekLo" , 0, Time[i], PrevWeekLo); ObjectMove("PrevWeekMid", 0, Time[i], PrevWeekMid); } //+------------------------------------------------------------------+ //| Alert | //+------------------------------------------------------------------+ static int al1,al2,al3; string str; if(Monatlich)str="Monat"; else if(Jaehrlich)str="Jahres"; else if(Stuendlich)str="Stündliche"; else str="Wochen"; string WHLTrend="WHLTrend "+WindowHandle(Symbol(),0); if(Allert==true && al1!=1 && Bid>=PrevWeekHiBuffer[0]) { GlobalVariableSet(WHLTrend,1); al2=0;al3=0;al1=1; Alert("Weekly HILO Indikator ",str," Highlinie berührt , Symbol ",Symbol()," - Chartperiode ",Period());PlaySound(Sound_High); if(Email)SendMyMessage("Weekly HILO Indikator Highlinie","Weekly HILO Indikator "+str+" Highlinie berührt , Symbol "+Symbol()+" - Chartperiode "+Period()); } if(Allert==true && al2!=1 && Bid<=PrevWeekLoBuffer[0]) { GlobalVariableSet(WHLTrend,2); al2=1;al3=0;al1=0; Alert("Weekly HILO Indikator ",str," Lowlinie berührt , Symbol ",Symbol()," - Chartperiode ",Period());PlaySound(Sound_Low); if(Email)SendMyMessage("Weekly HILO Indikator Lowlinie","Weekly HILO Indikator "+str+" Lowlinie berührt , Symbol "+Symbol()+" - Chartperiode "+Period()); } //if(Allert==true && al3!=1 && Bid<=PrevWeekMidBuffer[0]+Point*2 && Bid>=PrevWeekMidBuffer[0]-Point*2) //{ //al2=0;al3=1;al1=0; //Alert("Weekly HILO Indikator ",str," Mittellinie berührt , Symbol ",Symbol()," - Chartperiode ",Period());PlaySound(Sound_Mid); //if(Email)SendMyMessage("Weekly HILO Indikator Mittellinie", "Weekly HILO Indikator "+str+" Mittellinie berührt , Symbol "+Symbol()+" - Chartperiode "+Period()); //} int trend=GlobalVariableGet(WHLTrend); Comment(trend," ",PrevWeekHiBuffer[0]); if(trend==1 && Bid<PrevWeekHiBuffer[0] && al1==1)GlobalVariableSet(WHLTrend,2); //else if(trend==2 && Bid>PrevWeekLoBuffer[0] && al2==1)GlobalVariableSet(WHLTrend,1); return(0); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //| Email | //+------------------------------------------------------------------+ int SendMyMessage(string betrf, string text) { int check; SendMail(betrf, text); check=GetLastError(); if(check!=0) { Print("Cannot send message, error: ",check); return(1); } else return(0); }
Disliked{quote} What do you mean by "limit the length"? In oninit you can check that the inputted string length is less than a number, by getting it's length via stringlen(). If you mean to limit the length of characters the user can manually type in, while they are typing, then nothing comes to mind, do all your input validation after values are inputted and the indicator is loaded/ing.Ignored
Disliked{quote} Need an example of this, what do I do to recreate the issue?Ignored
Disliked... both MT4 and MT5...MT4 script operates much more efficiently compared to the MT5 script... CopyTime... CopyHigh... CopyLow...... TimeMonth(Time[i]...Ignored
DislikedI try to limiting Moving Average drawing plot (input int MaxBar). But the result, after MaxBar, there's is vertical line down near to zero. I try use iClose buffer and Array Resize but the result still far from my expectation. What most effective method to remove/hide this zero value? {file} {image}Ignored
QuoteDislikedthe result, after MaxBar, there's is vertical line down near to zero
DislikedHi Jeanlouie at the moment the EA plots the lines over the whole chart {image} but I like to have the lines from start time to end of day {image} {quote}Ignored