|
Member
Join Date: Jul 2006
Location: Sunny California
Posts: 53
|
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)>C V,
ExtFml("PowerPivots.NthPivotPrice",4,0,1),
HV);
M1:=If(ExtFml("PowerPivots.NthPivotPrice",3,0,1)>C V,
ExtFml("PowerPivots.NthPivotPrice",3,0,1),
HV);
I1:=If(ExtFml("PowerPivots.NthPivotPrice",2,0,1)>C V,
ExtFml("PowerPivots.NthPivotPrice",2,0,1),
HV);
R1:=If(ExtFml("PowerPivots.NthPivotPrice",1,0,1)>C V,
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
__________________
Napa Valley wine, wineries, on-line wine sales, lodging, vacations, golf, current events http://www.napavalley.com
|