Beispiel #1
0
        public override string ToString()
        {
            string buyP  = BuyPrice >= 0 ? BuyPrice.ToString() : "";
            string buyQ  = BuyQty >= 0 ? BuyQty.ToString() : "";
            string sellP = SellPrice >= 0 ? SellPrice.ToString() : "";
            string sellQ = SellQty >= 0 ? SellQty.ToString() : "";

            return(Name + ", " + Shop + ", " + buyP + ", " + buyQ + ", " + sellP + ", " + sellQ);
        }
    public override string ToString()
    {
        string s = "";

        s += ID;
        s += ItemType;
        s += Quality;
        s += Description;
        s += Capacity.ToString();
        s += BuyPrice.ToString();
        s += SellPrice.ToString();
        s += HP.ToString();
        s += MP.ToString();
        return(s);
    }
Beispiel #3
0
 public string ToJson()
 {
     return("{\"Time\":" +
            new JavaScriptSerializer().Serialize(Time) +
            ",\"Id\":\"" + Id.ToString() +
            "\",\"Security\":\"" +
            Security.ToString() +
            "\",\"BuyId\":\"" +
            BuyId.ToString() +
            "\",\"SellId\":\"" +
            SellId.ToString() +
            "\",\"Quantity\":" +
            Quantity.ToString() +
            ",\"BuyPrice\":" +
            BuyPrice.ToString() +
            ",\"SellPrice\":" +
            SellPrice.ToString() +
            "}");
 }
Beispiel #4
0
        public virtual void ForceSell()
        {
            try
            {
                if (!IsBuyed)
                {
                    return;
                }

                string type     = "청산";
                string position = Position == "1" ? "2" : "1";
                ExApi.XingApi.Order(type, ItemCode, position, Quantity.ToString(), CPrice.ToString(), BuyPrice.ToString());
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
            finally
            {
            }
        }
Beispiel #5
0
 public virtual void SellBuy(string type, string position)
 {
     try
     {
         if (type == "진입")
         {
             ExApi.XingApi.Order(type, ItemCode, position, Quantity.ToString(), CPrice.ToString());
         }
         else if (type == "청산")
         {
             ExApi.XingApi.Order(type, ItemCode, position, Quantity.ToString(), CPrice.ToString(), BuyPrice.ToString());
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
     }
     finally
     {
         InitHighLowPrice();
     }
 }
Beispiel #6
0
 public string BuyPriceUrlString()
 {
     return(BuyPrice == -1 ? "" : BuyPrice.ToString());
 }