internal void OnBar(Bar bar)
{
if (TraceOnBar && (FilterBarSize < 0 || (FilterBarSize == bar.Size && FilterBarType == BarType.Time)))
{
this.trailPrice = GetPrice(bar.Close);
switch (Side)
{
case PositionSide.Long:
this.fillPrice = this.currPrice = GetPrice(bar.Low);
if (this.trailOnHighLow)
this.trailPrice = GetPrice(bar.High);
break;
case PositionSide.Short:
this.fillPrice = this.currPrice = GetPrice(bar.High);
if (this.trailOnHighLow)
this.trailPrice = GetPrice(bar.Low);
break;
}
switch (FillMode)
{
case StopFillMode.Close:
this.fillPrice = GetPrice(bar.Close);
break;
case StopFillMode.Stop:
this.fillPrice = this.stopPrice;
break;
}
this.method_1();
}
}