[Quantproject-developers] QuantProject/b7_Scripts/General/Strategies SimpleStrategy.cs, 1.1, 1.2
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-09-29 21:17:27
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/General/Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15598/Strategies Modified Files: SimpleStrategy.cs Log Message: The new revision moves toward an intraday enabled framework. EndOfDayDate time has been removed, DateTime is used now. The code has been changed accordingly. Index: SimpleStrategy.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/General/Strategies/SimpleStrategy.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleStrategy.cs 16 Aug 2008 19:06:12 -0000 1.1 --- SimpleStrategy.cs 29 Sep 2008 21:17:04 -0000 1.2 *************** *** 19,23 **** along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; --- 19,23 ---- along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ using System; *************** *** 44,52 **** WeightedPositions weightedPositions , IIntervalsSelector intervalsSelector , ! IHistoricalQuoteProvider historicalQuoteProvider ) : base( 999 , 1 , intervalsSelector , intervalsSelector , ! new DummyEligibleSelector() , ! new DummyInSampleChooser() , ! historicalQuoteProvider ) { this.weightedPositions = weightedPositions; --- 44,52 ---- WeightedPositions weightedPositions , IIntervalsSelector intervalsSelector , ! HistoricalMarketValueProvider historicalMarketValueProvider ) : base( 999 , 1 , intervalsSelector , intervalsSelector , ! new DummyEligibleSelector() , ! new DummyInSampleChooser() , ! historicalMarketValueProvider ) { this.weightedPositions = weightedPositions; *************** *** 57,67 **** // true iif the current EndOfDayDateTime falls on the end of either the last // interval or the second last interval ! bool arePositionsToBeClosed = ( ( this.Account.Portfolio.Count > 0 ) && ! ( this.returnIntervals[ this.returnIntervals.Count - 1 ].End.IsEqualTo( ! this.now() ) ! || ! ( ( this.returnIntervals.Count > 1 ) && ! ( this.returnIntervals[ this.returnIntervals.Count - 2 ].End.IsEqualTo( ! this.now() ) ) ) ) ); return arePositionsToBeClosed; } --- 57,68 ---- // true iif the current EndOfDayDateTime falls on the end of either the last // interval or the second last interval ! bool arePositionsToBeClosed = ! ( ( this.Account.Portfolio.Count > 0 ) && ! ( ( this.returnIntervals[ this.returnIntervals.Count - 1 ].End == ! this.now() ) ! || ! ( ( this.returnIntervals.Count > 1 ) && ! ( this.returnIntervals[ this.returnIntervals.Count - 2 ].End == ! this.now() ) ) ) ); return arePositionsToBeClosed; } *************** *** 76,81 **** bool arePositionsToBeOpened = ( ( this.Account.Portfolio.Count == 0 ) && ! this.returnIntervals[ this.returnIntervals.Count - 1 ].Begin.IsEqualTo( ! this.now() ) ); return arePositionsToBeOpened; } --- 77,82 ---- bool arePositionsToBeOpened = ( ( this.Account.Portfolio.Count == 0 ) && ! this.returnIntervals[ this.returnIntervals.Count - 1 ].Begin == ! this.now() ); return arePositionsToBeOpened; } |