//public void AddNewCcy(string ccyName, CurrencyStatics ccyStatics, CurrencyPair cp, double cpValue) //{ // bool testAdd = _CcyDB.AddCcy(ccyName, ccyStatics); // if (!testAdd) // MessageBox.Show($"The new Currency [{ccyName}] does already exist."); // else // { // _FXMarket.AddQuote(cp, cpValue); // } //} //public void AddRefCcy(string ccyName, CurrencyStatics ccyStatics) //{ // bool testAdd = _CcyDB.AddCcy(ccyName, ccyStatics); // if (!testAdd) // throw new Exception($"Add Ref Ccy Error {ccyName}"); // _Ccy = new Currency(ccyName); // _FXMarket.SetCcyRef(_Ccy); //} public void AddNewAsset(string assetName, AssetStatics aSt, double acpValue) { bool testAdd = _CcyDB.AddAsset(assetName, aSt); if (!testAdd) { MessageBox.Show($"The new Asset [{assetName}] does already exist."); } else { AssetCcyPair acp = new AssetCcyPair(new Asset(assetName), aSt.Ccy); _AssetMarket.AddQuote(acp, acpValue); } }
public void AddNewAsset(string assetName, AssetStatics aSt, double acpValue) { bool testAdd = _CcyDB.AddAsset(assetName, aSt); if (!testAdd) { MessageBox.Show($"The new Asset [{assetName}] does already exist."); } else { AssetCcyPair acp = new AssetCcyPair(new Asset(assetName), aSt.Ccy); foreach (var item in _Data) { item.Value.SetCcyDB(_CcyDB); item.Value.AssetMarket.AddQuote(acp, acpValue); item.Value.AssetMarket.PopulateWithFXMarket(item.Value.FXMarket); } } }