set(PARAMETERS); int signal = optimize(20,5,30,1); vars Close = series(priceClose()); var NbDevUp= optimize(2,1,4,0.5); var NbDevDn =optimize(2,1,4,0.5); BBands((series(priceClose())),signal,NbDevUp,NbDevDn,MAType_SMA); vars upperBand = series(rRealUpperBand); vars lowerBand = series(rRealLowerBand);
hey, i changed your script little bit - removed the optimization - changed filling to grey (black filling = wtf??, but i guess u thought the color of the lower band is the color of the lower band it aint :D)
Code:
function run()
{
StartDate = 20170501;
EndDate = 20170502;
NumWFOCycles = 10;
DataSplit = 60; // activate WFO
NumCores = 4;
BarPeriod = 5;
set(BINARY);
Slippage = 0;
Spread = Commission = 0;
LifeTime = 1;
WinPayout = 75;
LossPayout = 0;
int signal = 30;
vars Close = series(priceClose());
var NbDevUp= 2;
var NbDevDn =2;
BBands((series(priceClose())),signal,NbDevUp,NbDevDn,MAType_SMA);
vars upperBand = series(rRealUpperBand);
vars lowerBand = series(rRealLowerBand);
plot("Bollinger1",rRealUpperBand,BAND1,BLACK);
plot("Bollinger2",rRealLowerBand,BAND2,GREY);
set(PLOTNOW);
if (crossOver(Close, upperBand))
enterShort(); //close short trades and open a long position
if (crossUnder(Close, lowerBand))
enterLong();
}
looks "normal" now. so, its about your optimized parameters? have you entered the resulting parameters f.e. in metatrader 4? and then check is the BB "disappear" there too? greetings
Re: Bands dont build correctly Upper and Lower
[Re: sodiumchloride]
#467801 09/01/1716:4509/01/1716:45