Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 5/7/2007(UTC) Posts: 9
|
minnamor wrote:You could buy PowerPivots Plus and use this indicator (EOD) for all types of most recent trend lines:
PPivot:=Input("[1]minor,[2]intermediate,[3]major",1,3,2); FTrough := LastValue( ExtFml("Powerpivots.NthPivotPrice",-Ppivot,0,1)); STrough := LastValue( ExtFml("Powerpivots.NthPivotPrice",-Ppivot,1,1)); DeltaVerticalU := FTrough - STrough; DeltaHorizontalU := LastValue(ExtFml("Powerpivots.BarsSinceNthPivot",-Ppivot,1)) - LastValue(ExtFml("Powerpivots.BarsSinceNthPivot",-Ppivot,0)); DeltaPerBarU := DeltaVerticalU / DeltaHorizontalU; BarNoSecondTrough := LastValue(Cum(1) - ExtFml("Powerpivots.BarsSinceNthPivot",-Ppivot,1)); TrendD := If(Cum(1) < BarNoSecondTrough, BarsSince(Cum(1) >= BarNoSecondTrough), STrough + (DeltaPerBarU * (Cum(1) - BarNoSecondTrough))); Up:=If(FTrough >= STrough, TrendD, BarsSince(FTrough >= STrough)); FPeak := LastValue( ExtFml("Powerpivots.NthPivotPrice",Ppivot,0,1)); SPeak := LastValue( ExtFml("Powerpivots.NthPivotPrice",Ppivot,1,1)); DeltaVerticalD := FPeak - SPeak; DeltaHorizontalD := LastValue(ExtFml("Powerpivots.BarsSinceNthPivot",Ppivot,1)) - LastValue(ExtFml("Powerpivots.BarsSinceNthPivot",Ppivot,0)); DeltaPerBarD := DeltaVerticalD / DeltaHorizontalD; BarNoSecondPeak := LastValue(Cum(1) - ExtFml("Powerpivots.BarsSinceNthPivot",Ppivot,1)); TrendU := If(Cum(1) < BarNoSecondPeak, BarsSince(Cum(1) >= BarNoSecondPeak), SPeak + (DeltaPerBarD * (Cum(1) - BarNoSecondPeak))); Dn:=If(FPeak <= SPeak, TrendU, BarsSince(FPeak <= SPeak)); Up;Dn;
regards. oh that's nice but unforturnately it cuts through other prices. i plotted this with minor trendline setting how about using the zigzag? i believe that work but i got a problem coding it
|