Esempio n. 1
0
 public double Leverage(string pair, bool isBuy) { return (double)GetBaseUnitSize(pair) / TradesManagerStatic.GetMMR(pair, isBuy); }
Esempio n. 2
0
 public Account GetAccount(bool includeOtherInfo) {
   if(includeOtherInfo) {
     var trades = GetTrades();
     Account.Trades = trades;
     if(trades.Any())
       Account.UsableMargin = Account.Equity - TradesManagerStatic.MarginRequired(trades.Lots(), GetBaseUnitSize(trades[0].Pair), TradesManagerStatic.GetMMR(trades[0].Pair, trades[0].IsBuy));
     Account.StopAmount = includeOtherInfo ? trades.Sum(t => t.StopAmount) : 0;
     Account.LimitAmount = includeOtherInfo ? trades.Sum(t => t.LimitAmount) : 0;
     Account.PipsToMC = PipsToMarginCallCore(Account).ToInt();
   }
   return Account;
 }