- 트레일링 매도 추가
This commit is contained in:
42
Config.cs
42
Config.cs
@@ -10,7 +10,7 @@ namespace AutoSellerNS
|
||||
{
|
||||
static class Config
|
||||
{
|
||||
static Dictionary<string, string> m_Data = new Dictionary<string, string>();
|
||||
static Dictionary<string, object> m_Data = new Dictionary<string, object>();
|
||||
|
||||
static Random m_Random = new Random();
|
||||
|
||||
@@ -18,7 +18,9 @@ namespace AutoSellerNS
|
||||
{
|
||||
m_Data.Add("account", "");
|
||||
m_Data.Add("sub-account", "");
|
||||
m_Data.Add("bid-count", "5");
|
||||
m_Data.Add("bid-count", 5);
|
||||
m_Data.Add("trailing-rate", 1.0f);
|
||||
m_Data.Add("trailing-count", 2);
|
||||
|
||||
Load();
|
||||
}
|
||||
@@ -40,7 +42,7 @@ namespace AutoSellerNS
|
||||
continue;
|
||||
|
||||
if(m_Data.ContainsKey(aTokens[0]) == true)
|
||||
m_Data[aTokens[0]] = aTokens[1];
|
||||
m_Data[aTokens[0]] = Convert.ChangeType(aTokens[1], m_Data[aTokens[0]].GetType());
|
||||
else
|
||||
m_Data.Add(aTokens[0], aTokens[1]);
|
||||
}
|
||||
@@ -49,8 +51,8 @@ namespace AutoSellerNS
|
||||
static void Save()
|
||||
{
|
||||
string strContents = "";
|
||||
foreach(KeyValuePair<string, string> pair in m_Data)
|
||||
strContents += pair.Key + "=" + pair.Value + Environment.NewLine;
|
||||
foreach(KeyValuePair<string, object> pair in m_Data)
|
||||
strContents += pair.Key + "=" + pair.Value.ToString() + Environment.NewLine;
|
||||
|
||||
string strPath = Util.GetConfigPath()+"/config.ini";
|
||||
File.WriteAllText(strPath, strContents, new UTF8Encoding(true));
|
||||
@@ -58,32 +60,48 @@ namespace AutoSellerNS
|
||||
|
||||
public static void SetAccount(string strAccount, string strAccountSub)
|
||||
{
|
||||
m_Data["account"] = strAccount;
|
||||
if(strAccount != null)
|
||||
m_Data["account"] = strAccount;
|
||||
m_Data["sub-account"] = strAccountSub;
|
||||
Save();
|
||||
}
|
||||
|
||||
public static string GetAccount()
|
||||
{
|
||||
return m_Data["account"];
|
||||
return (string)m_Data["account"];
|
||||
}
|
||||
|
||||
public static string GetSubAccount()
|
||||
{
|
||||
return m_Data["sub-account"];
|
||||
return (string)m_Data["sub-account"];
|
||||
}
|
||||
|
||||
public static void SetBidCount(int iCount)
|
||||
{
|
||||
m_Data["bid-count"] = iCount.ToString();
|
||||
m_Data["bid-count"] = iCount;
|
||||
Save();
|
||||
}
|
||||
|
||||
public static int GetBidCount()
|
||||
{
|
||||
int iCount = 0;
|
||||
int.TryParse(m_Data["bid-count"], out iCount);
|
||||
return iCount;
|
||||
return (int)m_Data["bid-count"];
|
||||
}
|
||||
|
||||
public static void SetTrailing(float fTrailingRate, int iTrailingCnt)
|
||||
{
|
||||
m_Data["trailing-rate"] = fTrailingRate;
|
||||
m_Data["trailing-count"] = iTrailingCnt;
|
||||
Save();
|
||||
}
|
||||
|
||||
public static float GetTrailingRate()
|
||||
{
|
||||
return (float)m_Data["trailing-rate"];
|
||||
}
|
||||
|
||||
public static int GetTrailingCnt()
|
||||
{
|
||||
return (int)m_Data["trailing-count"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user