Error

 Previous Topic Next Topic
 EPHESUS1 #1 Posted : Thursday, December 8, 2011 3:01:27 PM(UTC) Rank: NewbieGroups: Registered, Registered UsersJoined: 12/8/2011(UTC)Posts: 2 Hi, Not new to Metastock, but not a programmer. Have no skills in this area. Have PowerPivot Plus add-on Page 65-67 of accompanying manual provide a list of external formulas. Would like to write an Exploration that would highlight when the following pivots occur: Primary Hi, Primart Lo, Major Hi, Major Lo. Are there any kind Samaritans who could provide me with the answer. Thanking you in anticipation for your time & effort EPHESUS1
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 henry1224 #2 Posted : Thursday, December 8, 2011 5:50:49 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Pivotsa:=ExtFml("PowerPivots.Pivots");D:=If(A=4,4,If(A=3,3,If(A=2,2,If(A=1,1,If(A=-4,-4,If(A=-3,-3,If(A=-2,-2,If(A=-1,-1,0))))))));DThis will Plot the pivots when they happen.Pivots are dynamic and subject to change
 henry1224 #3 Posted : Thursday, December 8, 2011 5:55:47 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) here is an indicator Cycle 4,8,16,32,64 Comb w TDCTF:=Input("Time frame 1",1,100,1);Off:=Input("Offset",0,100,0);HD:= ExtFml("PowerPivots.TDataCreate",1,TF); LD:= ExtFml("PowerPivots.TDataCreate",2,TF) ;CD:= ExtFml("PowerPivots.TDataCreate",3,TF) ;P0:=Mov(((CD-LLV(LD,4))/(HHV(HD,4)-LLV(LD,4)))*100,3,E);P1:=Mov(((CD-LLV(LD,8))/(HHV(HD,8)-LLV(LD,8)))*100,3,E);P2:=Mov(((CD-LLV(LD,16))/(HHV(HD,16)-LLV(LD,16)))*100,3,E);P3:=Mov(((CD-LLV(LD,32))/(HHV(HD,32)-LLV(LD,32)))*100,3,E);P4:=Mov(((CD-LLV(LD,64))/(HHV(HD,64)-LLV(LD,64)))*100,3,E);A0:=Mov(((P0-LLV(P0,4))/(HHV(P0,4)-LLV(P0,4)))*100,3,E);A1:=Mov(((P1-LLV(P1,8))/(HHV(P1,8)-LLV(P1,8)))*100,3,E);A2:=Mov(((P2-LLV(P2,16))/(HHV(P2,16)-LLV(P2,16)))*100,3,E);A3:=Mov(((P3-LLV(P3,32))/(HHV(P3,32)-LLV(P3,32)))*100,3,E);A4:=Mov(((P4-LLV(P4,64))/(HHV(P4,64)-LLV(P4,64)))*100,3,E);AC:=Mov(Mov((A0+A1*2+A2*3+A3*4+A4*5)/15,2,S),2,S);UZ:=Mov(AC,34,S)+(1.3185*Stdev(AC,34));LZ:=Mov(AC,34,S)-(1.3185*Stdev(AC,34));AC2:=Mov(AC,4,S);AC2:=ExtFml( "PowerPivots.TDataLocalize", AC2, TF, Off);UZ:=ExtFml( "PowerPivots.TDataLocalize", UZ, TF, Off);LZ:=ExtFml( "PowerPivots.TDataLocalize", LZ, TF, Off);AC:=ExtFml( "PowerPivots.TDataLocalize", AC, TF, Off);95;50;5;AC;AC2;UZ;LZ;This allows you to change the time frame of the indicator to plot a weekly indicator onto a daily chart
 henry1224 #4 Posted : Thursday, December 8, 2011 5:58:59 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) an indicator for trend identificationPP+ Trend 5C>105ma w TDCTF:=Input("Time frame",1,100,1);Off:=Input("Offset",0,100,0);Type:=Input("1=MP,2=Typ,3=(O+H+L+C)/4,4=(O+H+L+(2*C))/5,5=C",1,5,5);OD:= ExtFml("PowerPivots.TDataCreate",0,TF); HD:= ExtFml("PowerPivots.TDataCreate",1,TF); LD:= ExtFml("PowerPivots.TDataCreate",2,TF) ;CD:= ExtFml("PowerPivots.TDataCreate",3,TF) ;Type2:=If(Type=1,(HD+LD)/2,If(Type=2,(HD+LD+CD)/3,If(Type=3,(OD+HD+LD+CD)/4,If(Type=4,(OD+HD+LD+(2*CD))/5,CD))));A:=If(Sum(Type2>Mov(Type2,105,S),5)>4,1,If(Sum(Type24,-1,0));UPTrend:=If(A=1,1,0);DnTrend:=If(A=-1,-1,0);UPTrend:=ExtFml( "PowerPivots.TDataLocalize", UPTrend, TF, Off);DnTrend:=ExtFml( "PowerPivots.TDataLocalize", DnTrend, TF, Off);UpTrend;DnTrend;
 henry1224 #5 Posted : Thursday, December 8, 2011 6:08:12 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) PP+ Trend Direction 1,2A2:= ExtFml("PowerPivots.TrendDirection",1,2);TR:=If(Sum(A2>0,2)>1,1,If(Sum(A2<0,2)>1,-1,0));Green:=If(Tr=1,1,0);Red:=If(TR=-1,-1,0);Green;Red;
 henry1224 #6 Posted : Thursday, December 8, 2011 6:20:59 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) PP+ Time CapsulesTF:=Input("TFactor",1, 1000, 3);OF:=Input("Offset", -100, 100, 0);Plot:=Input("Plot 1=odd 2= even 3= both",1,3,3); TCH:=ExtFml("PowerPivots.TimeCapsules",H,TF,OF); TCL:=ExtFml("PowerPivots.TimeCapsules",L,TF,OF);RNG:=TCH-TCL;78R:=If(plot<>2,Rng*.875+TCL,TCH);68R:=If(plot<>1,Rng*.75+TCL,TCH);58R:=If(plot<>2,Rng*.625+TCL,TCH);48R:=If(plot<>1,Rng*.5+TCL,TCH);38R:=If(plot<>2,Rng*.375+TCL,TCH);28R:=If(plot<>1,Rng*.25+TCL,TCH);18R:=If(plot<>2,Rng*.125+TCL,TCH);TCH;78R;68R;58R;48R;38R;28R;18R;TCL;
 henry1224 #7 Posted : Thursday, December 8, 2011 6:31:24 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Pivot Price Intermediate Last ValueIn:=Input("Instance back",0,10,0);A1:=Cum(1);NP:=ROC(ExtFml("PowerPivots.BarsSinceNthPivot",2,In),1,\$)<0;A2:=LastValue(A1-BarsSince(NP>0));PP2:=If(A1=A2),LastValue(ExtFml("PowerPivots.NthPivotPrice",2,In,1)));NP:=ROC(ExtFml("PowerPivots.BarsSinceNthPivot",-2,In),1,\$)<0;A2:=LastValue(A1-BarsSince(NP>0));PT2:=If(A1=A2),LastValue(ExtFml("PowerPivots.NthPivotPrice",-2,In,1)));PP2;PT2;
 henry1224 #8 Posted : Thursday, December 8, 2011 6:33:48 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Pivot Price Minor Last valueIn:=Input("Instance back",0,10,0);NP:=ROC(ExtFml("PowerPivots.BarsSinceNthPivot",1,In),1,\$)<0;A1:=Cum(1);A2:=LastValue(A1-BarsSince(NP>0));PP1:=If(A1=A2),LastValue(ExtFml("PowerPivots.NthPivotPrice",1,In,1)));NP:=ROC(ExtFml("PowerPivots.BarsSinceNthPivot",-1,In),1,\$)<0;A1:=Cum(1);A2:=LastValue(A1-BarsSince(NP>0));PT1:=If(A1=A2),LastValue(ExtFml("PowerPivots.NthPivotPrice",-1,In,1)));PP1;PT1;
 henry1224 #9 Posted : Thursday, December 8, 2011 6:37:48 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Pivot Trading Range in 1/8'si1:=Input("Pivot (1=Minor 2=Interm 3=Major 4=Primary)",1,4,2);i2:=Input("Trend Direction",1,4,1);aPivots:= ExtFml("PowerPivots.Pivots");aTrend:= ExtFml("PowerPivots.TrendDirection",i1,i2);ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,0); ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.125); ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.25); ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.375); ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.5); ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.625);ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.75);ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,.875);ExtFml("PowerPivots.RetInd",1,aPivots,aTrend,i1,.875);ExtFml("PowerPivots.RetInd",2,aPivots,aTrend,i1,.875);ExtFml("PowerPivots.RetInd",0,aPivots,aTrend,i1,1);
 henry1224 #10 Posted : Thursday, December 8, 2011 6:43:48 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Pitch Last ValuePiv:=Input("1=Minor 2=Intermediate 3=Major 4=Primary",1,4,2);A:=If(BarsSince(ExtFml("PowerPivots.Pivots")=Piv)< BarsSince(ExtFml("PowerPivots.Pivots")=-Piv),1,0);BSC:=If(A=1,ExtFml("PowerPivots.BarsSinceNthPivot",Piv,0),ExtFml("PowerPivots.BarsSinceNthPivot",-Piv,0));BSB:= If(A=1,ExtFml("PowerPivots.BarsSinceNthPivot",-Piv,0),ExtFml("PowerPivots.BarsSinceNthPivot",Piv,0));BSA:= If(A=1,ExtFml("PowerPivots.BarsSinceNthPivot",Piv,1),ExtFml("PowerPivots.BarsSinceNthPivot",-Piv,1));CP:=If(A=1,ValueWhen(1,ExtFml("PowerPivots.Pivots")= Piv,H), ValueWhen(1,ExtFml("PowerPivots.Pivots")=-Piv,L));BP:=If(A=1,ValueWhen(1,ExtFml("PowerPivots.Pivots")= -Piv,L), ValueWhen(1,ExtFml("PowerPivots.Pivots")=Piv,H));AP:= If(A=1,ValueWhen(2,ExtFml("PowerPivots.Pivots")= Piv,H), ValueWhen(2,ExtFml("PowerPivots.Pivots")=-Piv,L));B:=LastValue(Cum(1)-BSC);ML:= If(Cum(1)=B),If(((((.5*CP)+(.5*BP))-AP)/((.5*(BSA-BSC))+(.5*(BSA-BSB))-0)*BSA)+AP>0,((((.5*CP)+(.5*BP))-AP)/((.5*(BSA-BSC))+(.5*(BSA-BSB))-0)*BSA)+AP,AP));BL:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2), ML+Abs((BP-CP)/2)));CL:= If(Cum(1)=B),If(A=1,ML+Abs((BP-CP)/2), ML-Abs((BP-CP)/2)));382P:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2)*.382, ML+Abs((BP-CP)/2)*.382));618P:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2)*.618, ML+Abs((BP-CP)/2)*.618));1618P:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2)*1.618, ML+Abs((BP-CP)/2)*1.618));382M:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2)*-.382, ML+Abs((BP-CP)/2)*-.382));618M:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2)*-.618, ML+Abs((BP-CP)/2)*-.618));1618M:= If(Cum(1)=B),If(A=1, ML-Abs((BP-CP)/2)*-1.618, ML+Abs((BP-CP)/2)*-1.618));382P;618P;1618P;BL;ML;CL;382M;618M;1618M;
 henry1224 #12 Posted : Thursday, December 8, 2011 6:59:50 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Jackson Zones Last ValuePt:=Input("P 1=minor 2=intermediate 3=major 4=primary",1,4,2);NW:=If(ExtFml("Powerpivots.BarsSinceNthPivot",PT,0)< ExtFml("Powerpivots.BarsSinceNthPivot",-PT,0),ROC(ExtFml("Powerpivots.BarsSinceNthPivot",PT,0),1,\$)<0, ROC(ExtFml("Powerpivots.BarsSinceNthPivot",-PT,0),1,\$)<0);A1:=Cum(1);A2:=LastValue(A1-BarsSince(NW>0));WH:=ValueWhen(1,Nw, ExtFml("Powerpivots.NthPivotPrice",Pt,0,1));WL:=ValueWhen(1,Nw, ExtFml("Powerpivots.NthPivotPrice",-Pt,0,1));WCL:=ValueWhen(1,Nw,Ref(C,-1));BP:=LastValue((WH+WL+WCL)/3);RB2:=If(A1=A2),LastValue(((WH-WL)*1.382)+BP));D1:=If(A1=A2),LastValue((WH-WL)+BP));RB1:=If(A1=A2),LastValue(((WH-WL)*.618)+BP));D:=If(A1=A2),LastValue(((WH-WL)/2)+BP));MBP:=If(A1=A2),LastValue((WH+WL+WCL)/3));B:=If(A1=A2),LastValue(BP-((WH-WL)/2)));SB1:=If(A1=A2),LastValue(BP-((WH-WL)*.618)));B1:=If(A1=A2),LastValue(BP-(WH-WL)));SB2:=If(A1=A2), LastValue(BP-((WH-WL)*1.382)));RB2;D1;RB1;D;MBP;B;SB1;B1;SB2;
 jjstein #13 Posted : Thursday, December 8, 2011 6:59:58 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 5/13/2005(UTC)Posts: 715Location: Midwest, USAWas thanked: 1 time(s) in 1 post(s) Henry -- Um, I get the impression you're hot on PowerPivots, yes?
 henry1224 #15 Posted : Thursday, December 8, 2011 7:10:05 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Johnathan,I have been playing around with them since they were first released.The problem with this add-on is that there is very little documentation on how to use the external formulas
 henry1224 #16 Posted : Thursday, December 8, 2011 7:12:13 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) here's a link to more formulashttp://forum.equis.com/files/3015/metastock_files/entry19667.aspx
 EPHESUS1 #17 Posted : Tuesday, December 13, 2011 7:46:57 AM(UTC) Rank: NewbieGroups: Registered, Registered UsersJoined: 12/8/2011(UTC)Posts: 2 Hi Henry1224, Thanks for your response & thanks also to all others who responded. Overwhelmed by responses Thanks to all EPHESUS1
 henry1224 #18 Posted : Thursday, December 29, 2011 5:17:31 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) Pivot Trading Range in FibPiv:=Input("Pivot (1=Minor 2=Interm 3=Major 4=Primary)",1,4,2);TF:=Input("TFactor",1,4,1);PPs:= ExtFml("PowerPivots.Pivots");TD:= ExtFml("PowerPivots.TrendDirection",Piv,TF);TD:=If(Sum(TD=1,2)>1,1,If(Sum(TD=-1,2)>1,-1,0));ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,0); ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,.25); ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,.382); ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,.5); ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,.618);ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,1);ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,1.382);ExtFml("PowerPivots.RetInd",0,PPs,TD,Piv,1.618);ExtFml("PowerPivots.RetInd",1,PPs,TD,Piv,1);ExtFml("PowerPivots.RetInd",2,PPs,TD,Piv,1);
 henry1224 #19 Posted : Tuesday, February 19, 2013 6:10:10 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 10/29/2004(UTC)Posts: 1,394Location: Glastonbury, CTWas thanked: 2 time(s) in 2 post(s) All of the indicators in My PowerPivot+ toolkit require the PowerPivot Plus Add-on from Equis
 Users browsing this topic
 Similar Topics Price Expansions (EXP) Using Power Pivots Plus (Formula Assistance) by Derek Worswick 6/29/2011 3:02:12 PM(UTC)
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.