116 lines
2.3 KiB
C#
116 lines
2.3 KiB
C#
using MySql.Data.MySqlClient;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace upper_limit_crawler
|
|
{
|
|
public struct SETTING
|
|
{
|
|
public float m_fSearchMin;
|
|
public float m_fSearchMax;
|
|
public float m_fBidMin;
|
|
public float m_fBidMax;
|
|
public float m_fBidAmount;
|
|
public float m_fTimeout;
|
|
public float m_fTrailing;
|
|
public float m_fLossCut;
|
|
}
|
|
|
|
public struct MONITOR_ITEM
|
|
{
|
|
public object Code;
|
|
public object Name;
|
|
public object CurPrice;
|
|
public object flag;
|
|
public object Comp;
|
|
public object CompRate;
|
|
public object Volume;
|
|
public object StartPrice;
|
|
public object StartPriceComp;
|
|
public object StartPriceCompRate;
|
|
public object SerialDay;
|
|
}
|
|
|
|
public struct WATCH_ITEM
|
|
{
|
|
public string m_strCode;
|
|
}
|
|
|
|
public class ULDataMgr
|
|
{
|
|
//MySqlConnection m_DBCon;
|
|
|
|
public SETTING m_Setting = new SETTING();
|
|
|
|
ULTrader m_Trader = new ULTrader();
|
|
|
|
List<MONITOR_ITEM> m_MonitorList = new List<MONITOR_ITEM>();
|
|
List<WATCH_ITEM> m_WatchList = new List<WATCH_ITEM>();
|
|
List<string> m_BlackList = new List<string>();
|
|
|
|
public ULDataMgr()
|
|
{
|
|
InitDB();
|
|
}
|
|
|
|
void InitDB()
|
|
{
|
|
//string strConn = "Server=mjjo53.us.to;Database=upperlimit;Uid=mjjo;Pwd=whaudwls;charset=utf8;";
|
|
//m_DBCon = new MySqlConnection(strConn);
|
|
//m_DBCon.Open();
|
|
}
|
|
|
|
public string GetAccount()
|
|
{
|
|
return m_Trader.GetAccount();
|
|
}
|
|
|
|
public ULTrader GetTrader()
|
|
{
|
|
return m_Trader;
|
|
}
|
|
|
|
public void ClearMonitor()
|
|
{
|
|
m_MonitorList.Clear();
|
|
}
|
|
|
|
public void AddMonitor(MONITOR_ITEM Item)
|
|
{
|
|
m_MonitorList.Add(Item);
|
|
}
|
|
|
|
public void AddWatch(string strCode)
|
|
{
|
|
WATCH_ITEM item;
|
|
item.m_strCode = strCode;
|
|
|
|
m_WatchList.Add(item);
|
|
}
|
|
|
|
public void AddBlackList(string strCode)
|
|
{
|
|
m_BlackList.Add(strCode);
|
|
}
|
|
|
|
public bool IsInBlackList(string strCode)
|
|
{
|
|
return m_BlackList.Contains(strCode);
|
|
}
|
|
|
|
public List<MONITOR_ITEM> GetMonitor()
|
|
{
|
|
return m_MonitorList;
|
|
}
|
|
|
|
public List<WATCH_ITEM> GetWatchList()
|
|
{
|
|
return m_WatchList;
|
|
}
|
|
}
|
|
}
|