I'm trying to implement a basic counter for the number of bars that I'm in a trade for.
The data originally imported into quote manager was tick data for bid and ask.
My chart is using 1hr bars with extended mode and bar magnifier switched on.
The CalcBar() method appears to be called each intra-hour-bar tick and not each 1hr bar.
Ideally I'd like to do something like:
Code: Select all
protected override void CalcBar()
{
if (this.StrategyInfo.MarketPosition > 0)
{
_barCount++;
}
if(_barCount == x)
{
// exit trade or do something
}
...
}
What's the best way of actually counting the number of bars I'm in a trade using the bar resolution of the actual chart?
Many thanks,
Ed