public string ToString(ITranslationManager tm) { var stringBuilder = new StringBuilder(); foreach (ListParam listParam in ListParam) { if (listParam.Enabled) { stringBuilder.AppendLine( String.Format("{0}: {1}", tm.TranslateIndicatorParam(listParam.Caption, IndicatorName), tm.TranslateIndicatorParam(listParam.Text, IndicatorName))); } } foreach (NumericParam numParam in NumParam) { if (numParam.Enabled) { stringBuilder.AppendLine( String.Format("{0}: {1}", tm.TranslateIndicatorParam(numParam.Caption, IndicatorName), numParam.ValueToString)); } } foreach (CheckParam checkParam in CheckParam) { if (checkParam.Enabled) { stringBuilder.AppendLine( String.Format("{0}: {1}", tm.TranslateIndicatorParam(checkParam.Caption, IndicatorName), (checkParam.Checked ? tm.T("Statistics", "Yes") : tm.T("Statistics", "No")))); } } return(stringBuilder.ToString()); }
public InfoRecord[] GetInfoRecords(ITranslationManager tm) { const string tg = "Statistics"; var records = new List<InfoRecord> { new InfoRecord { Name = tm.T(tg, "Type"), Value = InstrType.ToString() }, new InfoRecord { Name = tm.T(tg, "Comment"), Value = Comment }, new InfoRecord { Name = tm.T(tg, "Digits"), Value = Digits.ToString(CultureInfo.InvariantCulture) }, new InfoRecord { Name = tm.T(tg, "Point value"), Value = Point.ToString("0.#####") }, new InfoRecord { Name = tm.T(tg, "Lot size"), Value = LotSize.ToString(CultureInfo.InvariantCulture) }, new InfoRecord { Name = tm.T(tg, "Spread"), Value = Spread.ToString("F2") + " " + tm.T(tg, "points") }, new InfoRecord { Name = tm.T(tg, "Swap long"), Value = SwapLong.ToString("F2") + " " + tm.T(tg, SwapType.ToString().ToLower()) }, new InfoRecord { Name = tm.T(tg, "Swap short"), Value = SwapShort.ToString("F2") + " " + tm.T(tg, SwapType.ToString().ToLower()) }, new InfoRecord { Name = tm.T(tg, "Commission"), Value = Commission.ToString("F2") + " " + tm.T(tg, CommissionType.ToString().ToLower()) }, new InfoRecord { Name = tm.T(tg, "Slippage"), Value = Slippage.ToString("F2") + " " + tm.T(tg, "points") } }; return records.ToArray(); }
public InfoRecord[] GetInfoRecords(ITranslationManager tm) { const string tg = "Statistics"; var records = new List <InfoRecord> { new InfoRecord { Name = tm.T(tg, "Type"), Value = InstrType.ToString() }, new InfoRecord { Name = tm.T(tg, "Comment"), Value = Comment }, new InfoRecord { Name = tm.T(tg, "Digits"), Value = Digits.ToString(CultureInfo.InvariantCulture) }, new InfoRecord { Name = tm.T(tg, "Point value"), Value = Point.ToString("0.#####") }, new InfoRecord { Name = tm.T(tg, "Lot size"), Value = LotSize.ToString(CultureInfo.InvariantCulture) }, new InfoRecord { Name = tm.T(tg, "Spread"), Value = Spread.ToString("F2") + " " + tm.T(tg, "points") }, new InfoRecord { Name = tm.T(tg, "Swap long"), Value = SwapLong.ToString("F2") + " " + tm.T(tg, SwapType.ToString().ToLower()) }, new InfoRecord { Name = tm.T(tg, "Swap short"), Value = SwapShort.ToString("F2") + " " + tm.T(tg, SwapType.ToString().ToLower()) }, new InfoRecord { Name = tm.T(tg, "Commission"), Value = Commission.ToString("F2") + " " + tm.T(tg, CommissionType.ToString().ToLower()) }, new InfoRecord { Name = tm.T(tg, "Slippage"), Value = Slippage.ToString("F2") + " " + tm.T(tg, "points") } }; return(records.ToArray()); }
public string ToString(ITranslationManager tm) { var stringBuilder = new StringBuilder(); foreach (ListParam listParam in ListParam) if (listParam.Enabled) stringBuilder.AppendLine( String.Format("{0}: {1}", tm.TranslateIndicatorParam(listParam.Caption, IndicatorName), tm.TranslateIndicatorParam(listParam.Text, IndicatorName))); foreach (NumericParam numParam in NumParam) if (numParam.Enabled) stringBuilder.AppendLine( String.Format("{0}: {1}", tm.TranslateIndicatorParam(numParam.Caption, IndicatorName), numParam.ValueToString)); foreach (CheckParam checkParam in CheckParam) if (checkParam.Enabled) stringBuilder.AppendLine( String.Format("{0}: {1}", tm.TranslateIndicatorParam(checkParam.Caption, IndicatorName), (checkParam.Checked ? tm.T("Statistics", "Yes") : tm.T("Statistics", "No")))); return stringBuilder.ToString(); }