Two questions:
I'm running a strategy that does a spread calculation between two intruments, with the code in OnStartUp() and the custom methods in OnBarUpdate(). Is this a good use for OnStartUp()? The spread plots as desired in the strategy.
But... in OnStartUp I've also tried to code a zscore plot using the spread as its input. The code is commented out below as it won't compile. Any pointers on what I'm doing wrong?
Thanks!
protected override void OnStartUp()///////////////////////////////////////////////////////////
{
//Do something else...
}
private void SpreadCalculator()
{
spreadRough = (Closes[0][0]*quotedQuantity)-(Closes[1][0]*hedgeQuantity);
spread = Math.Round (spreadRough, 2);
}
private void SpreadPlotter()
{
StrategyPlot(0).Value.Set(spread);
}
//private void ZScoreCalculator()
//{
//SMA mySMA = SMA(spread, zPeriod);
//StdDev myStdDev = StdDev(spread, zPeriod);
//zscore = (spread-mySMA)/(myStdDev);
//}
private void GoLongSpread()
{etcetc}

Comment