Bollinger Bands Set Indicator For MT5
Table Of Contents:
- Bollinger Bands Set Indicator For MT5
- Installation af Bollinger Bands Set Indicator For MT5
- Parametre for Bollinger Bands Set Indicator For MT5
- Buffere af Bollinger Bands Set Indicator For MT5
- Vigtigste dele af koden
Bollinger Bands Set Indicator For MT5 trækker automatisk sæt Bollinger-bånd baseret på den historiske prisbevægelse for valutapar. De øverste 4 bånd fungerer som det kritiske modstandsniveau, og det nedre 4 bånd fungerer som det kritiske understøttelsesniveau. Jo højere båndet er, jo større er chancen for at tjene penge. Og se efter bekræftelsessignalerne for prishandling. Da du vil handle med de dynamiske bånd, skal du sørge for, at du ikke tager for meget risiko i enhver handel, da det kan ødelægge din karriere. Hold dig til den konservative metode, så du ikke behøver at miste en stor del af din investering ved at prøve at udføre handlen.
Installation af Bollinger Bands Set Indicator For MT5
Når du har hentet indikatoren via formularen ovenfor, skal du pakke zip-filen ud. Derefter skal du kopiere filen x2ma_bbx9.mq5 til mappen MQL5Indicators for din MT5 installation. Efter dette skal du genstarte MT5, så vil du være i stand til at se indikatoren på listen over indikatorer.
Parametre for Bollinger Bands Set Indicator For MT5
Bollinger Bands Set Indicator For MT5 har 14 parametre, der skal konfigureres.
input Smooth_Method MA_Method1=MODE_SMA; // First smoothing method input int Length1=100; // First smoothing depth input int Phase1=15; // First smoothing parameter input Smooth_Method MA_Method2=MODE_JJMA; // Second smoothing method input int Length2=20; // Second smoothing depth input int Phase2=100; // Second smoothing parameter, input int BandsPeriod=100; // BB smoothing period input double BandsDeviation1 = 1.0; // First level deviation input double BandsDeviation2 = 2.0; // Second level deviation input double BandsDeviation3 = 3.0; // Third level deviation input double BandsDeviation4 = 4.0; // Fourth level deviation input Applied_price_ IPC=PRICE_CLOSE; // Price constant input int Shift=0; // Horizontal shift of the indicator in bars input int PriceShift=0; // Vertical shift of the indicator in points
Buffere af Bollinger Bands Set Indicator For MT5
Bollinger Bands Set Indicator For MT5 leverer 9 buffere.
SetIndexBuffer(0,X2MA,INDICATOR_DATA); SetIndexBuffer(1,ExtLineBuffer1,INDICATOR_DATA); SetIndexBuffer(2,ExtLineBuffer2,INDICATOR_DATA); SetIndexBuffer(3,ExtLineBuffer3,INDICATOR_DATA); SetIndexBuffer(4,ExtLineBuffer4,INDICATOR_DATA); SetIndexBuffer(5,ExtLineBuffer5,INDICATOR_DATA); SetIndexBuffer(6,ExtLineBuffer6,INDICATOR_DATA); SetIndexBuffer(7,ExtLineBuffer7,INDICATOR_DATA); SetIndexBuffer(8,ExtLineBuffer8,INDICATOR_DATA);
Vigtigste dele af koden
int OnCalculate(const int rates_total, // number of bars in history at the current tick const int prev_calculated,// number of bars calculated at previous call 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[]) { //---- checking the number of bars to be enough for the calculation if(rates_total lt StartBars) return(0); //---- declaration of variables with a floating point double price_,x1xma,x2xma,stdev1,stdev2,stdev3,stdev4; //---- declaration of integer variables and getting already calculated bars int first,bar; //---- calculation of the first starting index for the bars recalculation loop if(prev_calculated gt rates_total || prev_calculated lt =0) // checking for the first start of the indicator calculation first=0; // starting index for calculation of all bars else first=prev_calculated-1; // starting index for calculation of new bars //---- main indicator calculation loop for(bar=first; bar lt rates_total && !IsStopped(); bar++) { //---- call of the PriceSeries function to get the input price price_ price_=PriceSeries(IPC,bar,open,low,high,close); //---- two calls of the XMASeries function. //---- The begin parameter is increased by StartBars1 in the second call, as it is another XMA smoothing x1xma = XMA1.XMASeries( 0, prev_calculated, rates_total, MA_Method1, Phase1, Length1, price_, bar, false); x2xma = XMA2.XMASeries(StartBars1, prev_calculated, rates_total, MA_Method2, Phase2, Length2, x1xma, bar, false); //---- X2MA[bar]=x2xma+dPriceShift; } //---- Bollinger Bands calculation main loop for(bar=first; bar lt rates_total && !IsStopped(); bar++) { //---- call of the PriceSeries function to get the input price price_ price_=PriceSeries(IPC,bar,open,low,high,close); stdev1=STD.StdDevSeries(StartBars2,prev_calculated,rates_total,BandsPeriod,BandsDeviation1,price_,X2MA[bar],bar,false); stdev2=stdev1*quotient2; stdev3=stdev1*quotient3; stdev4=stdev1*quotient4; ExtLineBuffer1[bar]=X2MA[bar]+stdev4+dPriceShift; ExtLineBuffer2[bar]=X2MA[bar]+stdev3+dPriceShift; ExtLineBuffer3[bar]=X2MA[bar]+stdev2+dPriceShift; ExtLineBuffer4[bar]=X2MA[bar]+stdev1+dPriceShift; ExtLineBuffer5[bar]=X2MA[bar]-stdev1+dPriceShift; ExtLineBuffer6[bar]=X2MA[bar]-stdev2+dPriceShift; ExtLineBuffer7[bar]=X2MA[bar]-stdev3+dPriceShift; ExtLineBuffer8[bar]=X2MA[bar]-stdev4+dPriceShift; } //---- return(rates_total); } //+------------------------------------------------------------------+