[Quantproject-developers] QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2 RunMSFTsimpleTest_2
Brought to you by:
glauco_1
|
From: <mi...@us...> - 2003-12-20 18:43:53
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2
In directory sc8-pr-cvs1:/tmp/cvs-serv1168/b7_Scripts/SimpleTesting/MSFTSimpleTest_2
Modified Files:
RunMSFTsimpleTest_2.cs TsMSFTsimpleTest_2.cs
Log Message:
Modified script files MSFTsimpleTest_2.
Index: RunMSFTsimpleTest_2.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2/RunMSFTsimpleTest_2.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RunMSFTsimpleTest_2.cs 18 Dec 2003 21:18:31 -0000 1.1
--- RunMSFTsimpleTest_2.cs 20 Dec 2003 18:43:50 -0000 1.2
***************
*** 63,66 ****
--- 63,69 ----
tradingSystems ,
10000 );
+
+ tester.Account.AccountStrategy = new AsMSFTsimpleTest_2(tester.Account );
+
//tester.Parameters.Add( new Parameter( "SMAdays" , 10 , 10 , 2 ) );
Index: TsMSFTsimpleTest_2.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/SimpleTesting/MSFTSimpleTest_2/TsMSFTsimpleTest_2.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TsMSFTsimpleTest_2.cs 18 Dec 2003 21:18:31 -0000 1.1
--- TsMSFTsimpleTest_2.cs 20 Dec 2003 18:43:50 -0000 1.2
***************
*** 25,28 ****
--- 25,29 ----
using QuantProject.ADT;
using QuantProject.ADT.Histories;
+ using QuantProject.ADT.Statistics;
using QuantProject.ADT.Optimizing;
using QuantProject.Business.Financial.Instruments;
***************
*** 52,58 ****
microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
microsoftCloseHistoryStandardDeviation =
! microsoftCloseHistory.GetStandardDeviation(5, new DateTime(2000,1,1),new DateTime(2000,12,31));
! microsoftCloseHistorySimpleAverage =
! microsoftCloseHistory.GetSimpleAverage(5, new DateTime(2000,1,1),new DateTime(2000,12,31));
}
--- 53,63 ----
microsoftCloseHistory = QuoteCache.GetCloseHistory( "MSFT" );
microsoftCloseHistoryStandardDeviation =
! microsoftCloseHistory.GetFunctionHistory (Function.StandardDeviation,5,
! new DateTime(2000,1,1),
! new DateTime(2000,12,31));
! microsoftCloseHistorySimpleAverage =
! microsoftCloseHistory.GetFunctionHistory (Function.SimpleAverage,5,
! new DateTime(2000,1,1),
! new DateTime(2000,12,31));
}
***************
*** 67,79 ****
{
! signal.Add( new Order( OrderType.MarketSellShort , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime(
new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
- signal.Add( new Order( OrderType.MarketCover , new Instrument( "MSFT" ) , 1 ,
- new ExtendedDateTime(
- new Instrument( "MSFT" ).GetMarketDay ( extendedDateTime.DateTime,5 ) ,
- BarComponent.Open ) ) );
-
signals.Add( signal );
--- 72,79 ----
{
! signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
new ExtendedDateTime(
new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signals.Add( signal );
***************
*** 84,93 ****
new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
- signal.Add( new Order( OrderType.MarketSell , new Instrument( "MSFT" ) , 1 ,
- new ExtendedDateTime( new Instrument( "MSFT" ).GetMarketDay( extendedDateTime.DateTime,5 ) ,
- BarComponent.Open ) ) );
signals.Add( signal );
}
!
}
--- 84,95 ----
new ExtendedDateTime( new Instrument( "MSFT" ).GetNextMarketDay( extendedDateTime.DateTime ) ,
BarComponent.Open ) ) );
signals.Add( signal );
}
! }
! else
! //no signal given by the history of standard deviation
! {
! // TODO:...
! //if there's an open position, return a signal to close it the next market day
}
|