Menu
Brokers
MT4 Forex Brokers
MT5 Forex brokers
PayPal Brokers
Skrill Brokers
Oil Trading Brokers
Gold Trading Brokers
Web Browser Platform
Brokers with CFD Trading
ECN Brokers
Bitcoin FX Brokers
PAMM Forex Brokers
With Cent Accounts
With High Leverage
Cryptocurrency Brokers
Forums
All threads
New threads
New posts
Trending
Search forums
What's new
New threads
New posts
Latest activity
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Reply to thread
Forums
Trading Platforms
MetaTrader Indicators
90% Accurate Indicator! "Super Signal" For MT5 (Little Modification NEEDED)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
[QUOTE="mrrich06, post: 166691, member: 28719"] Respected Admin, Sorry for the late reply. I followed your guidelines above and did exactly what you have said. Everything works fine only except there is no alert sound when the arrow appears. So, i was wondering how do i fix this then suddenly i came up with an idea of adding a small line of code to my function that displays Buy Arrow and Sell Arrow. for Buy Arrow [code=mql5]printf("Alert function of BUY Arrow has been run.");[/code] for Sell Arrow [code=mql5]printf("Alert function of SELL Arrow has been run.");[/code] I added the above line to my functions just to diagnose the issue. So, after adding it, I fired up the terminal and checked the EXPERTS tab in the terminal and what i found out was that the alert function code does not reaches to the part where the alert is produced at all. And again at last I'm still left with empty handed without the alert sound produced. Maybe there might be some mistake made by me so can you please have a look on the below code. [code=mql5]//+------------------------------------------------------------------+ //| super-signals.mq5 | //| Copyright © 2006, Nick Bilak, beluck[AT]gmail.com | //| http://www.forex-tsd.com/ | //+------------------------------------------------------------------+ #property copyright "CCopyright © 2006, Nick Bilak, beluck[AT]gmail.com" #property link "http://www.forex-tsd.com/" #property description "super-signals" //---- indicator version number #property version "1.00" //---- drawing the indicator in the main window #property indicator_chart_window //---- two buffers are used for calculation of drawing of the indicator #property indicator_buffers 2 //---- only two plots are used #property indicator_plots 2 //+----------------------------------------------+ //| Bearish indicator drawing parameters | //+----------------------------------------------+ //---- drawing the indicator 1 as a symbol #property indicator_type1 DRAW_ARROW //---- DeepPink color is used for the indicator bearish line #property indicator_color1 clrDeepPink //---- indicator 1 line width is equal to 4 #property indicator_width1 2 //---- bullish indicator label display #property indicator_label1 "super-signals Sell" //+----------------------------------------------+ //| Bullish indicator drawing parameters | //+----------------------------------------------+ //---- drawing the indicator 2 as a line #property indicator_type2 DRAW_ARROW //---- DodgerBlue color is used as the color of the bullish line of the indicator #property indicator_color2 clrDodgerBlue //---- indicator 2 line width is equal to 4 #property indicator_width2 2 //---- bearish indicator label display #property indicator_label2 "super-signals Buy" #define RESET 0 // The constant for getting the command for the indicator recalculation back to the terminal //+----------------------------------------------+ //| Indicator input parameters | //+----------------------------------------------+ input uint dist=5; //For Alet--------------------------------------- input int TriggerCandle=1; input bool EnableNativeAlerts = true; input bool EnableSoundAlerts = true; input string SoundFileName="alert.wav"; datetime LastAlertTime = D'01.01.1970'; int LastAlertDirection = 0; //+----------------------------------------------+ //---- declaration of dynamic arrays that will further be // used as indicator buffers double SellBuffer[]; double BuyBuffer[]; //---- declaration of the integer variables for the start of data calculation int min_rates_total,ATRPeriod; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //---- initialization of global variables ATRPeriod=10; min_rates_total=int(MathMax(dist+1,ATRPeriod)); //---- set dynamic array as an indicator buffer SetIndexBuffer(0,SellBuffer,INDICATOR_DATA); //---- shifting the start of drawing of the indicator 1 PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,min_rates_total); //--- create a label to display in DataWindow PlotIndexSetString(0,PLOT_LABEL,"super-signals Sell"); //---- indicator symbol PlotIndexSetInteger(0,PLOT_ARROW,242); //---- indexing elements in the buffer as time series ArraySetAsSeries(SellBuffer,true); //---- setting the indicator values that won't be visible on a chart PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0); //---- set dynamic array as an indicator buffer SetIndexBuffer(1,BuyBuffer,INDICATOR_DATA); //---- shifting the start of drawing of the indicator 2 PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,min_rates_total); //--- Create label to display in DataWindow PlotIndexSetString(1,PLOT_LABEL,"super-signals Buy"); //---- indicator symbol PlotIndexSetInteger(1,PLOT_ARROW,241); //---- indexing elements in the buffer as time series ArraySetAsSeries(BuyBuffer,true); //---- setting the indicator values that won't be visible on a chart PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,0); //---- Setting the format of accuracy of displaying the indicator IndicatorSetInteger(INDICATOR_DIGITS,_Digits); //---- name for the data window and the label for sub-windows string short_name="super-signals"; IndicatorSetString(INDICATOR_SHORTNAME,short_name); //---- } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ 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[]) { //---- checking for the sufficiency of bars for the calculation if(rates_total<min_rates_total) return(RESET); //---- declaration of local variables int limit; //--- calculations of the necessary amount of data to be copied and //the limit starting index for loop of bars recalculation if(prev_calculated>rates_total || prev_calculated<=0)// checking for the first start of the indicator calculation limit=rates_total-min_rates_total; // starting index for calculation of all bars else limit=int(rates_total-prev_calculated+dist/2); // starting index for calculation of new bars //---- indexing elements in arrays as time series ArraySetAsSeries(low,true); ArraySetAsSeries(high,true); //---- main loop of the indicator calculation for(int bar=0; bar<limit && !IsStopped(); bar++) { double AvgRange=0.0; for(int count=bar; count<=bar+ATRPeriod; count++) AvgRange+=MathAbs(high[count]-low[count]); double Range=AvgRange/ATRPeriod; Range/=3; SellBuffer[bar]=0; BuyBuffer[bar]=0; uint barX=bar-dist/2; int HH=ArrayMaximum(high,barX,dist); int LL=ArrayMinimum(low,barX,dist); if(bar==HH) SellBuffer[bar]=high[HH]+Range; if(bar==LL) BuyBuffer[bar]=low[LL]-Range; } //---- //For Alert---------------------------------------------------------- if(((TriggerCandle>0) && (time[0]>LastAlertTime)) || (TriggerCandle==0)) { string Text; // Up Arrow Alert if((BuyBuffer[TriggerCandle]>0) && ((TriggerCandle>0) || ((TriggerCandle==0) && (LastAlertDirection!=1)))) { printf("Alert function of BUY Arrow has been run."); Text="Super_Signal: "+Symbol()+" - "+EnumToString(Period())+" - Up."; if(EnableNativeAlerts) Alert(Text); if(EnableSoundAlerts) PlaySound(SoundFileName); LastAlertTime=time[0]; LastAlertDirection=1; } // Down Arrow Alert if((SellBuffer[TriggerCandle]>0) && ((TriggerCandle>0) || ((TriggerCandle==0) && (LastAlertDirection!=-1)))) { printf("Alert function of SELL Arrow has been run."); Text="Super_Signal: "+Symbol()+" - "+EnumToString(Period())+" - Down."; if(EnableNativeAlerts) Alert(Text); if(EnableSoundAlerts) PlaySound(SoundFileName); LastAlertTime=time[0]; LastAlertDirection=-1; } } //------------------------------------------------------------------- return(rates_total); } //+------------------------------------------------------------------+ [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Top
Bottom
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…