From 0a39b69b15f722d45915db46bff54be35330c801 Mon Sep 17 00:00:00 2001 From: vdemydiuk Date: Thu, 8 Mar 2018 16:22:37 +0200 Subject: [PATCH] Issue #95: Added default constructors to classes MqlBookInfo, MqlTradeCheckResult --- MtApi5/MqlBookInfo.cs | 11 +++++++---- MtApi5/MqlTradeCheckResult.cs | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/MtApi5/MqlBookInfo.cs b/MtApi5/MqlBookInfo.cs index 5a3c1d87..d1e4be8e 100755 --- a/MtApi5/MqlBookInfo.cs +++ b/MtApi5/MqlBookInfo.cs @@ -10,13 +10,16 @@ namespace MtApi5 this.volume = volume; } - public ENUM_BOOK_TYPE type { get; } // Order type from ENUM_BOOK_TYPE enumeration - public double price { get; } // Price - public long volume { get; } // Volume + public MqlBookInfo() + { } + + public ENUM_BOOK_TYPE type { get; set; } // Order type from ENUM_BOOK_TYPE enumeration + public double price { get; set; } // Price + public long volume { get; set; } // Volume public override string ToString() { - return $"{type}|{price}|{volume}"; + return $"type = {type}; price = {price}; volume = {volume}"; } } } diff --git a/MtApi5/MqlTradeCheckResult.cs b/MtApi5/MqlTradeCheckResult.cs index 5b5f5cad..11d18e42 100755 --- a/MtApi5/MqlTradeCheckResult.cs +++ b/MtApi5/MqlTradeCheckResult.cs @@ -4,14 +4,14 @@ namespace MtApi5 { public class MqlTradeCheckResult { - public uint Retcode { get; } // Reply code - public double Balance { get; } // Balance after the execution of the deal - public double Equity { get; } // Equity after the execution of the deal - public double Profit { get; } // Floating profit - public double Margin { get; } // Margin requirements - public double Margin_free { get; } // Free margin - public double Margin_level { get; } // Margin level - public string Comment { get; } // Comment to the reply code (description of the error) + public uint Retcode { get; set; } // Reply code + public double Balance { get; set; } // Balance after the execution of the deal + public double Equity { get; set; } // Equity after the execution of the deal + public double Profit { get; set; } // Floating profit + public double Margin { get; set; } // Margin requirements + public double Margin_free { get; set; } // Free margin + public double Margin_level { get; set; } // Margin level + public string Comment { get; set; } // Comment to the reply code (description of the error) public MqlTradeCheckResult(uint retcode , double balance @@ -32,6 +32,9 @@ namespace MtApi5 Comment = comment; } + public MqlTradeCheckResult() + { } + public override string ToString() { return $"Retcode={Retcode}; Comment={Comment}; Balance={Balance}; Equity={Equity}; Profit={Profit}; Margin={Margin}; Margin_free={Margin_free}; Margin_level={Margin_level}";