Exemple #1
0
 public override void OnStrategyStart()
 {
     // set up bollinger bands
     bbl       = new BBL(Bars, BBLLength, BBLOrder);
     bbl.Color = Color.Yellow;
     Draw(bbl, 0);
 }
Exemple #2
0
        private void BtnStart_Click(object sender, EventArgs e)
        {
            btnStart.Enabled = false;
            txtLog.Text     += "STARTING\r\n";
            txtLog.Update();
            BBL bbl = new BBL();

            bbl.load(txtBBL.Text);

            string[] files = Directory.GetFiles(txtDir.Text, "*.bbc");
            foreach (string file in files)
            {
                BBC bbc = new BBC();
                txtLog.Text += file + "\r\n";
                txtLog.Update();
                string error = bbc.load(file);
                if (error != null)
                {
                    txtLog.Text = "[ERROR][" + file + "] " + error + "\r\n";
                    txtLog.Update();
                }
                bbl.removeBlocks(bbc);
            }
            bbl.save(txtOutput.Text);
            txtLog.Text     += "DONE\r\n";
            btnStart.Enabled = true;
        }
Exemple #3
0
        private void Update()
        {
            if (lbd.Count < 1)
            {
                return;
            }

            int lookBackDaysInt = (int)lbd.Last;

            longLiqPoint = SMA.Value(bars86400, bars86400.Count - 1, lookBackDaysInt, BarData.Close);

            if (double.IsNaN(longLiqPoint))
            {
                return;
            }

            nEnd   = bars86400.Count - 1;
            nBegin = nEnd - lookBackDays + 1;

            buyPoint      = bars86400.HighestHigh(nBegin, nEnd);
            sellPoint     = bars86400.LowestLow(nBegin, nEnd);
            shortLiqPoint = SMA.Value(bars86400, bars86400.Count - 1, lookBackDaysInt, BarData.Close);
            upBand        = BBU.Value(bars86400, bars86400.Count - 1, lookBackDaysInt, bolBandTrig, BarData.Close);
            dnBand        = BBL.Value(bars86400, bars86400.Count - 1, lookBackDaysInt, bolBandTrig, BarData.Close);
        }
Exemple #4
0
    public override void OnStrategyStart()
    {
        bbl = new BBL(Bars, BBLLength, BBLOrder);

        bbl.Color = Color.Yellow;

        Draw(bbl, 0);
    }
Exemple #5
0
        protected override void OnStrategyStart()
        {
            Portfolio.Account.Deposit(AllocationPerInstrument, CurrencyId.USD, "Initial allocation");

            bbu = new BBU(Bars, Length, K);
            bbl = new BBL(Bars, Length, K);
            sma = new SMA(Bars, Length);

            AddGroups();
        }
Exemple #6
0
    public override void OnStrategyStart()
    {
        // set up bollinger bands
        BBL bbl = new BBL(Bars, BLength, BOrder, Color.Pink);

        // set up a series for B (breakout force) value
        b = new B(Bars, BLength, BOrder, Color.Yellow);

        Draw(bbl, 0);
        Draw(b, 2);
    }
Exemple #7
0
 public override void OnStrategyStart()
 {
     // set up the moving averages
     sma       = new SMA(Bars, SMALength);
     sma.Color = Color.Yellow;
     Draw(sma, 0);
     // set up bollinger bands
     bbl       = new BBL(Bars, SMALength, BBLOrder);
     bbl.Color = Color.Pink;
     Draw(bbl, 0);
 }
Exemple #8
0
        protected override void OnStrategyStart()
#endif
        {
            Portfolio.Account.Deposit(AllocationPerInstrument, CurrencyId.USD, "Initial allocation");

            bbu = new BBU(Bars, Length, K);
            bbl = new BBL(Bars, Length, K);
            sma = new SMA(Bars, Length);

            AddGroups();
        }
Exemple #9
0
        private async void BtnStart_Click(object sender, EventArgs e)
        {
            btnStart.Enabled = false;
            txtLog.Text     += "STARTING\r\n";
            txtLog.Update();
            BBL bbl = new BBL();

            bbl.load(txtBBL.Text);
            while (txtDir.Text.EndsWith("\\") || txtDir.Text.EndsWith("/"))
            {
                txtDir.Text = txtDir.Text.Substring(0, txtDir.Text.Length - 1);
            }
            Dictionary <string, int> result = bbl.plant(txtDir.Text);

            foreach (KeyValuePair <string, int> file in result)
            {
                txtLog.Text += file.Key + "\r\n";
                switch (file.Value)
                {
                case 0:
                    break;

                case 1:
                    txtLog.Text += "[NO FILE] " + file.Key + "\r\n";
                    break;

                case 2:
                    txtLog.Text += "[READ/WRITE ERROR] " + file.Key + "\r\n";
                    break;

                default:
                    txtLog.Text += "[UNKNOWN:" + file.Value + "] " + file.Key + "\r\n";
                    break;
                }
                txtLog.Update();
            }
            txtLog.Text     += "DONE\r\n";
            btnStart.Enabled = true;
        }