Commit Latest
This commit is contained in:
@@ -2,8 +2,6 @@ using System.Text;
|
|||||||
using MySql.Data.MySqlClient;
|
using MySql.Data.MySqlClient;
|
||||||
using MarketData.MarketDataModel;
|
using MarketData.MarketDataModel;
|
||||||
using MarketData.Utils;
|
using MarketData.Utils;
|
||||||
using System.Net;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
|
|
||||||
namespace MarketData.DataAccess
|
namespace MarketData.DataAccess
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using MarketData.Utils;
|
using MarketData.Utils;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -57,7 +55,6 @@ namespace MarketData.MarketDataModel
|
|||||||
public double StopPrice{get;set;}
|
public double StopPrice{get;set;}
|
||||||
public double Shares{get;set;}
|
public double Shares{get;set;}
|
||||||
public String StopType{get;set;}
|
public String StopType{get;set;}
|
||||||
// public DateTime EffectiveDate{get;set;} // if the EffectiveDate is Epoch then the StopLimit is taken to be in effect and is the most recent. Otherwise it is considered an historical stop limit
|
|
||||||
|
|
||||||
public StopLimit()
|
public StopLimit()
|
||||||
{
|
{
|
||||||
@@ -70,7 +67,6 @@ namespace MarketData.MarketDataModel
|
|||||||
sb.Append(Utility.FormatCurrency(StopPrice)).Append(",");
|
sb.Append(Utility.FormatCurrency(StopPrice)).Append(",");
|
||||||
sb.Append(Utility.FormatNumber(Shares, 3)).Append(",");
|
sb.Append(Utility.FormatNumber(Shares, 3)).Append(",");
|
||||||
sb.Append(StopType).Append(",");
|
sb.Append(StopType).Append(",");
|
||||||
// sb.Append(EffectiveDate.ToShortDateString());
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +77,6 @@ namespace MarketData.MarketDataModel
|
|||||||
nvpCollection.Add(new NVP("StopPrice", StopPrice.ToString()));
|
nvpCollection.Add(new NVP("StopPrice", StopPrice.ToString()));
|
||||||
nvpCollection.Add(new NVP("Shares", Shares.ToString()));
|
nvpCollection.Add(new NVP("Shares", Shares.ToString()));
|
||||||
nvpCollection.Add(new NVP("StopType", StopType.ToString()));
|
nvpCollection.Add(new NVP("StopType", StopType.ToString()));
|
||||||
// nvpCollection.Add(new NVP("EffectiveDate", EffectiveDate.ToShortDateString()));
|
|
||||||
return nvpCollection;
|
return nvpCollection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +89,6 @@ namespace MarketData.MarketDataModel
|
|||||||
stopLimit.StopPrice=nvpDictionary["StopPrice"].Get<double>();
|
stopLimit.StopPrice=nvpDictionary["StopPrice"].Get<double>();
|
||||||
stopLimit.Shares=nvpDictionary["Shares"].Get<double>();
|
stopLimit.Shares=nvpDictionary["Shares"].Get<double>();
|
||||||
stopLimit.StopType=nvpDictionary["StopType"].Get<String>();
|
stopLimit.StopType=nvpDictionary["StopType"].Get<String>();
|
||||||
// stopLimit.EffectiveDate=nvpDictionary["EffectiveDate"].Get<DateTime>();
|
|
||||||
return stopLimit;
|
return stopLimit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ namespace MarketDataServer.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("This method is obsolete. Use GetSopLimits(String token, String symbol) instead.", false)]
|
||||||
[HttpGet(Name = "GetStopLimit")]
|
[HttpGet(Name = "GetStopLimit")]
|
||||||
public StopLimit GetStopLimit(String token,String symbol)
|
public StopLimit GetStopLimit(String token,String symbol)
|
||||||
{
|
{
|
||||||
@@ -112,6 +113,28 @@ namespace MarketDataServer.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet(Name = "GetStopLimits")]
|
||||||
|
public StopLimits GetStopLimits(String token,String symbol)
|
||||||
|
{
|
||||||
|
Profiler profiler = new Profiler();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Start");
|
||||||
|
if(!Authorizations.GetInstance().IsAuthorized(token)) return null;
|
||||||
|
StopLimits stopLimits=StopLimitDA.GetStopLimits(symbol);
|
||||||
|
return stopLimits;
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Exception:{exception.ToString()}");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
MDTrace.WriteLine(LogLevel.DEBUG,$"Done, total took {profiler.End()} (ms)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet(Name = "GetPortfolioTradesWithParityPrice")]
|
[HttpGet(Name = "GetPortfolioTradesWithParityPrice")]
|
||||||
public PortfolioTradesWithParityPrice GetPortfolioTradesWithParityPrice(String token, String symbol)
|
public PortfolioTradesWithParityPrice GetPortfolioTradesWithParityPrice(String token, String symbol)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user