mq4 never works in mq5
you have to develop it mq5, Please wait for more valuable comments from other members
https://www.mql5.com/en/code/76
Triple Exponential Average (TRIX)
- votes: 22
- 2010.02.03
- MetaQuotes Software Corp.
- www.mql5.com
It's an oscillator of the overbought/oversold market conditions. It can also be used as the Momentum indicator. Triple smoothing is used for removing the cyclic components in price movements with the period less than that of TRIX.
Cynopi:
TRIX is comes as standard in MT5
Hello guys,
I'am looking for a trix indicator in mql5. I have found a code in mql4 but i can's get it work in mql5. I don't know much about coding. Here is the code in mql4:
How can i get it word in mql5?
I hope someone can help me.
Salute
Cynopi
Jose Miguel Soriano:
TRIX is comes as standard in MT5
There is a standard Trix indicator in MT5 but there is no signal line. I need a Trix indicator with a EMA signal line period 5.
TRIX is comes as standard in MT5
//+------------------------------------------------------------------+ //| TRIX_WITH_SIGNAL.mq5 | //| | //+------------------------------------------------------------------+ #property copyright "2019, Guilherme Corrêa Teixeira" #property link "gui.cor.tei@gmail.com" #property description "Triple Exponential Average With Signal Line" #include <MovingAverages.mqh> //--- indicator settings #property indicator_separate_window #property indicator_buffers 2 #property indicator_plots 2 #property indicator_type1 DRAW_LINE #property indicator_color1 Teal #property indicator_width1 1 #property indicator_label1 "TRIX" #property indicator_type2 DRAW_LINE #property indicator_color2 Gold #property indicator_width2 1 #property indicator_label2 "SIGNAL" //--- input parameters input int InpPeriodEMA=9; // EMA period input int InpPeriodSignal=5; // SIGNAL period //--- indicator buffers double TRIX_Buffer[]; double SignalLine[]; int AHandle = iCustom(NULL,0,"Examples/TRIX",InpPeriodEMA,0); int BHandle = iMA(Symbol(), Period(), InpPeriodSignal, 0,MODE_EMA, AHandle); //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ void OnInit() { //--- indicator buffers mapping SetIndexBuffer(0,TRIX_Buffer,INDICATOR_DATA); SetIndexBuffer(1,SignalLine,INDICATOR_DATA); //--- sets first bar from what index will be drawn PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,3*InpPeriodEMA-3); //--- name for index label PlotIndexSetString(0,PLOT_LABEL,"TRIX("+string(InpPeriodEMA)+")"); //--- name for indicator label IndicatorSetString(INDICATOR_SHORTNAME,"TRIX("+string(InpPeriodEMA)+") SIGNAL("+InpPeriodSignal+")"); //--- indicator digits IndicatorSetInteger(INDICATOR_DIGITS,6); //--- initialization done } //+------------------------------------------------------------------+ //| Triple Exponential Average | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[]) { CopyBuffer(AHandle,0,0, rates_total,TRIX_Buffer); CopyBuffer(BHandle,0,0, rates_total,SignalLine); } //+------------------------------------------------------------------+
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
Hello guys,
I'am looking for a trix indicator in mql5. I have found a code in mql4 but i can's get it work in mql5. I don't know much about coding. Here is the code in mql4:
How can i get it word in mql5?
I hope someone can help me.
Salute
Cynopi