Posted By: forexcoder
Use of indicator's result - 04/21/15 08:07
Hi all. I have the following doubt:
if I use an indicator, for example the BBands, how can I use its resluts? For example, it is correct the following script:
or is correct this one:
in which I use series (lowerBand ecc.) instead of varables (rRealLowerBand ecc.).
Thanks.
if I use an indicator, for example the BBands, how can I use its resluts? For example, it is correct the following script:
Code:
vars PriceH1 = series(price()); vars TriggerLine = series(LowPass(PriceH1,optimize(7,5,9))); BBands(PriceH1,20,2,2,MAType_SMA); Stop = optimize(4,2,8) * ATR(60); TakeProfit = optimize(4,2,8)*ATR(60); if(crossOver(TriggerLine,rRealLowerBand)) enterLong(); else if (crossUnder(TriggerLine,rRealUpperBand)) enterShort();
or is correct this one:
Code:
vars PriceH1 = series(price()); vars TriggerLine = series(LowPass(PriceH1,optimize(7,5,9))); BBands(PriceH1,20,2,2,MAType_SMA); vars upperBand = series(rRealUpperBand); vars lowerBand = series(rRealLowerBand); vars middleBand = series(rRealMiddleBand); Stop = optimize(4,2,8) * ATR(60); TakeProfit = optimize(4,2,8)*ATR(60); if(crossOver(TriggerLine,lowerBand )) enterLong(); else if (crossUnder(TriggerLine,upperBand )) enterShort();
in which I use series (lowerBand ecc.) instead of varables (rRealLowerBand ecc.).
Thanks.