private void OnAccountItemUpdate(object sender, AccountItemEventArgs e)
{
if (e.AccountItem == AccountItem.RealizedProfitLoss)
realizedPnL = e.Value;
if (e.AccountItem == AccountItem.CashValue)
cashValue = e.Value;
if (e.AccountItem == AccountItem.UnrealizedProfitLoss)
unRealizedPnL = e.Value;
if (unRealizedPnL > -100.00)
{
position.Close();
}
}
Thanks for you help.
Comment