update
This commit is contained in:
@@ -33,7 +33,7 @@ namespace AutoSellerNS
|
||||
StockBid CPStockBid = new StockBid();
|
||||
ExcelHandler Excel = null;
|
||||
|
||||
foreach(string strLine in File.ReadLines(Util.GetSimulationPath()+"/0-input.txt", Encoding.UTF8))
|
||||
foreach(string strLine in File.ReadLines(GetInputFileName(), Encoding.UTF8))
|
||||
{
|
||||
var tokens = strLine.Split('\t');
|
||||
|
||||
@@ -210,6 +210,10 @@ namespace AutoSellerNS
|
||||
|
||||
var tokens = strLine.Split('\t');
|
||||
|
||||
if (tokens == null || tokens.Length <= 4)
|
||||
return new object[] { "input error \n", 0 };
|
||||
|
||||
|
||||
var strDate = tokens[0];
|
||||
var strSimulationTime = tokens[1];
|
||||
var strCodeName = tokens[2];
|
||||
@@ -312,30 +316,20 @@ namespace AutoSellerNS
|
||||
|
||||
if(bStart == false)
|
||||
{
|
||||
if(RowDT >= StartDT && iPrice==iStartPrice)
|
||||
bStart = true;
|
||||
iStartRow = iRow;
|
||||
iMaxPriceRow = iRow;
|
||||
|
||||
iMaxPrice = iStartPrice;
|
||||
|
||||
for(int i = 1; i<=iFillColumns; i++)
|
||||
{
|
||||
bStart = true;
|
||||
iStartRow = iRow;
|
||||
iMaxPriceRow = iRow;
|
||||
|
||||
iMaxPrice = iStartPrice;
|
||||
|
||||
for(int i = 1; i<=iFillColumns; i++)
|
||||
{
|
||||
Sheet.Cells[iRow, i].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
|
||||
Sheet.Cells[iRow, i].Style.Fill.BackgroundColor.SetColor(BidBackColor);
|
||||
}
|
||||
|
||||
m_PriceList.Clear();
|
||||
m_PriceList.Add(iPrice);
|
||||
}
|
||||
else if((RowDT-StartDT).Minutes > 10)
|
||||
{
|
||||
InsertLog(string.Format("[{0}] [{1}] 매수 가격 찾기 실패\n",
|
||||
StartDT.ToString("yyyy-MM-dd"),
|
||||
strCodeName));
|
||||
break;
|
||||
Sheet.Cells[iRow, i].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
|
||||
Sheet.Cells[iRow, i].Style.Fill.BackgroundColor.SetColor(BidBackColor);
|
||||
}
|
||||
|
||||
m_PriceList.Clear();
|
||||
m_PriceList.Add(iPrice);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -684,7 +678,7 @@ namespace AutoSellerNS
|
||||
|
||||
List<string> aLines = new List<string>();
|
||||
List<Task<object>> aTasks = new List<Task<object>>();
|
||||
foreach(string strLine in File.ReadLines(Util.GetSimulationPath()+"/0-input.txt", Encoding.UTF8))
|
||||
foreach(string strLine in File.ReadLines(GetInputFileName(), Encoding.UTF8))
|
||||
{
|
||||
var task = Task.Factory.StartNew<object>(() =>
|
||||
SimulationWork(new object[] {
|
||||
@@ -775,6 +769,16 @@ namespace AutoSellerNS
|
||||
});
|
||||
}
|
||||
|
||||
string GetInputFileName()
|
||||
{
|
||||
string strPath = Util.GetSimulationPath() + "/0-input-" + DateTime.Now.Date.ToString("yyyy-MM-dd") + ".txt";
|
||||
if (File.Exists(strPath) == true)
|
||||
return strPath;
|
||||
|
||||
strPath = Util.GetSimulationPath() + "/0-input.txt";
|
||||
return strPath;
|
||||
}
|
||||
|
||||
public static void InsertSimulationLog(string strCode, string strCodeName, List<Tuple<int, int>> PriceDealCntList)
|
||||
{
|
||||
DateTime time = DateTime.Now;
|
||||
|
||||
Reference in New Issue
Block a user