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 »


GetDataSetName

RSS

Syntax


public static string GetDataSetName(WealthScript obj)

public string GetDataSetName( WealthScript obj )

Parameter Description

objAn instance of the WealthScript object

Description

Returns DataSet name the strategy is being executed upon. Works in Strategy windows, does not work in Strategy Monitor or Combination Strategies.

Background:
Wealth-Lab 6 doesn't include a WatchListName equivalent function, used in WL4 to return WatchList name containing the symbol that was clicked to execute the script. This function is slightly different, however, because it takes current strategy window into account when determining the DataSetName, not some given symbol. In a future version, we expect a similar function to be implemented natively. Once it happens, this mockup function GetDataSetName will become depreciated.

Note:
For an alternative approach that searches through all datasets for current symbol, take a look here: DataSet name.

Example

Here's a short snippet illustrating how to call the method in your Strategy code:

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() { PrintDebug( this.GetDataSetName() ); } } }

Legacy syntax example:


using System;
using System.Text;
using WealthLab;
using WealthLab.Indicators;
using Community.Components; // GetDataSetName here
/*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Pass a WealthScript instance Utility u = new Utility( this );

PrintDebug( u.GetDataSetName() ); } } }

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.