The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Finance::GeniusTrader::Indicators::SAR

Overview

The Parabolic SAR, developed by Welles Wilder, is used to set trailing price stops. SAR refers to "Stop-And-Reversal". It is designed to create exit points for both long and short positions in such a way that it allows for reactions or fluctuations at the beginning of the position, but accelerates upward (for long positions) or downward (for short positions) as the movement tops out.

Calculation

If Long : SAR(i) = SAR(i-1) + Acceleration Factor * (Extreme Point of the current position - SAR(i-1))

Wilder's acceleration factor (AF) is 0.02 for the initial calculation. Thereafter the AF is increased 0.02 every period there is a New High made. If a new high is not made then the AF is not increased from the last SAR. This continues until the AF reaches 0.2. Once the AF reaches 0.2 it stays at that value for all future SAR calculations until the trade is stopped out.

If Short : SAR(i) = SAR(i-1) - Acceleration Factor * (Extreme Point of the current position - SAR(i-1))

The AF is initially 0.02 and changes by 0.02 intervals until it is 0.2 but the change in the AF is made only after each New Low of a period is made. The AF is never increased above 0.2.

Parameters

Most softwar packages only allow the user to vary the acceleration factor increment and the acceleration factor maximum, fixing the starting acceleration factor at 0.02. This restriction hampers the trend-following abilities of the parabolic, so don't be surprised if GeniusTrader is going a little step further and let you set up your own initial acceleration factor.

http://www.stockcharts.com/education/Resources/Glossary/parabolicSAR.html http://www.equis.com/free/taaz/parabolicsar.html http://www.linnsoft.com/tour/techind/sar.htm

Finance::GeniusTrader::Indicators::SAR::calculate($calc, $day)