Account1,05/01/2010,1000 Account1,13/06/2011,10000 Account1,14/09/2012,6000 Account1,16/10/2013,-2000 Account1,05/11/2014,2000 Account1,22/06/2015,-3000
29.01.1993,1 01.02.1993,1 ... 11.01.2016,1
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Buy dummy stock "Account1" for dividends try { SetContext("Account1",true); // Buy the smallest amount possible. Adjust to your equity. // 0.01 means 0.01% equity. You need to make it buy exactly 1 share. if( BuyAtMarket(1) != null ) LastPosition.Tag = 0.01; RestoreContext(); } catch (Exception) { throw; } // Now buy your real B&H symbol e.g. SPY // Sure you can do this many times in the loop, here I just made one sample trade if( BuyAtMarket(1) != null ) LastPosition.Tag = 10; // 10 means you buy for 10% of account equity } } }