당사 팬 페이지에 가입하십시오
Fisher_org_v1_Sign_Alert - MetaTrader 5용 지표
- 조회수:
- 4801
- 평가:
- 게시됨:
- 2016.10.10 14:36
- 업데이트됨:
- 2016.11.22 07:32
- 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
Real author:
TrendLaboratory Ltd.
Semaphore arrow signal indicator based on the Fisher_org_v1 oscillator leaving the overbought and oversold areas, which features alerts, sending emails and push-notifications to mobile devices.
The following changes have been made to the indicator code in order to implement the alerts, email messages and push-notifications:
- Introduced new input parameters
input uint NumberofBar=1;//Bar number for the signal input bool SoundON=true; //Enable alerts input uint NumberofAlerts=2;//Number of alerts input bool EMailON=false; //Enable mailing the signal input bool PushON=false; //Enable sending the signal to mobile devices
- Added three new functions to the end of the indicator code: BuySignal(), SellSignal() and GetStringTimeframe()
//+------------------------------------------------------------------+ //| Buy signal function | //+------------------------------------------------------------------+ void BuySignal(string SignalSirname, // text of the indicator name for email and push messages double &BuyArrow[], // indicator buffer with buy signals const int Rates_total, // the current number of bars const int Prev_calculated, // the number of bars on the previous tick const double &Close[], // close price const int &Spread[]) // spread { u//--- static uint counter=0; if(Rates_total!=Prev_calculated) counter=0; bool BuySignal=false; bool SeriesTest=ArrayGetAsSeries(BuyArrow); int index; if(SeriesTest) index=int(NumberofBar); else index=Rates_total-int(NumberofBar)-1; if(NormalizeDouble(BuyArrow[index],_Digits) && BuyArrow[index]!=EMPTY_VALUE) BuySignal=true; if(BuySignal && counter<=NumberofAlerts) { counter++; MqlDateTime tm; TimeToStruct(TimeCurrent(),tm); string text=TimeToString(TimeCurrent(),TIME_DATE)+" "+string(tm.hour)+":"+string(tm.min); SeriesTest=ArrayGetAsSeries(Close); if(SeriesTest) index=int(NumberofBar); else index=Rates_total-int(NumberofBar)-1; double Ask=Close[index]; double Bid=Close[index]; SeriesTest=ArrayGetAsSeries(Spread); if(SeriesTest) index=int(NumberofBar); else index=Rates_total-int(NumberofBar)-1; Bid+=Spread[index]; string sAsk=DoubleToString(Ask,_Digits); string sBid=DoubleToString(Bid,_Digits); string sPeriod=GetStringTimeframe(ChartPeriod()); if(SoundON) Alert("BUY signal \n Ask=",Ask,"\n Bid=",Bid,"\n currtime=",text,"\n Symbol=",Symbol()," Period=",sPeriod); if(EMailON) SendMail(SignalSirname+": BUY signal alert","BUY signal at Ask="+sAsk+", Bid="+sBid+", Date="+text+" Symbol="+Symbol()+" Period="+sPeriod); if(PushON) SendNotification(SignalSirname+": BUY signal at Ask="+sAsk+", Bid="+sBid+", Date="+text+" Symbol="+Symbol()+" Period="+sPeriod); } u//--- } //+------------------------------------------------------------------+ //| Sell signal function | //+------------------------------------------------------------------+ void SellSignal(string SignalSirname, // text of the indicator name for email and push messages double &SellArrow[], // indicator buffer with sell signals const int Rates_total, // the current number of bars const int Prev_calculated, // the number of bars on the previous tick const double &Close[], // close price const int &Spread[]) // spread { u//--- static uint counter=0; if(Rates_total!=Prev_calculated) counter=0; bool SellSignal=false; bool SeriesTest=ArrayGetAsSeries(SellArrow); int index; if(SeriesTest) index=int(NumberofBar); else index=Rates_total-int(NumberofBar)-1; if(NormalizeDouble(SellArrow[index],_Digits) && SellArrow[index]!=EMPTY_VALUE) SellSignal=true; if(SellSignal && counter<=NumberofAlerts) { counter++; MqlDateTime tm; TimeToStruct(TimeCurrent(),tm); string text=TimeToString(TimeCurrent(),TIME_DATE)+" "+string(tm.hour)+":"+string(tm.min); SeriesTest=ArrayGetAsSeries(Close); if(SeriesTest) index=int(NumberofBar); else index=Rates_total-int(NumberofBar)-1; double Ask=Close[index]; double Bid=Close[index]; SeriesTest=ArrayGetAsSeries(Spread); if(SeriesTest) index=int(NumberofBar); else index=Rates_total-int(NumberofBar)-1; Bid+=Spread[index]; string sAsk=DoubleToString(Ask,_Digits); string sBid=DoubleToString(Bid,_Digits); string sPeriod=GetStringTimeframe(ChartPeriod()); if(SoundON) Alert("SELL signal \n Ask=",Ask,"\n Bid=",Bid,"\n currtime=",text,"\n Symbol=",Symbol()," Period=",sPeriod); if(EMailON) SendMail(SignalSirname+": SELL signal alert","SELL signal at Ask="+sAsk+", Bid="+sBid+", Date="+text+" Symbol="+Symbol()+" Period="+sPeriod); if(PushON) SendNotification(SignalSirname+": SELL signal at Ask="+sAsk+", Bid="+sBid+", Date="+text+" Symbol="+Symbol()+" Period="+sPeriod); } u//--- } //+------------------------------------------------------------------+ //| Getting the timeframe as a string | //+------------------------------------------------------------------+ string GetStringTimeframe(ENUM_TIMEFRAMES timeframe) { //---- return(StringSubstr(EnumToString(timeframe),7,-1)); //---- }
- Added a couple of calls to BuySignal() and SellSignal() functions after the indicator calculation cycles in the OnCalculate() block
BuySignal("iWPRSign",BuyBuffer,rates_total,prev_calculated,close,spread); SellSignal("iWPRSign",SellBuffer,rates_total,prev_calculated,close,spread);
Where BuyBuffer and SellBuffer are the names of the indicator buffers for storing the buy and sell signals. As the empty values in the indicator buffers either zeros or EMPTY_VALUE must be set.
It is assumed that the only one call to the BuySignal() and SellSignal() functions will be used in the OnCalculate() block of the indicator code.
Fig.1. The Fisher_org_v1_Sign indicator on the chart
Fig.2. The Fisher_org_v1_Sign indicator Generating alerts.
MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/15880
The indicator implements a breakout system using a channel based on the High and Low price series processed by the algorithm of Volume_Weighted_MA_Digit.
JFatl_Digit_SystemThe indicator implements a breakout system using a channel based on the High and Low price series processed by the algorithm of JFatl_Digit.
Trading system based on Fisher_org_v1_Sign indicator signals.
Exp_JFatl_Digit_SystemTrading system based on JFatl_Digit_System indicator signals.