Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
Plot this on the Price Chart
Pricetype can be Open, High, Low, or Close
Length is the MA periods
Pct is the percent of band
Factor is 1 for daily,2 for weekly, 3 monthly,5 for a 5 min chart,10 10 min chart etc
Offset is the number of bars to the right
Mat is the type of MA 1 is simple, 2 exp and so forth
priceType:=Input("Price (Open=0 High=1 Low=2 Close=3)", 0, 3, 3);
length:=Input("Length", 1, 1000, 20);
Pct:= Input("Percentage Bands?",0.1,10,5);
factor:=Input("TFactor", 0, 1000, 1);
offset:=Input("Offset", 0, 1000, 0);
Mat:=Input("MA 1=Sim 2=Exp 3=Var 4=Weight 5 =tria 6=Time",1,6,1);
htfData:=ExtFml("PowerPivots.TDataCreate",priceType, factor);
X:=If(Mat=1, Mov(htfData, length, S),If(Mat=2, Mov(htfData, length, E),If(Mat=3, Mov(htfData, length, VAR),If(Mat=4, Mov(htfData, length, W),If(Mat=5, Mov(htfData, length, TRI), Mov(htfData, length, T))))));
TBnd:= X*(1+Pct/100);
LBnd:= X*(1-Pct/100);
MA:=ExtFml("PowerPivots.TDataLocalize", X, factor, offset);
TBnd:=ExtFml("PowerPivots.TDataLocalize", TBnd, factor, offset);
LBnd:=ExtFml("PowerPivots.TDataLocalize", LBnd, factor, offset);
MA;TBnd;LBnd;
|