예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                AtmanRule rule = new AtmanRule();
                rule.RuleID            = tbRuleID.Text;
                rule.Item              = tbItem.Text;
                rule.TimeType          = tbTimeType.Text;
                rule.PriceType         = cbPriceType.SelectedIndex.ToString();
                rule.ForcastOfStrength = tbStrength.Text;
                rule.Position          = tbPosition.Text;
                rule.BasePrice         = tbBasePrice.Text;
                rule.BuyPrice          = tbBuyPrice.Text;
                rule.BuyTick           = tbBuyTick.Text;
                rule.BuyRate           = tbBuyRate.Text;
                rule.BuyLimitTime      = Convert.ToInt32(tbBuyLimitTime.Text);
                rule.LossPrice         = tbLossPrice.Text;
                rule.LossTick          = tbLossTick.Text;
                rule.LossRate          = tbLossRate.Text;
                rule.RevenuePrice      = tbRevenuePrice.Text;
                rule.RevenueTick       = tbRevenueTick.Text;
                rule.RevenueRate       = tbRevenueRate.Text;
                rule.RevenueLimitTime  = Convert.ToInt32(tbRevenueLimitTime.Text);
                rule.IsUse             = "N";

                rule.Update();
            }
            catch (Exception ex)
            { }
        }
예제 #2
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            var rule = btnModify.Tag as AtmanRule;

            rule.TimeType          = tbTimeType.Text;
            rule.PriceType         = cbPriceType.SelectedIndex.ToString();
            rule.ForcastOfStrength = tbStrength.Text;
            rule.Position          = tbTimeType.Text;
            rule.BasePrice         = tbBasePrice.Text;
            rule.BuyPrice          = tbBuyPrice.Text;
            rule.BuyTick           = tbBuyTick.Text;
            rule.BuyRate           = tbBuyRate.Text;
            rule.BuyLimitTime      = Convert.ToInt32(tbBuyLimitTime.Text);
            rule.LossPrice         = tbLossPrice.Text;
            rule.LossTick          = tbLossTick.Text;
            rule.LossRate          = tbLossRate.Text;
            rule.RevenuePrice      = tbRevenuePrice.Text;
            rule.RevenueTick       = tbRevenueTick.Text;
            rule.RevenueRate       = tbRevenueRate.Text;
            rule.RevenueLimitTime  = Convert.ToInt32(tbRevenueLimitTime.Text);

            AtmanRule ruleNew = new AtmanRule();

            ruleNew.RuleID            = tbRuleID.Text;
            ruleNew.Item              = tbItem.Text;
            ruleNew.PriceType         = cbPriceType.SelectedIndex.ToString();
            ruleNew.TimeType          = tbTimeType.Text;
            ruleNew.ForcastOfStrength = tbStrength.Text;
            ruleNew.Position          = tbTimeType.Text;
            ruleNew.BasePrice         = tbBasePrice.Text;
            ruleNew.BuyPrice          = tbBuyPrice.Text;
            ruleNew.BuyTick           = tbBuyTick.Text;
            ruleNew.BuyRate           = tbBuyRate.Text;
            ruleNew.BuyLimitTime      = Convert.ToInt32(tbBuyLimitTime.Text);
            ruleNew.LossPrice         = tbLossPrice.Text;
            ruleNew.LossTick          = tbLossTick.Text;
            ruleNew.LossRate          = tbLossRate.Text;
            ruleNew.RevenuePrice      = tbRevenuePrice.Text;
            ruleNew.RevenueTick       = tbRevenueTick.Text;
            ruleNew.RevenueRate       = tbRevenueRate.Text;
            ruleNew.RevenueLimitTime  = Convert.ToInt32(tbRevenueLimitTime.Text);
            ruleNew.IsUse             = "N";

            ruleNew.Update();
        }
