How do i plot this DataSeries on my chart (as a separate panel from Price)? Not sure Add(trendSize) would work.
protected override void Initialize()
{
trendSize = new DataSeries(this);
CalculateOnBarClose = true;
}
protected override void OnBarUpdate()
{
// Condition set 1
if (Buy Condition using Strategy parameters)
{
trendSize[0] = (trendSize[1]<0) ? 0 : trendSize[0]++ ;
EnterLongLimit(DefaultQuantity, Close[0] - trendSize[0]*<some factor>(TickSize, "Enter-Lim");
}
// Condition set 2
if (Sell condition using Strategy parameters)
{
trendSize[0] = (trendSize[1]>0) ? 0 : trendSize[0]-- ;
ExitLongLimit(Close[0] + trendSize[0]*<some factor>* TickSize, "Exit-lim", "");
}
}
Comment