public static int FillSeriesFromFile(this DataSeries Series, WealthScript ws, string FileName) public static int FillSeriesFromFile(this DataSeries Series, WealthScript ws, string FileName, char separator, string DateTimeFormat) public static int FillSeriesFromFile(this DataSeries Series, WealthScript ws, string FileName, char separator, string DateTimeFormat, bool exactMatch) public static int FillSeriesFromFile(this DataSeries[] SeriesArray, WealthScript ws, string FileName, char separator, string DateTimeFormat, bool exactMatch)public int FillSeriesFromFile(DataSeries Series, string FileName) public int FillSeriesFromFile(DataSeries Series, string FileName, char separator, string DateTimeFormat) public int FillSeriesFromFile(DataSeries Series, string FileName, char separator, string DateTimeFormat, bool exactMatch) public int FillSeriesFromFile(DataSeries[] SeriesArray, string FileName, char separator, string DateTimeFormat, bool exactMatch)
Date (as yyyyMMdd),Value
20080929,-0.714285714 20080930,0.5 20081001,-0.461538462 20081002,0.876923077
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class FillSeriesFromFile_Demo : WealthScript { protected override void Execute() { // Path to the data file containing external series string path = @"C:\DataSeries.txt"; // Series to fill DataSeries MySeries = new DataSeries( Bars, "MySeries" ); // Call the FillSeriesFromFile method MySeries.FillSeriesFromFile( this, path, Char.Parse(","), "yyyyMMdd" ); ChartPane MyPane = CreatePane( 30, true, true ); PlotSeries( MyPane, MySeries, Color.Red, WealthLab.LineStyle.Histogram, 2 ); } } }
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Components; /*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/namespace WealthLab.Strategies { public class FillSeriesFromFile_Demo : WealthScript { protected override void Execute() { // Path to the data file containing external series string path = @"C:\DataSeries.txt"; // Series to fill DataSeries MySeries = new DataSeries( Bars, "MySeries" ); // Create an instance of class that holds the method, passing a WealthScript reference SeriesHelper sh = new SeriesHelper( this ); // Call the FillSeriesFromFile method sh.FillSeriesFromFile( MySeries, path, Char.Parse(","), "yyyyMMdd" ); ChartPane MyPane = CreatePane( 30, true, true ); PlotSeries( MyPane, MySeries, Color.Red, WealthLab.LineStyle.Histogram, 2 ); } } }
20100301,0.5,0.9 20100302,0.3,0.6
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() { // Path to the data file containing external series string path = @"C:\temp\test.txt"; // Define two data series to fill DataSeries Series1 = new DataSeries( Bars, "Series1" ); DataSeries Series2 = new DataSeries( Bars, "Series2" ); // Create an array of DataSeries capable of holding 2 series DataSeries[] ds = new DataSeries[2]; ds[0] = Series1; ds[1] = Series2; // Let FillSeriesFromFile fill your series, passing the array created earlier ds.FillSeriesFromFile( this, path, Char.Parse(","), "yyyyMMdd", true ); // Plot it ChartPane MyPane = CreatePane( 20, true, true ); PlotSeries( MyPane, Series1, Color.Blue, LineStyle.Solid, 1 ); PlotSeries( MyPane, Series2, Color.Red, LineStyle.Solid, 1 ); } } }