hello
i am trying to combine rsi+demark to creat new oscillator
main caculation is like this :
what is wrong with this
i have mq4 code working well but no success in mql5
can someone help plz
there is no output
Which output ? The code you post doesn't have any output. If you need and hope help, you have to be more explicit. With what you give us as information it is impossible to help you.
//--- indicator settings #property indicator_separate_window #property indicator_buffers 1 #property indicator_plots 1 #property indicator_type1 DRAW_LINE #property indicator_color1 DodgerBlue //--- input parameters input int ind_period=12; // Period //--- indicator buffers double ExtRSI_DEMBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,ExtRSI_DEMBuffer,INDICATOR_DATA); //--- set accuracy IndicatorSetInteger(INDICATOR_DIGITS,_Digits+1); //--- set first bar from what index will be drawn PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,ind_period-1); //--- name for DataWindow and indicator subwindow label IndicatorSetString(INDICATOR_SHORTNAME,"RSI+DEMARK("+string(ind_period)+")"); //--- initialization done } //+------------------------------------------------------------------+ //| Detrended Price Oscillator | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { int limit; int firstInd=begin+ind_period-1; //--- correct draw begin if(begin>0) PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,firstInd); //--- preliminary calculations if(prev_calculated<firstInd) { //--- filling ArrayInitialize(ExtRSI_DEMBuffer,0.0); limit=firstInd; } else limit=prev_calculated-1; //--- the main loop of calculations for(int i=limit;i<rates_total && !IsStopped();i++) ExtRSI_DEMBuffer[i]= ( (iRSI("GBPUSD.e",PERIOD_CURRENT,ind_period,PRICE_CLOSE))+ (100*(iDeMarker("GBPUSD.e",PERIOD_CURRENT,ind_period))) )/2; //--- done return(rates_total); } //+------------------------------------------------------------------+
i don't know what is the problem
this is a basic step in my main trading system and i need to migrate to mt5
i had used another code and i tried to adapt it
i don't know what is the problem
this is a basic step in my main trading system and i need to migrate to mt5
i had used another code and i tried to adapt it

- www.mql5.com
Look at the example here: https://www.mql5.com/en/docs/indicators/irsi you have to use iRSI differently to how you use it in mql4, there is no shift passed to the iRSI function. You also need to look at IndicatorCreate() and MqlParam . . . I think, I've never done this so I can't give any concrete advice.
thank you
i will try it
i think i should learn whole mql5 for this perpuse
i hate mql5 .
mql4 was so easy for learning and useage
i think i should learn whole mql5 for this perpuse
i hate mql5 .
mql4 was so easy for learning and useage
i think i should learn whole mql5 for this perpuse
i hate mql5 .
mql4 was so easy for learning and useage

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello
i am trying to combine rsi+demark to creat new oscillator
main caculation is like this :
what is wrong with this
i have mq4 code working well but no success in mql5
can someone help plz