To align data from higher time frames within a chart, previous versions of Wealth-Lab had a special "Synchronization" dialog with these three options:
- Compressed Bar Available on Last Bar of Period (default behavior)
- Compressed Bar Available on the First Bar of Period
- PREVIOUS Compressed Bar Available on the First Bar of Period
As the familiar Synchronization dialog was left out of Wealth-Lab 6 for the purpose of simplification, here's an example by the Wealth-Lab author, Dion Kurczek, that demonstrates how synchronization can be performed in the Strategy. Paste this code in a new Strategy window and run it on a minute-based chart to see all the three synchronization options:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
if( Bars.Scale == BarScale.Minute )
{
SetScaleDaily();
DataSeries option2 = Bars.High; option2.Description = "High (option2)";
DataSeries option3 = option2 >> 1; option3.Description = "High (option3)";
RestoreScale();
option2 = Synchronize( option2 );
option3 = Synchronize( option3 );
DataSeries option1 = option3 << 1; option1.Description = "High (option1)";
option1[Bars.Count-1] = option2[Bars.Count-1];
PlotSeries( PricePane, option2, Color.Blue, LineStyle.Solid, 4 );
PlotSeries( PricePane, option3, Color.Red, LineStyle.Solid, 2 );
PlotSeries( PricePane, option1, Color.Black, LineStyle.Solid, 1 );
} else
{
DrawLabel( PricePane, "Switch to minutes" );
}
}
}
}