I want to be able to monitor and log my account PnL so that I can track the performance of a portfolio of strategies.
I have created the strategy below which prints this message to the NinjaScript Output window every 5 minutes.
protected override void OnBarUpdate()
{
Print("Time : " + Time[0] + ", Pnl : " + Convert.ToString(Account.Get(AccountItem.RealizedProfitLoss, Currency.UsDollar) + Account.Get(AccountItem.UnrealizedProfitLoss, Currency.UsDollar)));
}
My question is...is there a way to automate this process so that every 5 minutes the print statement is appended to a new line in an excel file?
If so, do you have any examples?
Thanks,
Neil

Comment