stanislass:
im uncertain if this is the answer but it appears to work. you;ve got to play around with the order of arrays and the condition of its price in order to get it to work correctly.I try to create a two-tone Bollinger following phases.
It is no doubt very simple but I can not find why when changing colors there are holes ...
anyway u can see from the data window the prices appear funky.
give us an update if you got it figured out
//+------------------------------------------------------------------+ //| Bollinger Phases Bi-Color.mq4 | //+------------------------------------------------------------------+ #property copyright "JLF" #property link "http://www.rototo.fr" #property indicator_chart_window #property indicator_buffers 4 #property indicator_color1 Tomato #property indicator_color2 Lime #property indicator_color3 Tomato #property indicator_color4 Lime #property indicator_width1 2 #property indicator_width2 2 #property indicator_width3 2 #property indicator_width4 2 extern int Periode = 20; extern double Deviation = 2; extern double Price = 0; double BandsUpperOut[] ; // boll sup croissante double BandsUpperIn[] ; // boll sup décroissante double BandsLowerOut[] ; // boll inf croissante double BandsLowerIn[] ; // boll inf décroissante int ExtCountedBars=0; int init() { IndicatorBuffers(4); SetIndexBuffer(0,BandsUpperIn); SetIndexLabel(0,"BandsUpperIn"); SetIndexStyle(0,DRAW_LINE,0); SetIndexBuffer(1,BandsUpperOut); SetIndexLabel(1,"BandsUpperOut"); SetIndexStyle(1,DRAW_LINE,0); SetIndexBuffer(2,BandsLowerIn); SetIndexLabel(2,"BandsLowerIn"); SetIndexStyle(2,DRAW_LINE,0); SetIndexBuffer(3,BandsLowerOut); SetIndexLabel(3,"BandsLowerOut"); SetIndexStyle(3,DRAW_LINE,0); //---- IndicatorShortName("Bollinger Phase"); return(0); } int start() { ExtCountedBars=IndicatorCounted(); if(ExtCountedBars<0){return(-1);} if(ExtCountedBars>0){ExtCountedBars--;} int pos=Bars-ExtCountedBars-1; while(pos>=0) { BandsUpperIn[pos] = iBands(NULL,0,Periode,Deviation,0,Price,MODE_UPPER,pos); BandsLowerIn[pos] = iBands(NULL,0,Periode,Deviation,0,Price,MODE_LOWER,pos); if(iBands(NULL,0,Periode,Deviation,0,Price,MODE_UPPER,pos) >= iBands(NULL,0,Periode,Deviation,0,Price,MODE_UPPER,pos+1) && iBands(NULL,0,Periode,Deviation,0,Price,MODE_LOWER,pos) <= iBands(NULL,0,Periode,Deviation,0,Price,MODE_LOWER,pos+1) ) { BandsUpperOut[pos] = iBands(NULL,0,Periode,Deviation,0,Price,MODE_UPPER,pos); BandsLowerOut[pos] = iBands(NULL,0,Periode,Deviation,0,Price,MODE_LOWER,pos); } pos--; } return(0); }
Files:
phaseboll_1.mq4
3 kb
Yes, your suggestion works by changing the order of arrays.
No longer persists that the delay the opening of the final table.
Thank you
- stanislass: why when changing colors there are holes ...Changing the order fixes nothing, you just hid the problem in one direction.
stanislass: Yes, your suggestion works by changing the order of arrays. No longer persists that the delay the opening of the final table.
You must connect the lines. You have red[5]=value, green[5]=empty, and then green[4]=value. Therefor red ends one bar before green begins, resulting in a gap. If green[5] is empty set it to the same value as red[5] and thus connecting the lines. if(ExtCountedBars>0){ExtCountedBars--;}
No need for the decrement. Contradictory information on IndicatorCounted() - MQL4 forum- You lookback is Periode (iBands) Do your lookbacks correctly.
Ahhhh okkkk !
I debuted in indicator.I forgot that the route stops in the middle of the candle!
Thanks you two

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
I try to create a two-tone Bollinger following phases.
It is no doubt very simple but I can not find why when changing colors there are holes ...