# How do you calculate the initial prior SAR value in a Parabolic SAR over FX market data

So I am attempting to calculate the Parabolic SAR over FX market data. I understand that the SAR equation is:

SARt = SARt-1 + * [EPt-1 - SARt-1]


with EPt-1 changing depending on if it is a rising or falling SAR but my question is how is the initial/prior SAR (SARt-1) calculated at first with new data or at a transition point (changing from a rising to failing SAR).

Any advice or books with the full mathematical definition would be much appreciated. Many thanks.

So after looking through and doing some reverse engineering of some implementations I think I have found the answer.

public static ParabolicSAR GenerateFirstSAR (ParabolicSAR sar,double[] high, double[] low) {
if (high[0] < high[1]) {
...
...
} else {
...