I start my trading with $100 000 and I have a daily profit objective of $1000, so basically I write this code to stop trading once the NetLiquidation amount reaches 100k+1k
MasterInstrument mi = Bars.Instrument.MasterInstrument; commPerUnit = this.Account.Commission.ByMasterInstrument[mi].PerUnit; Print(Convert.ToString(Instrument.MasterInstrument .Name)); if (Account.Get(AccountItem.NetLiquidation, Currency.UsDollar) >= (StartingAccountBalance + DailyTargetProfit)) { Print("I exceeded the daily target profit"); myAccount.Flatten(new [] { Instrument.GetInstrument('"' + Convert.ToString(Instrument.MasterInstrument.Name) + '"') }); }
Thanks for your help
Comment