Программирование - это просто
Advertisement
arrow arrow C# ( ) arrow C#. 11.
01.02.2023 .
1:
C#
Delphi
Web-
Excel-
.
C#. 11. E-mail
megabax   
26.10.2013 .
New Page 1

C#. 11.

, , .

.


.

" " - , . , , , , .

, TradeSystemOptimizer...

...

... , . Optimize, ...

 

...

 

 

... , *:

    C#.  11.

 

:

        private void btnOptimize_Click(object sender, EventArgs e)

        {

            //

            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)

            {

                PriceSource source = new PriceSource();

 

                //

                source.LoadFromTextFile(openFileDialog.FileName);

 

 

                MovingAverage MAShort = new MovingAverage(); // TODO:

                MovingAverage MALong = new MovingAverage(); // TODO:

 

                //

                MAShort.setSource(source);

                MAShort.Periods = 3;

                MALong.setSource(source);

                MALong.Periods = 5;

 

                MACrossTradeSystem system = new MACrossTradeSystem();

                system.count_trade = 1;

                system.MAFast = MAShort;

                system.MASlow = MALong;

 

                TradeSystemTester tester = new TradeSystemTester(source);

                tester.system = system;

                tester.techCosts = 0.1;

 

                TradeSystemOptimizer optimizer=new TradeSystemOptimizer();

                optimizer.tester = tester;

                optimizer.parameters.Add(new OptimizingParameter("MAFastPeriod", 3, 20, 1));

                optimizer.parameters.Add(new OptimizingParameter("MASlowPeriod", 5, 20, 1));

                optimizer.LogFile = "c:\\1\\opt.txt";

                optimizer.Optimize(10000);

 

                lbRes.Items.Clear();

                foreach (OptimizingParameter par in optimizer.parameters)

                {

                    lbRes.Items.Add(par.name+" "+par.result);

                }

 

                MessageBox.Show(optimizer.result.ToString());

            }

 

, OptimizingParameter, , . SetParametr ...

 

....

 

, . , :

    C#.  11.

 

, ? , , . , **:

 

    C#.  11.

 

. . , . , . , . , .

, .

 


, *,   "Microsoft Visual Studio 2010 Professional", Microsoft.. 

, **,   "", Microsoft.. 


 

( 26.10.2013 . )
 
« .   . »
 
© 2023 Программирование - это просто
Joomla! - , GNU/GPL.
© 2005-2008 Joom.Ru - Joomla!
Design by Mamboteam.com | Powered by Mambobanner.de
  .