Skip to content

Commit

Permalink
Merge pull request #31 from memoryfraction/features/optimization
Browse files Browse the repository at this point in the history
Optimization
  • Loading branch information
lisa3907 authored Jul 31, 2022
2 parents 7d1eedc + 78537ed commit 9a594d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/exchanges/hk/binance/public/publicApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ public override async ValueTask<OrderBooks> FetchOrderBooksAsync(string base_nam
/// <param name="base_name">The type of trading base-currency of which information you want to query for.</param>
/// <param name="quote_name">The type of trading quote-currency of which information you want to query for.</param>
/// <param name="timeframe">time frame interval (optional): default "1d"</param>
/// <param name="since">return committed data since given time (milli-seconds) (optional): default 0</param>
/// <param name="limits">maximum number of items (optional): default 20</param>
/// <param name="since">return committed data since given time (milli-seconds) (optional): default 0, since = UnixTimeStamps * (long)1000 </param>
/// <param name="limits">maximum number of items (optional): default 20, uplimit:1000</param>
/// <param name="args">Add additional attributes for each exchange</param>
/// <returns></returns>
public override async ValueTask<OHLCVs> FetchOHLCVsAsync(string base_name, string quote_name, string timeframe = "1d", long since = 0, int limits = 20, Dictionary<string, object> args = null)
Expand Down
19 changes: 19 additions & 0 deletions src/shared/standard/public/ohlcvs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,25 @@ public virtual long count
get;
set;
}

public override bool Equals(object obj)
{
// Check for null and compare run-time types.
if ((obj == null) || !this.GetType().Equals(obj.GetType()))
{
return false;
}
else
{
var objItem = (OHLCVItem)obj;
return (timestamp == objItem.timestamp)
&& (highPrice == objItem.highPrice)
&& (lowPrice == objItem.lowPrice)
&& (closePrice == objItem.closePrice)
&& (openPrice == objItem.openPrice)
&& (volume == objItem.volume);
}
}
}

/// <summary>
Expand Down

0 comments on commit 9a594d0

Please sign in to comment.