GetDataSource

Modified on 2020/07/23 17:07 by Eugene — Categorized as: Community Components

Syntax


public static DataSource GetDataSource(this WealthScript obj)
public static DataSource GetDataSource(this string dataSetName)
public static DataSource GetDataSource(this int barInterval, string staticProviderString)

public DataSource GetDataSource() public DataSource GetDataSource(string dataSetName) public DataSource GetDataSource(int barInterval, string staticProviderString)

Parameter Description

dataSetNameName of the DataSet associated with the DataSource to be returned
barIntervalBar Interval of the DataStore
staticProviderStringName of the Static Provider

Description

GetDataSource is a Utility class function that returns the current DataSource object or the one that will by identified by the specified parameters. GetDataSource is used by the PositionHelper class in order to facilitate locating the WL data files, which are read by the SetTimeOfDayPriority method.

Example

Example using C# extension methods:


using System;
using System.Text;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Call the method DataSource ds = this.GetDataSource(); // The name of this DataSource Provider PrintDebug( ds.ProviderName ); } } }