public static bool GetMode(WealthScript obj) public static RunMode GetMode2(WealthScript obj)public enum RunMode { SSB, MSB, SM, Error }
using System; using System.Collections.Generic; using System.Text; using System.Drawing; 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() { var mode = this.GetMode(); var mode2 = this.GetMode2(); var text = ""; PrintDebug( "GetMode: " + ( mode ? "Multi-symbol backtest" : "Single-symbol backtest") ); switch (mode2) { case RunMode.SSB: text = "Single-symbol backtest"; break; case RunMode.MSB: text = "Multi-symbol backtest"; break; case RunMode.SM: text = "Strategy Monitor"; break; case RunMode.Error: text = "Error"; break; default: break; } PrintDebug( "GetMode2: " + text ); } } }