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

Finance::GeniusTrader::Indicators::SafeZone

The SafeZone stop is described in Dr. Alexander Elder's Book "Come into my Trading Room" and provides stops for closing long or short positions.

It accepts the number of bars to use for the calculation and a coefficient as parameters with 20 and 2 being the defaults that are also used in the examples in the book. The last parameter is the number of days a "plateau" is maintained regardless of of prices moving against the trade. This is to take into account the fact that stops may only be extended in the direction of the trade. After prices have been moving against the trade for the number of bars that is specified by the third parameter it is assumed that the stop was triggered and normal calculation of new stops is resumed.

If this doesn't seem to make sense just plot this indicator and you will know what I am trying to say. :)

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