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
MACDPredicter - Indicator mod - help 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="kris82wt, post: 188371, member: 70186"] Hi guys, I need your help with the indicator. On some broker platforms it works fine, but on some gives different results. I don't know if it's because different time zone, or something else (I don't refer to difference with trading weekends for crypto). I will be very greatful if somebody could check what can cause issues. Another request is to add another (choosen by user) timeframe value of indicator [CODE=mql4]//---- indicator settings #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Silver #property indicator_width1 1 //---- indicator parameters extern double FastEMA=8.3896; extern double SlowEMA=17.5185; extern double SignalEMA=9.0503; //---- indicator buffers double Price[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- drawing settings SetIndexStyle(0,DRAW_LINE,STYLE_DOT); SetIndexDrawBegin(0,FastEMA); //---- indicator buffers mapping SetIndexBuffer(0,Price); //---- name for DataWindow and indicator subwindow label IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalEMA+")"); SetIndexLabel(0,"MACP"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| Moving Averages Convergence/Divergence | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); //---- last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars - counted_bars; //---- macd counted in the 1-st buffer for(int i=0; i<limit; i++) { Price[i]=(-1.0)*1.0/((FastEMA-SlowEMA)*2*(1.0-2.0/(SignalEMA+1.0)))*(FastEMA+1.0)*(SlowEMA+1.0)*( (2.0/(SignalEMA+1.0)-1.0)*(iMA(NULL,0,FastEMA,0,1,PRICE_CLOSE,i+1)*(1.0-2.0/(FastEMA+1.0))-iMA(NULL,0,SlowEMA,0,1,PRICE_CLOSE,i+1)*(1.0-2.0/(SlowEMA+1.0)))+iCustom(NULL,0,"DiNapoli MACD",FastEMA,SlowEMA,SignalEMA,false,1,i+1)*(1-2.0/(SignalEMA+1.0))); double predict=(-1.0)*1.0/((FastEMA -SlowEMA)*2*(1.0-2.0/(SignalEMA+1.0)))*(FastEMA+1.0)*(SlowEMA+1.0)*( (2.0/(SignalEMA+1.0)-1.0)*(iMA(NULL,0,FastEMA,0,1,PRICE_CLOSE,0)*(1.0-2.0/(FastEMA+1.0))-iMA(NULL,0,SlowEMA,0,1,PRICE_CLOSE,0)*(1.0-2.0/(SlowEMA+1.0)))+iCustom(NULL,0,"DiNapoli MACD",FastEMA,SlowEMA,SignalEMA,false,1,0)*(1-2.0/(SignalEMA+1.0))); datetime futureBarTime = Time[0]+Period()*60; datetime futureBarTime1 = Time[0]; ObjectCreate("signal1",OBJ_TREND,0,Time[0],Price[0],futureBarTime,predict); ObjectSet("signal1",OBJPROP_COLOR,Gold); ObjectSet("signal1",OBJPROP_RAY,false); ObjectSet("signal1",OBJPROP_STYLE,STYLE_DASH); double predict1=ObjectGet("signal1",OBJPROP_PRICE1); if(predict1<predict||predict1>predict) {ObjectDelete("signal1"); ObjectCreate("signal1",OBJ_TREND,0,Time[0],Price[0],futureBarTime,predict); ObjectSet("signal1",OBJPROP_COLOR,Gold); ObjectSet("signal1",OBJPROP_RAY,false); ObjectSet("signal1",OBJPROP_STYLE,STYLE_DASH); predict1=ObjectGet("signal1", OBJPROP_PRICE1 );} } return(0); } //+------------------------------------------------------------------+[/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…