in Search

Help needed in coding using PP+

Last post 06-01-2006, 0:01 by henry1224. 4 replies.
Sort Posts: Previous Next
  •  05-30-2006, 13:51 17736

    Help needed in coding using PP+

    I am a new user for Metastock/power pivots plus. I need help

    in programming PP+.

    I would like to create my own trading system using PP+.

    At any point of time, I would like to define Reward/Risk ratio
    something like (Upper resistance - Close price)/(Close price -
    Lower support) for Long trades

    'Upper resistance' is a nearest pivot upside which can be

    minor/intermediate/Major/Primary and must be greather than

    Close price

    Similarly 'Lower support' is a nearest pivot downside which

    can be minor/intermediate/Major/Primary and must be less than

    Close price

    Now my problem is that when I try function for Upper

    resistance

    ExtFml("PowerPivots.NthPivotPrice",1,0,1)
    1. I am getting price some times less than close price and

    2. some times that minor pivot upside is grater than
    Intermediate pivot upside
    i.e. ExtFml("PowerPivots.NthPivotPrice",2,0,1) is becoming less than
    ExtFml("PowerPivots.NthPivotPrice",1,0,1)

    I wanted closest pivot(R/I/M/P) upside which is greater than Close

    Finally I wrote an indicator for the same as follows

    {myPP+ - Target long}

    CV:=C;
    HV:=Highest(C);
    P1:=If(ExtFml("PowerPivots.NthPivotPrice",4,0,1)>CV,
    ExtFml("PowerPivots.NthPivotPrice",4,0,1),
    HV);
    M1:=If(ExtFml("PowerPivots.NthPivotPrice",3,0,1)>CV,
    ExtFml("PowerPivots.NthPivotPrice",3,0,1),
    HV);
    I1:=If(ExtFml("PowerPivots.NthPivotPrice",2,0,1)>CV,
    ExtFml("PowerPivots.NthPivotPrice",2,0,1),
    HV);
    R1:=If(ExtFml("PowerPivots.NthPivotPrice",1,0,1)>CV,
    ExtFml("PowerPivots.NthPivotPrice",1,0,1),
    HV);
    D1:=IF(P1>M1, M1, P1);
    D2:=IF(D1>I1, I1, D1);
    D3:=IF(D2>R1, R1, D2);
    D4:=IF(D3=HV,-1,D3);
    D4;

    It does not apper to be working. Also when put in exploration
    the exploration is very slow.

    Is there any better way to write this indicator?


    Thanks in advance.
    Sankar
  •  05-30-2006, 22:47 17747 in reply to 17736

    Ulcer index

    you could try somthing like this

    A4:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=4),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=4),1,0)); A3:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=3),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=3),1,0));
    A2:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=2),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=2),1,0)); A1:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=1),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=1),1,0));
    B4:=If(A4=1,Highest(ValueWhen(1,A4=1,H)),0);
    B3:=If(A3=1,Highest(ValueWhen(1,A3=1,H)),0);
    B2:=If(A2=1,Highest(ValueWhen(1,A2=1,H)),0);
    B1:=If(A1=1,Highest(ValueWhen(1,A1=1,H)),0);
    If(Max(B4,Max(B3,Max(B2,B1)))-C>0,Neg(Max(B4,Max(B3,Max(B2,B1)))-C),0);
  •  05-31-2006, 23:19 17803 in reply to 17736

    try this

    http://forum.equis.com/viewtopic.php?t=296
  •  05-31-2006, 23:50 17805 in reply to 17736

    PP+ Stochastic Range w Mirrored Stochastic

    A4:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=4),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=4),1,0)); A3:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=3),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=3),1,0));
    A2:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=2),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=2),1,0)); A1:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=1),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=1),1,0));
    An4:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=-4),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=-4),1,0)); An3:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=-3),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=-3),1,0));
    An2:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=-2),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=-2),1,0)); An1:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=-1),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=-1),1,0));
    B4:=If(A4=1,Highest(ValueWhen(1,A4=1,H)),0);
    B3:=If(A3=1,Highest(ValueWhen(1,A3=1,H)),0);
    B2:=If(A2=1,Highest(ValueWhen(1,A2=1,H)),0);
    B1:=If(A1=1,Highest(ValueWhen(1,A1=1,H)),0);
    Bn4:=If(An4=1,Lowest(ValueWhen(1,An4=1,L)),0);
    Bn3:=If(An3=1,Lowest(ValueWhen(1,An3=1,L)),0);
    Bn2:=If(An2=1,Lowest(ValueWhen(1,An2=1,L)),0);
    Bn1:=If(An1=1,Lowest(ValueWhen(1,An1=1,L)),0);
    Hr:=Max(B4,Max(B3,Max(B2,B1)));
    Lr:=Min(Bn4,Min(Bn3,Min(Bn2,Bn1)));
    Sto1:=(C-Lr)/(Hr-Lr);
    Sto2:=(Hr-C)/(Hr-Lr);
    Sto1;Sto2;
  •  06-01-2006, 0:01 17807 in reply to 17736

    this plots the same as the above indicator

    this indicator only uses minor and intermediate pivots but it plotsthe same as the above indicator

    A2:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=2),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=2),1,0)); A1:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=1),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=1),1,0));
    An2:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=-2),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=-2),1,0)); An1:=If(IsUndefined(ExtFml("PowerPivots.Pivots")=-1),0, If(IsDefined(ExtFml("PowerPivots.Pivots")=-1),1,0));
    B2:=If(A2=1,Highest(ValueWhen(1,A2=1,H)),0);
    B1:=If(A1=1,Highest(ValueWhen(1,A1=1,H)),0);
    Bn2:=If(An2=1,Lowest(ValueWhen(1,An2=1,L)),0);
    Bn1:=If(An1=1,Lowest(ValueWhen(1,An1=1,L)),0);
    Hr:= Max(B2,B1);
    Lr:= Min(Bn2,Bn1);
    Sto1:=(C-Lr)/(Hr-Lr);
    Sto2:=(Hr-C)/(Hr-Lr);

    Sto1;Sto2;
View as RSS news feed in XML