-
Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. double Ln(double v){ return MathLog(v); } double Sine(double a){ return MathSin(a * M_PI/180.0); } double Cosine(double a){ return MathCos(a * M_PI/180.0); } double Arctangent(double v){ return MathArctan(v) * 180.0/M_PI; } : Decycle[iBar] = (alpha1 / 2)*(Close[iBar] + Close[iBar+1]) + (1- alpha1)*Decycle[iBar+1];
whroeder1:
-
Why did you post your MT4 question in the
Root /
MT5 EA section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon.
Thank you very much for the help. Sorry If I asked this question in the wrong place.
It might be lack of sleep getting to me, but now my output seems to be astronomically to high.
Current code:
#property indicator_separate_window #property indicator_buffers 1 #property indicator_label1 "Decycler" #property indicator_type1 DRAW_LINE #property indicator_color1 clrWhite #property indicator_style1 STYLE_SOLID extern int Cutoff=60; double Ln(double v){ return MathLog(v); } double Sine(double a){ return MathSin(a * M_PI/180.0); } double Cosine(double a){ return MathCos(a * M_PI/180.0); } double Arctangent(double v){ return MathArctan(v)*180.0/M_PI; } double Decycle[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //---- indicators SetIndexBuffer(0,Decycle,INDICATOR_DATA); return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { Comment(""); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- the last counted bar will be recounted if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; //---- main loop for(int i=0; i<limit; i++) { double alpha1=(Cosine(360/Cutoff)+Sine(360/Cutoff)-1)/Cosine(360/Cutoff); Decycle[i] = (alpha1 / 2)*(Close[i] + Close[i+1]) + (1- alpha1)*Decycle[i+1]; } //---- return(0); } //+------------------------------------------------------------------+
The Output should be somewhere near price, However mine is outputting huge off the chart numbers.
Thanks again for the help.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I have a simple piece of code I'm trying to convert to MQL4, However I have no experience with TradeStation's EasyLanguage.
The whole code:
The part I can't quite translate is this line:
What is the MQL4 equivalent of Decycle[1]?
any help is greatly appreciated, Thank you.