Wealth-Lab Wiki

API ChartStyles Community Components Community Indicators IndexDefinitions Knowledge Base Misc Optimizers Pending Deletion PosSizers Providers Standard Indicators TASC Traders Tips TASCIndicators Tutorial Videos Visualizers
RSS

Navigation


Quick Search
»
Advanced Search »


GetDataSource

RSS

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 ); } } }

Legacy syntax example:


using System;
using System.Text;
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 MyStrategy : WealthScript { protected override void Execute() { /* Create an instance of the Utility class that holds the method, passing it a WealthScript object (required) as "this" */ Community.Components.Utility u = new Community.Components.Utility(this);

// Call the method DataSource ds = u.GetDataSource(); // The name of this DataSource Provider PrintDebug( ds.ProviderName ); } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.

Used under license from FMR Corp. Copyright 2008 FMR Corp. All rights reserved.


ScrewTurn Wiki. Some of the icons created by FamFamFam.