Esempio n. 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;
        }
Esempio n. 2
0
 public ConnectKHOpenAPI()
 {
     InitializeComponent();
     api = ConnectAPI.Get();
     api.SetAPI(axAPI);
     api.StartProgress(new RealType(), new DataBaseConnect().GetConnectString());
 }
Esempio n. 3
0
 public ConnectKHOpenAPI()
 {
     InitializeComponent();
     api = ConnectAPI.Get();
     api.SetAPI(axAPI);
     api.StartProgress(new RealType());
 }
Esempio n. 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);
        }
Esempio n. 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();
            }
        }
Esempio n. 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);
        }
Esempio n. 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];
            }
        }
Esempio n. 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;
 }
Esempio n. 9
0
 private ConfirmOrder()
 {
     InitializeComponent();
     api              = ConnectAPI.Get();
     api.SendConfirm += OnReceiveIdentify;
 }
Esempio n. 10
0
 public AccountSelection()
 {
     InitializeComponent();
     ConnectAPI.Get().SendAccount += OnReceiveAccount;
 }