/// <summary> /// Constructor /// </summary> public Instrument_Properties(string symbol, Instrumet_Type instrType) { if (instrType == Instrumet_Type.Forex) { this.symbol = symbol; this.instrType = instrType; comment = symbol.Substring(0, 3) + " vs " + symbol.Substring(3, 3); Digits = (symbol.Contains("JPY") ? 3 : 5); lotSize = 100000; spread = 20; swapType = Commission_Type.pips; swapLong = 2; swapShort = -2; commissionType = Commission_Type.pips; commissionScope = Commission_Scope.lot; commissionTime = Commission_Time.openclose; commission = 0; slippage = 0; priceIn = symbol.Substring(3, 3); rateToUSD = (symbol.Contains("JPY") ? 100 : 1); rateToEUR = (symbol.Contains("JPY") ? 100 : 1); baseFileName = symbol; } else { this.symbol = symbol; this.instrType = instrType; comment = symbol + " " + instrType.ToString(); Digits = 2; lotSize = 100; spread = 4; swapType = Commission_Type.percents; swapLong = -5; swapShort = -1; commissionType = Commission_Type.percents; commissionScope = Commission_Scope.deal; commissionTime = Commission_Time.openclose; commission = 0.25f; slippage = 0; priceIn = "USD"; rateToUSD = 1; rateToEUR = 1; baseFileName = symbol; } }
/// <summary> /// Constructor /// </summary> public Instrument_Properties(string symbol, Instrumet_Type instrType) { if (instrType == Instrumet_Type.Forex) { this.symbol = symbol; this.instrType = instrType; comment = symbol.Substring(0,3) + " vs " + symbol.Substring(3, 3); Digits = (symbol.Contains("JPY") ? 3 : 5); lotSize = 100000; spread = 20; swapType = Commission_Type.pips; swapLong = 2; swapShort = -2; commissionType = Commission_Type.pips; commissionScope = Commission_Scope.lot; commissionTime = Commission_Time.openclose; commission = 0; slippage = 0; priceIn = symbol.Substring(3, 3); rateToUSD = (symbol.Contains("JPY") ? 100 : 1); rateToEUR = (symbol.Contains("JPY") ? 100 : 1); baseFileName = symbol; } else { this.symbol = symbol; this.instrType = instrType; comment = symbol + " " + instrType.ToString(); Digits = 2; lotSize = 100; spread = 4; swapType = Commission_Type.percents; swapLong = -5; swapShort = -1; commissionType = Commission_Type.percents; commissionScope = Commission_Scope.deal; commissionTime = Commission_Time.openclose; commission = 0.25f; slippage = 0; priceIn = "USD"; rateToUSD = 1; rateToEUR = 1; baseFileName = symbol; } }