コード例 #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var s = new StochPOP();

            var o = s.Start(input.Text, null, true);
            AddOutput("=================",true );
            AddOutput("Sequence " + o[0],true);
            AddOutput("Profit " + o[1], true);
            AddOutput("Trades " + o[2], true);
           
        }
コード例 #2
0
ファイル: Test.cs プロジェクト: vishu57/NinjaTrader
    //  optimal solution for this is (0.5,0.5)
    public static double theActualFunction(double[] values)
    {
        if (values.GetLength(0) != 9)
        {
            throw new ArgumentOutOfRangeException("should only have 9 args");
        }


        var bb = @" this.Fast_K = int.Parse(s[0]);
                    this.Slow_K = int.Parse(s[1]);
                    this.Slow_D = int.Parse(s[2]);
                    this.UPPER_75 = int.Parse(s[3]);
                    this.LOWER_25 = int.Parse(s[4]);
                    this.LIMIT_HIGH = int.Parse(s[5]);
                    this.LIMIT_LOW = int.Parse(s[6]);
                    this.STOPLOSS = int.Parse(s[7]);
                    this.TAKEPROFIT = int.Parse(s[8]);
                    this.CLOSE_END_OF_DAY = false;";



        double a = values[0];
        double b = values[1];
        double c = values[2];
        double d = values[3];
        double e = values[4];
        double f = values[5];
        double g = values[6];
        double h = values[7];
        double i = values[8];
        // double f1 = Math.Pow(15 * x * y * (1 - x) * (1 - y) * Math.Sin(n * Math.PI * x) * Math.Sin(n * Math.PI * y), 2);
        //return f1;

        var seq = ((int)a).ToString() + "," + ((int)b).ToString() + "," + ((int)c).ToString() +
                  "," + ((int)d).ToString() + "," + ((int)e).ToString() + "," + ((int)f).ToString() +
                  "," + ((int)g).ToString() + "," + ((int)h).ToString() + "," + ((int)i).ToString();

        var s = new AlgoSecondLayer.StochPOP();
        var o = s.Start(seq, null, true);


        //AddOutput("=================", true);
        //AddOutput("Sequence " + o[0], true);
        //AddOutput("Profit " + o[1], true);
        //AddOutput("Trades " + o[2], true);

        double profit = double.Parse(o[1]);
        double trades = double.Parse(o[2]);
        double avg    = profit / (trades + 1);

        return(profit);
    }
コード例 #3
0
    //  optimal solution for this is (0.5,0.5)
    public static double theActualFunction(double[] values)
    {
        if (values.GetLength(0) != 9)
            throw new ArgumentOutOfRangeException("should only have 9 args");


        var bb = @" this.Fast_K = int.Parse(s[0]);
                    this.Slow_K = int.Parse(s[1]);
                    this.Slow_D = int.Parse(s[2]);
                    this.UPPER_75 = int.Parse(s[3]);
                    this.LOWER_25 = int.Parse(s[4]);
                    this.LIMIT_HIGH = int.Parse(s[5]);
                    this.LIMIT_LOW = int.Parse(s[6]);
                    this.STOPLOSS = int.Parse(s[7]);
                    this.TAKEPROFIT = int.Parse(s[8]);
                    this.CLOSE_END_OF_DAY = false;";
     
       

        double a = values[0];
        double b = values[1];
        double c = values[2];
        double d = values[3];
        double e = values[4];
        double f = values[5];
        double g = values[6];
        double h = values[7];
        double i = values[8];
        // double f1 = Math.Pow(15 * x * y * (1 - x) * (1 - y) * Math.Sin(n * Math.PI * x) * Math.Sin(n * Math.PI * y), 2);
        //return f1;

        var seq = ((int)a).ToString() + "," + ((int)b).ToString() + "," + ((int)c).ToString() +
            "," + ((int)d).ToString() + "," + ((int)e).ToString() + "," + ((int)f).ToString() +
             "," + ((int)g).ToString() + "," + ((int)h).ToString() + "," + ((int)i).ToString();

        var s = new AlgoSecondLayer.StochPOP();
        var o = s.Start(seq, null, true);


        //AddOutput("=================", true);
        //AddOutput("Sequence " + o[0], true);
        //AddOutput("Profit " + o[1], true);
        //AddOutput("Trades " + o[2], true);

        double profit = double.Parse(o[1]);
        double trades = double.Parse(o[2]);
        double avg = profit / (trades+1);

        return profit;
       
    }
コード例 #4
0
    internal void Start()
    {
        Console.WriteLine("Starting Calculations..");
           string SIMcontext = @"Data Source=85.214.244.19;Initial Catalog=ALSI_SIM;User ID=SimLogin;Password=boeboe;MultipleActiveResultSets=True";

           while (true)
           {
               var s = new StochPOP();
               s.Start(null,SIMcontext,false);
           }
           
       
    }