PureBytes Links
Trading Reference Links
|
Try this.
I did the following........
1) Gave variable names to your more lengthy values. This is called boiling
down the code. It makes debugging simpler.
2) Substituted "average" for "_AMA". Replace this with _AMA before using.
I do not have your _AMA function to get it to verify so I used another
avg function.
3) Eliminated the use of ">" and "<" in the same statement.
4) Changed some and corrected some code in your print statement.
5) Gave your MRO statements a return value to look for.
6) I did not get "exe too large" errors running the original but I did get
other
errors. It verifies as written.
Good luck,
Dave Stanley
Inputs:
Length(10),
PctRLen(75),
FiltrPct(15),
AdMomLen(10),
XAvgLen(10),
EnFast(8.3896),
EnSlow(17.5185),
EnAvg(9.0503),
ExFast(8.3896),
ExSlow(17.5185),
ExAvg(9.0503),
SlopeLen(4),
AvgLen(10);
Vars: AMA(Close), Filter(0), AMAlo(Close), AMAhi(Close);
vars:pr(0),bb1(0),bb2(0);
pr=percentR(pctrlen);
bb1=BollingerBand((PercentR(PctRLen)),7,1.5);
bb2=BollingerBand((PercentR(PctRLen)),7,-1.5);
AMA ={ _AMA}average(Close, Length);
Filter = FiltrPct * StdDev(AMA - AMA[1], Length) / 100;
AMAlo = iff(AMA < AMA[1], AMA, AMAlo[1]);
AMAhi = iff(AMA > AMA[1], AMA, AMAhi[1]);
if AMAhi - AMA > Filter
and high<Parabolic(.02)
and LinearRegSlope((ADX(18)),3)>0
and MRO(PR>BB1,30,1)=1
and BB1 >PR
and MRO(PR<BB2,30,1)=1
then Sell at Market;
IF PR>BB1 and BB1>0
then begin
Print("Date= ",D," PercentR=",PR," BBUp=",BB1);
ExitShort("BBUp") at Market;
End;
|