Getting Started
- Add reference to Atdl4net.dll
- Add namespace to your .xaml file:
<Windowx:Class="Atdl4netDemo.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:atdl4net="clr-namespace:Atdl4net.Wpf;assembly=Atdl4net">
- Add an AtdlControl to the XAML markup (Grid is optional):
<Grid><atdl4net:AtdlControlx:Name="AtdlControl1"/></Grid>
- Create a StrategiesReaderProvider and load it with your ATDL file:
string filePath = @"C:\Atdl4net\Test Data\broker_abc_strategies.xml"; FileInfo file = new FileInfo(filePath); string providerId = file.Name; StrategiesReaderProvider strategyProvider = new StrategiesReaderProvider(); strategyProvider.Load(new FileProviderContext(file, providerId));
- Set the control's Strategy property to the strategy of interest, having first called LoadDefaults on the strategy's controls:
Strategy_t strategy = strategyProvider.GetStrategyByName(providerId, "VWAP");
strategy.Controls.LoadDefaults();
AtdlControl1.Strategy = strategy;