Ребята, просматриваю код трейл стопа, и чего-то не нашел в нем места, где идет выбор расчетной цены:

[HandlerName("Trail Stop")]
[HandlerCategory("Position")]
public class TrailStop : IPosition2Double
{
[HandlerParameter(true, "1.5", Min = "0.1", Max = "5", Step = "0.1", Name = "Stop Loss")]
public double StopLoss { get; set; }

[HandlerParameter(true, "0.5", Min = "0.1", Max = "3", Step = "0.1", Name = "Trail Enable")]
public double TrailEnable { get; set; }

[HandlerParameter(true, "0.5", Min = "0.1", Max = "3", Step = "0.1", Name = "Trail Loss")]
public double TrailLoss { get; set; }

public double Execute(IPosition pos, int barNum)
{
if (pos == null)
{
return 0;
}
double stop;
var curProfit = pos.OpenMFEPct(barNum);
if (curProfit > TrailEnable)
{
double shift = (curProfit - TrailLoss) / 100;
stop = pos.EntryPrice * (1 + (pos.IsLong ? shift : -shift));
}
else
{
double shift = (0 - StopLoss) / 100;
stop = pos.EntryPrice * (1 + (pos.IsLong ? shift : -shift));
}
var lastStop = pos.GetStop(barNum);
if(lastStop == 0)
{
return stop;
}
return pos.IsLong ? Math.Max(stop, lastStop) : Math.Min(stop, lastStop);
}
}

Код брал тут: http://www.tslab.ru/ubb/ubbthreads.php?ubb=showflat&Number=8511#Post8511