Issues converting a MT4 indicator to MT5 (blank indicator's window)
#property indicator_buffers 5 #property indicator_plots 3
/* enum ENUM_TF { Current, M1, M5, M15, M30, H1, H4, D1, W1, MN1 }; input ENUM_TF TimeFrameWork = Current; // Time frame to use ENUM_TIMEFRAMES TimeFrame; */ input int ChoppinessPeriod = 14; // Number of bars to evaluation CI input int SmoothingPeriod = 1; // Number of bars to apply SMA input int StdDevPeriod = 14; // Number of bars to evaluate Standard Deviation of the CI input bool StdDevFollowPrice = false; // True, StdDev bars follow price, False, StdDev bars centered on 50 /* input bool EnableAlertOnHigh = false; // Alert setting for entering time of choppiness input double AlertHighVal = 61.8; // Default value based on fib numbers input bool EnableAlertOnLow = false; // Alert setting for entering time of trending input double AlertLowVal = 38.2; // Default value based on fib numbers */ input int MaxCalcBars = 1000; // Limit calculations back this many bars
SetIndexBuffer(0, ExtMapBuffer, INDICATOR_DATA); SetIndexBuffer(1, StdDevHiBuffer, INDICATOR_DATA); SetIndexBuffer(2, StdDevLoBuffer, INDICATOR_DATA); SetIndexBuffer(3, IntMapBuffer, INDICATOR_CALCULATIONS); SetIndexBuffer(4, IntStdDevBuffer, INDICATOR_CALCULATIONS); ArraySetAsSeries(ExtMapBuffer, true); ArraySetAsSeries(StdDevHiBuffer, true); ArraySetAsSeries(StdDevLoBuffer, true); ArraySetAsSeries(IntMapBuffer, true); ArraySetAsSeries(IntStdDevBuffer, true);
/* PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,ChoppinessPeriod+SmoothingPeriod); : : for(i=0;i<=Bars(_Symbol,PERIOD_CURRENT);i++) IntStdDevBuffer[i]=0; */ return(INIT_SUCCEEDED);
/* if(prev_calculated>0) return(prev_calculated-1); if(prev_calculated==0) return(0); return(0); limit=Bars(_Symbol,PERIOD_CURRENT)-counted_bars; if (limit>MaxCalcBars) limit=MaxCalcBars; for (int i=limit-1; i>=0; i--) */ if (prev_calculated < 0) return(-1); if (prev_calculated == 0) { limit = rates_total - (ChoppinessPeriod + SmoothingPeriod); if (limit > MaxCalcBars) limit = MaxCalcBars; } else limit = rates_total - prev_calculated; for (int i = limit; i >= 0; i--)
return(rates_total); //return(0);
Nagisa Unada:
Hello Nagisa, it works !
thank you so much for your help, i really apricate it !
i'm new to mt4/5
i have some coding skills, not enough tho
how can i learn mt5, are there good resources that u recommend ?
Thanks
You're welcome, pipspiper.
There are a lot of programs registered in the "CodeBase" of this site, and I recommend that you modify them to your liking.
You can improve your programming skills by repeatedly modifying them. That's how I acquired my skills.
Hi guys,
i'm trying to convert an indicator from mt4 to mt5
i managed to solve all error, and compiled the code, but when i attach the indicator on chart i get a blank indicator window
could you plz help me .. it's really urgent and important for me,
Thanks in Advance