Elder SafeZone Stop Long

Modified on 2015/11/13 12:45 by Eugene — Categorized as: Community Indicators

Syntax

```
public static ElderSafeStopLong(Bars bars, int period, int lookback, double coefficient)
public ElderSafeStopLong(Bars bars, int period, int lookback, double coefficient, string description)
```

Parameter Description

 bars A Bars object period The EMA period defines the trend lookback The lookback period coefficient This factor is typically ranging between 2 and 3

Description

SafeZone is a method for determining stop placement outside of the level of market noise as defined by the current volatility. It can be found in Dr. Alexander Elder's book "Come Into My Trading Room". According to Dr. Elder, noise in an uptrend is the portion of the current bar extending below the previous bar's low, hence going against the prevailing trend. For long trades, the average noise level, multiplied by a trader-selected coefficient, is subtracted from the current low. The stop value is calculated by multiplying the SafeZone factor (typically ranging from 2 to 3 and which ultimately depends on the security and trader's preference) by the noise level. Stops are moved only in the direction of the trade, never against.

Example

This example illustrates creating and visualizing the Safe Zone stop series:

```
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using Community.Indicators;namespace WealthLab.Strategies
{
public class SafeZoneDemo : WealthScript
{
protected override void Execute()
{
ElderSafeStopLong SafeLong = ElderSafeStopLong.Series( Bars, 22, 10, 2.0 );
ElderSafeStopShort SafeShort = ElderSafeStopShort.Series( Bars, 22, 10, 2.0 );
PlotSeries( PricePane, SafeLong, Color.Blue, LineStyle.Dots, 4 );
PlotSeries( PricePane, SafeShort, Color.Red, LineStyle.Dots, 4 );
}
}
}
```