Log in to see Cloud of Tags

Wealth-Lab Wiki

IsRawProfitMode

RSS

Syntax

public static bool IsRawProfitMode(this WealthScript obj)

public bool IsRawProfitMode()


Parameter Description

objA WealthScript object instance

Description

Returns true if Strategy was executed in Raw Profit mode, and false if in Portfolio Simulation mode.

Example

Here is an example illustrating how to use 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() { if( this.IsRawProfitMode() ) PrintDebug( "Raw Profit mode" ); else PrintDebug( "Portfolio Simulation mode" ); } } }


Legacy syntax example:

using System; using System.Text; using WealthLab; using WealthLab.Indicators; /*** 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 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 if( u.IsRawProfitMode() ) PrintDebug( "Raw Profit mode" ); else PrintDebug( "Portfolio Simulation mode" ); } } }

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.


ScrewTurn Wiki. Some of the icons created by FamFamFam.