Psevdo Code
Opening a new long position:
posPrice = orderPrice + (spread + slippage) * point;
FloatingPL = orderLots * (barClose - posPrice) / point;
MoneyFloatingPL = orderLots * (barClose - posPrice) * lotSize / AccountExchangeRate(orderPrice);
Adding to a long pos:
posPrice = (lotsOld * priceOld + orderLots * (orderPrice + (spread + slippage) * point)) / (lotsOld + orderLots);
FloatingPL = (lotsOld + orderLots) * (barClose - posPrice) / point;
MoneyFloatingPL = (lotsOld + orderLots) * (barClose - posPrice) * lotSize / AccountExchangeRate(orderPrice);
Reducing a long position (we are still long):
posPrice = priceOld;
FloatingPL = (lotsOld - orderLots) * (barClose - priceOld) / point;
MoneyFloatingPL = (lotsOld - orderLots) * (barClose - priceOld) * lotSize / AccountExchangeRate(orderPrice);
Reversing a long position (it becomes a short position):
posPrice = orderPrice - (spread + slippage) * point;
FloatingPL = (orderLots - lotsOld) * (posPrice - barClose) / point;
MoneyFloatingPL = (orderLots - lotsOld) * (posPrice - barClose) * lotSize / AccountExchangeRate(orderPrice);
Transferring to the next bar:
posPrice += point * days * swapLongPips;
FloatingPL = posLots * (barClose - posPrice) / point;
MoneyFloatingPL = orderLots * (barClose - posPrice) * lotSize / AccountExchangeRate(barClose);
/// <summary>
/// Account Exchange Rate
/// </summary>
public static double AccountExchangeRate(double price)
{
double exchangeRate = 0;
if (InstrProperties.PriceIn == Configs.AccountCurrency)
exchangeRate = 1;
else if (InstrProperties.InstrType == Instrumet_Type.Forex && Symbol.StartsWith(Configs.AccountCurrency))
exchangeRate = price;
else if (Configs.AccountCurrency == "USD")
exchangeRate = InstrProperties.RateToUSD;
else if (Configs.AccountCurrency == "EUR")
exchangeRate = InstrProperties.RateToEUR;
return exchangeRate;
}
EDIT:
For full information you can use the Command Console (Tools - Additional - Command Console). For example if you want to see the params of position 345, write pos 345.