Hello, sorry for this dumb question, but pls help me out here:
If you've some indior which is composed of 1 line in the chart window, and now you would like to include standard deviation bands to that lineup, such as Bollinger bands. How do you do this:
let's say your buffer that plots your initial indior is named abc
so first you announce that these:
extern int BandsPeriod=20;
extern int BandsShift=0;
extern dual BandsDeviations=2.0;
1) you change
#property indior_buffers 1 (1 becomes 3)
two)
SetIndexBuffer(0,abc);
SetIndexStyle(0,DRAW_LINE);
and include
SetIndexBuffer(1,UpperBuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(2,LowerBuffer);
SetIndexStyle(2,DRAW_LINE);
SetIndexDrawBegin(0,BandsPeriod BandsShift);
SetIndexDrawBegin(1,BandsPeriod BandsShift);
3) you include the rest of the bollinger bands code in the initialization loop
int begin()
{
int I,k,counted_bars=IndiorCounted();
double deviation,sum,oldval,newres;
//--
if(Barslt;=BandsPeriod) return(0);
//-- initial zero
if(counted_barslt;1)
etc....
4) but how the heck do you replace the buffer called MovingBuffer in the first bands.mq4 code from your new buffer from your indior, called abc?
What is the best way to go about this?
Should I try to get my indior code to the bands.mq4 code or another way around?
I connected a well-known piece of code called bands.mq4 so that you can see what I am working with.
Again, sorry for the coding-ignorance
Perhaps somebody knows of a 'incorporating stdev circles tutorial' ? That would be exactly what I need. Thx