示例#1
0
        public Strategy(IStatistics st)
        {
            ema     = new EMA();
            bands   = st.Base > 1 && st.Sigma > 0 && st.Percent > 0 && st.Max > 0 ? true : false;
            days    = st.ShortDayPeriod > 1 && st.LongDayPeriod > 2 ? true : false;
            count   = st.Quantity + 1;
            Headway = st.Time;

            if (bands)
            {
                over     = new BollingerBands(st.Sigma * 0.1, st.Base, st.Percent, st.Max);
                baseTick = new List <double>(2097152);
            }
            if (days)
            {
                shortDay = new List <double>(512);
                longDay  = new List <double>(512);
            }
            shortTick = new List <double>(2097152);
            longTick  = new List <double>(2097152);
            Send     += Analysis;
            this.st   = st;
            GetChart();
            Send          -= Analysis;
            api            = ConnectAPI.Get();
            api.SendDatum += Analysis;
            balance        = Balance.Get();
            SendLiquidate += balance.OnReceiveLiquidate;
        }
示例#2
0
 public ConnectKHOpenAPI()
 {
     InitializeComponent();
     api = ConnectAPI.Get();
     api.SetAPI(axAPI);
     api.StartProgress(new RealType(), new DataBaseConnect().GetConnectString());
 }
示例#3
0
 public ConnectKHOpenAPI()
 {
     InitializeComponent();
     api = ConnectAPI.Get();
     api.SetAPI(axAPI);
     api.StartProgress(new RealType());
 }
示例#4
0
        private void OnReceiveAccount(object sender, Account e)
        {
            account.Text = e.AccNo;
            id.Text      = e.ID;
            ConnectAPI api = ConnectAPI.Get();

            api.SendDeposit += OnReceiveDeposit;
            api.LookUpTheDeposit(e.AccNo, true);
        }
示例#5
0
        private void TimerTick(object sender, EventArgs e)
        {
            ConnectAPI api = ConnectAPI.Get();

            api.LookUpTheDeposit(account.Text, api.OnReceiveBalance);

            if (DateTime.Now.Hour > 14 && DateTime.Now.Minute > 44)
            {
                timer.Stop();
            }
        }
示例#6
0
        private void OnReceiveAccount(object sender, Account e)
        {
            if (e.Server.Equals("1"))
                FormSizes[2, 0] = 594;

            account.Text = e.AccNo;
            id.Text = e.ID;
            Api = ConnectAPI.Get();
            Api.SendDeposit += OnReceiveDeposit;
            Api.LookUpTheDeposit(e.AccNo, true);
        }
示例#7
0
        private Balance()
        {
            InitializeComponent();
            balGrid.ColumnCount     = 7;
            balGrid.BackgroundColor = Color.FromArgb(121, 133, 130);
            api              = ConnectAPI.Get();
            api.SendHolding += OnReceiveBalance;

            for (int i = 0; i < columns.Length; i++)
            {
                balGrid.Columns[i].Name = columns[i];
            }
        }
示例#8
0
 public Strategy(IStatistics st)
 {
     ema       = new EMA();
     shortDay  = new List <double>(512);
     longDay   = new List <double>(512);
     shortTick = new List <double>(2097152);
     longTick  = new List <double>(2097152);
     Send     += Analysis;
     this.st   = st;
     GetChart();
     Send          -= Analysis;
     api            = ConnectAPI.Get();
     api.SendDatum += Analysis;
     SendLiquidate += Balance.Get().OnReceiveLiquidate;
 }
示例#9
0
 private ConfirmOrder()
 {
     InitializeComponent();
     api              = ConnectAPI.Get();
     api.SendConfirm += OnReceiveIdentify;
 }
示例#10
0
 public AccountSelection()
 {
     InitializeComponent();
     ConnectAPI.Get().SendAccount += OnReceiveAccount;
 }