Here are some questions/comments:
1) The NT implementation of the formula from FM Labs http://www.fmlabs.com/reference/default.htm?url=PFE.htm does not look quite right.
Help says Period = "Number of bars used in the calculation". But the NT implementation in beta 15 is using 2 MORE bars than user has requested.
Part of the code is apparently trying to calculate the Hypotenuse for a triangle whose horizontal length is Period bars. But instead of the correct Period-1 it uses Period+1 when calculating the "length" of the vertical side. As a result the "Hypotenuse" calculated is from the sides of two different triangles!
I think the formula published on the FM Labs has an error (unless the +1 was some sort of traders adjustment).
2) The FM Labs formula is quite different to the Metastock formula in this article: http://transcripts.fxstreet.com/2005...zed_fract.html
I have implemented this in NT and got quite different results to the current NT PFE.
Can anyone recommend a good maths/finance book that might help in deciding between the merits of these type of formulas that are supposed to measure fractal properties?
Currently the Metastock version looks more reasonable to me.
3) In trying to get a reasonable scale between the height (price difference) and width (time or range-bar sequence) of the triangle, I think it may be necessary to use Instrument.MasterInstrument.PointValue in the NT implementation? Otherwise instruments with large PointValue (such as FX) are using extremely flat triangles in the existing calculations (at least with small-timescale charts).
4) The use of (Close[0] < Close[1] ? -1: 1)
This introduces a positive bias into the result.
If a chart is in use with a significant number of sequential bars with the same Close value, then the bias can be large. This often happens in Range charts if instrument is in consolidation (e.g. a horizontal sequence of red/green bars). In this case the current indicator rarely goes below zero (even in an obvious downturn).
Perhaps there should be another Parameter say "Bias" with the following values +1 (current method), 0 (no bias), -1 (negative bias - more useful to Shorters)?
Comment