Ultra_Oscillator Indicator For MT5
The Ultra_Oscillator Indicator For MT5
Installing the Ultra_Oscillator Indicator For MT5
After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file ultra_oscillator.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.
Parameters of the Ultra_Oscillator Indicator For MT5
The Ultra_Oscillator Indicator For MT5 has 7 parameters to configure.
input Smooth_Method XMA_Method=MODE_LWMA; // Ìåòîä óñðåäíåíèÿ
input int XLength1=7; // Ãëóáèíà ñãëàæèâàíèÿ 1
input int XLength2=14; // Ãëóáèíà ñãëàæèâàíèÿ 2
input int XLength3=28; // Ãëóáèíà ñãëàæèâàíèÿ 3
input int XPhase=15; // Ïàðàìåòð ñãëàæèâàíèÿ
input Applied_price_ IPC=PRICE_CLOSE; // Öåíîâàÿ êîíñòàíòà
input int Shift=0; // Ñäâèã èíäèêàòîðà ïî ãîðèçîíòàëè â áàðàõ
Buffers of the Ultra_Oscillator Indicator For MT5
The Ultra_Oscillator Indicator For MT5 provides 1 buffers.
SetIndexBuffer(0,IndBuffer,INDICATOR_DATA);
Main Parts Of The Code
int OnCalculate(const int rates_total, // êîëè÷åñòâî èñòîðèè â áàðàõ íà òåêóùåì òèêå
const int prev_calculated,// êîëè÷åñòâî èñòîðèè â áàðàõ íà ïðåäûäóùåì òèêå
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---- ïðîâåðêà êîëè÷åñòâà áàðîâ íà äîñòàòî÷íîñòü äëÿ ðàñ÷åòà
if(rates_total lt min_rates_total) return(0);
//---- îáúÿâëåíèå ïåðåìåííûõ ñ ïëàâàþùåé òî÷êîé
double price;
//---- îáúÿâëåíèå öåëî÷èñëåííûõ ïåðåìåííûõ è ïîëó÷åíèå óæå ïîñ÷èòàííûõ áàðîâ
int first,bar;
//---- ðàñ÷åò ñòàðòîâîãî íîìåðà first äëÿ öèêëà ïåðåñ÷åòà áàðîâ
if(prev_calculated gt rates_total || prev_calculated lt =0) // ïðîâåðêà íà ïåðâûé ñòàðò ðàñ÷åòà èíäèêàòîðà
first=0; // ñòàðòîâûé íîìåð äëÿ ðàñ÷åòà âñåõ áàðîâ
else first=prev_calculated-1; // ñòàðòîâûé íîìåð äëÿ ðàñ÷åòà íîâûõ áàðîâ
//---- îñíîâíîé öèêë ðàñ÷åòà èíäèêàòîðà
for(bar=first; bar lt rates_total && !IsStopped(); bar++)
{
price=PriceSeries(IPC,bar,open,low,high,close);
IndBuffer[bar]=XMA1.XMASeries(0,prev_calculated,rates_total,XMA_Method,XPhase,XLength1,price,bar,false)
+XMA2.XMASeries(0,prev_calculated,rates_total,XMA_Method,XPhase,XLength2,price,bar,false)
+XMA3.XMASeries(0,prev_calculated,rates_total,XMA_Method,XPhase,XLength3,price,bar,false);
}
//----
return(rates_total);
}
//+------------------------------------------------------------------+