예제 #3
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            AtmanRule rule     = new AtmanRule();
            Entities  entities = (Entities)rule.Collect();

            dgv.Rows.Clear();

            ruleList.Clear();

            foreach (var item in entities.Cast <AtmanRule>())
            {
                if (item.RuleID.StartsWith("Atom"))
                {
                    int idx = dgv.Rows.Add(item.RuleID, item.Item, item.TimeType, item.ForcastOfStrength, item.Position, item.BasePrice, item.IsUse == "Y", item.IsBuyDone);
                    dgv.Rows[idx].Tag = item;

                    ruleList.Add(new AtomTradeRule(item));
                }
            }
        }
예제 #4
0
파일: MessRuleForm.cs 프로젝트: aum-inv/AUM
        private void btnModify_Click(object sender, EventArgs e)
        {
            var rule = btnModify.Tag as AtmanRule;

            rule.Position         = tbPosition.Text;
            rule.BasePrice        = tbBasePrice.Text;
            rule.BuyPrice         = tbBuyPrice.Text;
            rule.BuyTick          = tbBuyTick.Text;
            rule.BuyRate          = tbBuyRate.Text;
            rule.BuyLimitTime     = Convert.ToInt32(tbBuyLimitTime.Text);
            rule.LossPrice        = tbLossPrice.Text;
            rule.LossTick         = tbLossTick.Text;
            rule.LossRate         = tbLossRate.Text;
            rule.RevenuePrice     = tbRevenuePrice.Text;
            rule.RevenueTick      = tbRevenueTick.Text;
            rule.RevenueRate      = tbRevenueRate.Text;
            rule.RevenueLimitTime = Convert.ToInt32(tbRevenueLimitTime.Text);

            AtmanRule ruleNew = new AtmanRule();

            ruleNew.RuleID           = tbRuleID.Text;
            ruleNew.Item             = tbItem.Text;
            ruleNew.Position         = tbPosition.Text;
            ruleNew.BasePrice        = tbBasePrice.Text;
            ruleNew.BuyPrice         = tbBuyPrice.Text;
            ruleNew.BuyTick          = tbBuyTick.Text;
            ruleNew.BuyRate          = tbBuyRate.Text;
            ruleNew.BuyLimitTime     = Convert.ToInt32(tbBuyLimitTime.Text);
            ruleNew.LossPrice        = tbLossPrice.Text;
            ruleNew.LossTick         = tbLossTick.Text;
            ruleNew.LossRate         = tbLossRate.Text;
            ruleNew.RevenuePrice     = tbRevenuePrice.Text;
            ruleNew.RevenueTick      = tbRevenueTick.Text;
            ruleNew.RevenueRate      = tbRevenueRate.Text;
            ruleNew.RevenueLimitTime = Convert.ToInt32(tbRevenueLimitTime.Text);
            ruleNew.IsUse            = "N";

            ruleNew.Update();
        }
예제 #5
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            AtmanRule rule     = new AtmanRule();
            var       entities = (OM.Lib.Framework.Db.Entities)rule.Collect();

            dgv.Rows.Clear();

            ruleList.Clear();

            foreach (var item in entities.Cast <AtmanRule>())
            {
                if (item.RuleID.StartsWith("TL") && item.Item == tbItem.Text)
                {
                    int idx = dgv.Rows.Add(item.RuleID
                                           , item.Item
                                           , item.TimeType
                                           , item.IsUse == "Y"
                                           , item.PriceType);
                    dgv.Rows[idx].Tag = item;

                    ruleList.Add(new TwoLineTradeRule(item));
                }
            }
        }
예제 #6
0
 public MessTradeRule(AtmanRule ruleInfo)
 {
     ItemCode      = ruleInfo.Item;
     this.ruleInfo = ruleInfo;
 }
예제 #7
0
 public TwoLineTradeRule(AtmanRule ruleInfo, int limitTicks = 10)
 {
     this.limitTicks = limitTicks;
     ItemCode        = ruleInfo.Item;
     this.ruleInfo   = ruleInfo;
 }
예제 #8
0
 public TwoLineTradeRule(AtmanRule ruleInfo)
 {
     ItemCode      = ruleInfo.Item;
     this.ruleInfo = ruleInfo;
 }