[Quantproject-developers] QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOs
Brought to you by:
glauco_1
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3961/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator Modified Files: PVOStrategyIntradayMain.cs PVOPositionsStatus.cs PVOStrategyIntraday.cs Log Message: PVOStrategyIntraday files have been updated. Index: PVOStrategyIntraday.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOStrategyIntraday.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PVOStrategyIntraday.cs 13 Mar 2009 15:12:01 -0000 1.4 --- PVOStrategyIntraday.cs 29 Mar 2009 18:31:00 -0000 1.5 *************** *** 71,75 **** protected IEligiblesSelector eligiblesSelector; protected Benchmark benchmark; ! protected HistoricalMarketValueProvider historicalMarketValueProviderForInSample; protected HistoricalMarketValueProvider --- 71,75 ---- protected IEligiblesSelector eligiblesSelector; protected Benchmark benchmark; ! protected HistoricalMarketValueProvider historicalMarketValueProviderForInSample; protected HistoricalMarketValueProvider *************** *** 102,105 **** --- 102,106 ---- protected bool takeProfitConditionReached; protected double inefficiencyLengthInMinutes; + protected int numberOfPreviousEfficientPeriods; protected double maxOpeningLengthInMinutes; protected double minutesFromLastInefficiencyTimeToWaitBeforeOpening; *************** *** 113,117 **** protected double stopLoss; protected double takeProfit; ! private string description_GetDescriptionForChooser() { --- 114,118 ---- protected double stopLoss; protected double takeProfit; ! private string description_GetDescriptionForChooser() { *************** *** 162,181 **** private void pvoStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! double oversoldThresholdMAX, ! double overboughtThresholdMAX, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.eligiblesSelector = eligiblesSelector; --- 163,183 ---- private void pvoStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! double oversoldThresholdMAX, ! double overboughtThresholdMAX, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! int numberOfPreviousEfficientPeriods, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.eligiblesSelector = eligiblesSelector; *************** *** 192,198 **** this.historicalMarketValueProviderForOutOfSample = historicalMarketValueProviderForOutOfSample; this.inefficiencyLengthInMinutes = inefficiencyLengthInMinutes; ! this.minutesFromLastInefficiencyTimeToWaitBeforeOpening = minutesFromLastInefficiencyTimeToWaitBeforeOpening; ! this.minutesFromLastLossOrProfitToWaitBeforeClosing = minutesFromLastLossOrProfitToWaitBeforeClosing; this.maxOpeningLengthInMinutes = maxOpeningLengthInMinutes; --- 194,201 ---- this.historicalMarketValueProviderForOutOfSample = historicalMarketValueProviderForOutOfSample; this.inefficiencyLengthInMinutes = inefficiencyLengthInMinutes; ! this.numberOfPreviousEfficientPeriods = numberOfPreviousEfficientPeriods; ! this.minutesFromLastInefficiencyTimeToWaitBeforeOpening = minutesFromLastInefficiencyTimeToWaitBeforeOpening; ! this.minutesFromLastLossOrProfitToWaitBeforeClosing = minutesFromLastLossOrProfitToWaitBeforeClosing; this.maxOpeningLengthInMinutes = maxOpeningLengthInMinutes; *************** *** 209,346 **** public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! IInSampleChooser inSampleChooser, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! double oversoldThresholdMAX, ! double overboughtThresholdMAX, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! oversoldThresholdMAX, overboughtThresholdMAX, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.inSampleChooser = inSampleChooser; } public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! IInSampleChooser inSampleChooser, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! double.MaxValue, double.MaxValue, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.inSampleChooser = inSampleChooser; } public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! TestingPositions[] chosenPVOPositions, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! double oversoldThresholdMAX, ! double overboughtThresholdMAX, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! oversoldThresholdMAX, overboughtThresholdMAX, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.chosenPVOPositions = chosenPVOPositions; } public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! TestingPositions[] chosenPVOPositions, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! double.MaxValue, double.MaxValue, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.chosenPVOPositions = chosenPVOPositions; } private bool allTickersAreExchangedBeforeLastAvailableTime(DateTime fromDateTime, ! string[] tickers) { bool returnValue = true; --- 212,357 ---- public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! IInSampleChooser inSampleChooser, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! double oversoldThresholdMAX, ! double overboughtThresholdMAX, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! int numberOfPreviousEfficientPeriods, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! oversoldThresholdMAX, overboughtThresholdMAX, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! numberOfPreviousEfficientPeriods, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.inSampleChooser = inSampleChooser; } public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! IInSampleChooser inSampleChooser, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! int numberOfPreviousEfficientPeriods, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! double.MaxValue, double.MaxValue, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! numberOfPreviousEfficientPeriods, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.inSampleChooser = inSampleChooser; } public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! TestingPositions[] chosenPVOPositions, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! double oversoldThresholdMAX, ! double overboughtThresholdMAX, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! int numberOfPreviousEfficientPeriods, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! oversoldThresholdMAX, overboughtThresholdMAX, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! numberOfPreviousEfficientPeriods, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.chosenPVOPositions = chosenPVOPositions; } public PVOStrategyIntraday(IEligiblesSelector eligiblesSelector, ! int minimumNumberOfEligiblesForValidOptimization, ! TestingPositions[] chosenPVOPositions, ! int inSampleDays, ! Benchmark benchmark, ! int numDaysBetweenEachOptimization, ! double oversoldThreshold, ! double overboughtThreshold, ! HistoricalMarketValueProvider historicalMarketValueProviderForInSample, ! HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample, ! double inefficiencyLengthInMinutes, ! int numberOfPreviousEfficientPeriods, ! double minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! double minutesFromLastLossOrProfitToWaitBeforeClosing, ! double maxOpeningLengthInMinutes, ! List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, ! inSampleDays , benchmark , numDaysBetweenEachOptimization , ! oversoldThreshold, overboughtThreshold, ! double.MaxValue, double.MaxValue, ! historicalMarketValueProviderForInSample, ! historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes, ! numberOfPreviousEfficientPeriods, ! minutesFromLastInefficiencyTimeToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, ! maxOpeningLengthInMinutes, ! openingTimesForAvailableBars, ! stopLoss, takeProfit); this.chosenPVOPositions = chosenPVOPositions; } private bool allTickersAreExchangedBeforeLastAvailableTime(DateTime fromDateTime, ! string[] tickers) { bool returnValue = true; *************** *** 348,352 **** for( int i = 0; i < tickers.Length; i++ ) { ! Bars currentTickerBars = new Bars(tickers[i], fromDateTime, Time.GetDateTimeFromMerge(fromDateTime, --- 359,363 ---- for( int i = 0; i < tickers.Length; i++ ) { ! Bars currentTickerBars = new Bars(tickers[i], fromDateTime, Time.GetDateTimeFromMerge(fromDateTime, *************** *** 389,411 **** return returnValue; } ! #region newDateTimeEventHandler_closePositions ! private void newDateTimeEventHandler_closePositions(Time currentDailyTime) { bool positionsHaveBeenOpenedEnough = ! (this.account.Portfolio.Count > 0 && ! this.lastEntryTime.AddMinutes(maxOpeningLengthInMinutes) <= currentDailyTime); ! bool isTimeToProfitOrToStopALoss = ! this.account.Portfolio.Count > 0 && ! (this.takeProfitConditionReached || this.stopLossConditionReached) && ! (this.lastProfitOrLossTime.AddMinutes(this.minutesFromLastLossOrProfitToWaitBeforeClosing) == currentDailyTime); if( (positionsHaveBeenOpenedEnough || isTimeToProfitOrToStopALoss ) && ! allTickersAreExchanged( this.now(), AccountManager.GetTickersInOpenedPositions(this.account) ) ) { ! AccountManager.ClosePositions( this.account ); ! this.lastEntryTime = new Time("00:00:00"); ! this.lastInefficiencyTime = new Time("00:00:00"); } } --- 400,425 ---- return returnValue; } ! #region newDateTimeEventHandler_closePositions ! private void newDateTimeEventHandler_closePositions(Time currentDailyTime) { bool positionsHaveBeenOpenedEnough = ! (this.account.Portfolio.Count > 0 && ! this.lastEntryTime.AddMinutes(maxOpeningLengthInMinutes) <= currentDailyTime); ! bool isTimeToProfitOrToStopALoss = ! this.account.Portfolio.Count > 0 && ! (this.takeProfitConditionReached || this.stopLossConditionReached) && ! (this.lastProfitOrLossTime.AddMinutes(this.minutesFromLastLossOrProfitToWaitBeforeClosing) == currentDailyTime); if( (positionsHaveBeenOpenedEnough || isTimeToProfitOrToStopALoss ) && ! allTickersAreExchanged( this.now(), AccountManager.GetTickersInOpenedPositions(this.account) ) ) { ! AccountManager.ClosePositions( this.account ); ! this.lastEntryTime = new Time("00:00:00"); ! this.lastInefficiencyTime = new Time("00:00:00"); ! this.lastProfitOrLossTime = new Time("00:00:00"); ! this.takeProfitConditionReached = false; ! this.stopLossConditionReached = false; } } *************** *** 418,482 **** DateTime dateTimeForClose = Time.GetDateTimeFromMerge( this.now(), timeForClose ); if( this.account.Portfolio.Count == 0 && ! this.positionsForOutOfSample != null && ! timeForClose <= getLastEventTimeWithCachedBars() && ! this.allTickersAreExchanged( this.now(), this.positionsForOutOfSample.WeightedPositions.SignedTickers.Tickers ) && ! this.allTickersAreExchangedBeforeLastAvailableTime( dateTimeForClose, this.positionsForOutOfSample.WeightedPositions.SignedTickers.Tickers ) ) { switch (this.positionsForOutOfSampleStatus) { case PVOPositionsStatus.Overbought: - { - #region manage Overbought case - this.positionsForOutOfSample.WeightedPositions.Reverse(); - try - { - AccountManager.OpenPositions( this.positionsForOutOfSample.WeightedPositions, - this.account ); - this.lastEntryTime = currentDailyTime; - this.previousAccountValue = this.account.GetMarketValue(); - } - catch(Exception ex) - { - string forBreakpoint = ex.Message; forBreakpoint = forBreakpoint + ""; - } - finally { this.positionsForOutOfSample.WeightedPositions.Reverse(); } - #endregion - break; - } case PVOPositionsStatus.Oversold: - { - #region manage Oversold case - try { ! AccountManager.OpenPositions( this.positionsForOutOfSample.WeightedPositions, ! this.account ); ! this.lastEntryTime = currentDailyTime; ! this.previousAccountValue = this.account.GetMarketValue(); ! } ! catch(Exception ex) ! { ! string forBreakpoint = ex.Message; forBreakpoint = forBreakpoint + ""; } - #endregion oversold case - break; - } case PVOPositionsStatus.InTheMiddle://that is ! { //pvoPositionsForOutOfSample has not been set ! ! break; ! } default: ! { ! //it should never been reached ! break; ! } } } } #endregion newDateTimeEventHandler_openPositions #region newDateTimeEventHandler_inefficiencyIsMovingBack private bool newDateTimeEventHandler_inefficiencyIsMovingBack(Time currentDailyTime) --- 432,538 ---- DateTime dateTimeForClose = Time.GetDateTimeFromMerge( this.now(), timeForClose ); if( this.account.Portfolio.Count == 0 && ! this.positionsForOutOfSample != null && ! timeForClose <= getLastEventTimeWithCachedBars() && ! this.allTickersAreExchanged( this.now(), this.positionsForOutOfSample.WeightedPositions.SignedTickers.Tickers ) && ! this.allTickersAreExchangedBeforeLastAvailableTime( dateTimeForClose, this.positionsForOutOfSample.WeightedPositions.SignedTickers.Tickers ) ) { switch (this.positionsForOutOfSampleStatus) { case PVOPositionsStatus.Overbought: { + #region manage Overbought case this.positionsForOutOfSample.WeightedPositions.Reverse(); + try + { + AccountManager.OpenPositions( this.positionsForOutOfSample.WeightedPositions, + this.account ); + this.lastEntryTime = currentDailyTime; + this.previousAccountValue = this.account.GetMarketValue(); + } + catch(Exception ex) + { + string forBreakpoint = ex.Message; forBreakpoint = forBreakpoint + ""; + } + finally + { + this.positionsForOutOfSample.WeightedPositions.Reverse(); + } + #endregion + break; } case PVOPositionsStatus.Oversold: { ! #region manage Oversold case ! try ! { ! AccountManager.OpenPositions( this.positionsForOutOfSample.WeightedPositions, ! this.account ); ! this.lastEntryTime = currentDailyTime; ! this.previousAccountValue = this.account.GetMarketValue(); ! } ! catch(Exception ex) ! { ! string forBreakpoint = ex.Message; forBreakpoint = forBreakpoint + ""; ! } ! #endregion oversold case ! break; } case PVOPositionsStatus.InTheMiddle://that is ! { //pvoPositionsForOutOfSample has not been set ! ! break; ! } default: ! { ! //it should never been reached ! break; ! } } } } #endregion newDateTimeEventHandler_openPositions + + #region newDateTimeEventHandler_previousPeriodsWereEfficient + private PVOPositionsStatus newDateTimeEventHandler_previousPeriodsWereEfficient_getStatus( DateTime beginOfOscillatingPeriod, + DateTime endOfOscillatingPeriod ) + { + PVOPositionsStatus returnValue = PVOPositionsStatus.NotComputable; + if(this.positionsForOutOfSample != null) + try{ + returnValue = + this.positionsForOutOfSample.GetStatus( beginOfOscillatingPeriod, endOfOscillatingPeriod, + this.benchmark.Ticker, this.historicalMarketValueProviderForOutOfSample, + this.oversoldThreshold, + this.oversoldThresholdMAX, + this.overboughtThreshold, + this.overboughtThresholdMAX ); + }catch{} + return returnValue; + } + + private bool newDateTimeEventHandler_previousPeriodsWereEfficient(Time currentDailyTime) + { + bool returnValue = true; + PVOPositionsStatus statusForCurrentPeriodBeforeInefficiencyTime; + for( int i = 1; i <= this.numberOfPreviousEfficientPeriods; i++ ) + { + DateTime beginOfOscillatingPeriod = + Time.GetDateTimeFromMerge( this.now() , this.lastInefficiencyTime.AddMinutes( - (i+1)*this.inefficiencyLengthInMinutes ) ); + DateTime endOfOscillatingPeriod = + Time.GetDateTimeFromMerge( this.now() , this.lastInefficiencyTime.AddMinutes( - i*this.inefficiencyLengthInMinutes ) ); + statusForCurrentPeriodBeforeInefficiencyTime = + this.newDateTimeEventHandler_previousPeriodsWereEfficient_getStatus( beginOfOscillatingPeriod, + endOfOscillatingPeriod ); + if( statusForCurrentPeriodBeforeInefficiencyTime != PVOPositionsStatus.InTheMiddle ) + { + returnValue = false; + i = this.numberOfPreviousEfficientPeriods; + } + } + return returnValue; + } + #endregion newDateTimeEventHandler_previousPeriodsWereEfficient + #region newDateTimeEventHandler_inefficiencyIsMovingBack private bool newDateTimeEventHandler_inefficiencyIsMovingBack(Time currentDailyTime) *************** *** 485,530 **** DateTime beginOfOscillatingPeriod = Time.GetDateTimeFromMerge( this.now() , this.lastInefficiencyTime ); ! DateTime endOfOscillatingPeriod = Time.GetDateTimeFromMerge( this.now() , currentDailyTime ); PVOPositionsStatus currentStatusForCurrentPositions = PVOPositionsStatus.InTheMiddle; ! double coefficientForThresholdLevelComputationForMovingBackSignal = //(this.overboughtThreshold - this.takeProfit)/this.overboughtThreshold; this.minutesFromLastInefficiencyTimeToWaitBeforeOpening/ // this.inefficiencyLengthInMinutes; ! 100000; if(this.positionsForOutOfSample != null) try{ ! currentStatusForCurrentPositions = ! this.positionsForOutOfSample.GetStatus( beginOfOscillatingPeriod, endOfOscillatingPeriod, ! this.benchmark.Ticker, this.historicalMarketValueProviderForOutOfSample, ! this.oversoldThreshold * coefficientForThresholdLevelComputationForMovingBackSignal, ! this.oversoldThreshold, ! this.overboughtThreshold * coefficientForThresholdLevelComputationForMovingBackSignal, ! this.overboughtThreshold ); ! }catch{} returnValue = ( (currentStatusForCurrentPositions == PVOPositionsStatus.Overbought && ! this.positionsForOutOfSampleStatus == PVOPositionsStatus.Oversold) || ! (currentStatusForCurrentPositions == PVOPositionsStatus.Oversold && ! this.positionsForOutOfSampleStatus == PVOPositionsStatus.Overbought) ); ! if( (returnValue == false && ! currentDailyTime >= this.lastInefficiencyTime.AddMinutes(this.inefficiencyLengthInMinutes) ) || ! returnValue == true ) ! //positions are not moving back and the same n° of minutes as inefficiency length ! //has elapsed OR positions are moving back (the gap is closing) ! this.lastInefficiencyTime = new Time(0,0,0); //it forces a new research of an inefficiency return returnValue; } - - #endregion newDateTimeEventHandler_inefficiencyIsMovingBack ! #region newDateTimeEventHandler_updateStatus private void newDateTimeEventHandler_setPositionsAndStatus(Time currentDailyTime) { ! DateTime beginOfOscillatingPeriod = Time.GetDateTimeFromMerge(this.now() , currentDailyTime.AddMinutes(-inefficiencyLengthInMinutes) ); ! DateTime endOfOscillatingPeriod = Time.GetDateTimeFromMerge(this.now() , currentDailyTime); // this.positionsForOutOfSample = null; --- 541,578 ---- DateTime beginOfOscillatingPeriod = Time.GetDateTimeFromMerge( this.now() , this.lastInefficiencyTime ); ! DateTime endOfOscillatingPeriod = Time.GetDateTimeFromMerge( this.now() , currentDailyTime ); PVOPositionsStatus currentStatusForCurrentPositions = PVOPositionsStatus.InTheMiddle; ! double coefficientForThresholdLevelComputationForMovingBackSignal = //(this.overboughtThreshold - this.takeProfit)/this.overboughtThreshold; this.minutesFromLastInefficiencyTimeToWaitBeforeOpening/ // this.inefficiencyLengthInMinutes; ! 100000; if(this.positionsForOutOfSample != null) try{ ! currentStatusForCurrentPositions = ! this.positionsForOutOfSample.GetStatus( beginOfOscillatingPeriod, endOfOscillatingPeriod, ! this.benchmark.Ticker, this.historicalMarketValueProviderForOutOfSample, ! this.oversoldThreshold * coefficientForThresholdLevelComputationForMovingBackSignal, ! this.oversoldThreshold, ! this.overboughtThreshold * coefficientForThresholdLevelComputationForMovingBackSignal, ! this.overboughtThreshold ); ! }catch{} returnValue = ( (currentStatusForCurrentPositions == PVOPositionsStatus.Overbought && ! this.positionsForOutOfSampleStatus == PVOPositionsStatus.Oversold) || ! (currentStatusForCurrentPositions == PVOPositionsStatus.Oversold && ! this.positionsForOutOfSampleStatus == PVOPositionsStatus.Overbought) ); return returnValue; } #endregion newDateTimeEventHandler_inefficiencyIsMovingBack ! #region newDateTimeEventHandler_updateStatus private void newDateTimeEventHandler_setPositionsAndStatus(Time currentDailyTime) { ! DateTime beginOfOscillatingPeriod = Time.GetDateTimeFromMerge(this.now() , currentDailyTime.AddMinutes(-inefficiencyLengthInMinutes) ); ! DateTime endOfOscillatingPeriod = Time.GetDateTimeFromMerge(this.now() , currentDailyTime); // this.positionsForOutOfSample = null; *************** *** 536,546 **** if(this.chosenPVOPositions[i] != null) try{ ! this.positionsForOutOfSampleStatus = ! ((PVOPositions)this.chosenPVOPositions[i]).GetStatus(beginOfOscillatingPeriod, endOfOscillatingPeriod, this.benchmark.Ticker, this.historicalMarketValueProviderForOutOfSample, this.oversoldThresholdMAX, this.overboughtThresholdMAX); - - }catch(Exception ex){string str = ex.ToString();} if(this.positionsForOutOfSampleStatus == PVOPositionsStatus.Oversold || this.positionsForOutOfSampleStatus == PVOPositionsStatus.Overbought ) --- 584,594 ---- if(this.chosenPVOPositions[i] != null) try{ ! this.positionsForOutOfSampleStatus = ! ((PVOPositions)this.chosenPVOPositions[i]).GetStatus(beginOfOscillatingPeriod, endOfOscillatingPeriod, this.benchmark.Ticker, this.historicalMarketValueProviderForOutOfSample, this.oversoldThresholdMAX, this.overboughtThresholdMAX); + }catch(Exception ex){string str = ex.ToString();} + if(this.positionsForOutOfSampleStatus == PVOPositionsStatus.Oversold || this.positionsForOutOfSampleStatus == PVOPositionsStatus.Overbought ) *************** *** 558,565 **** { //this.previousAccountValue has been set at opening positions ! this.stopLossConditionReached = false; ! this.takeProfitConditionReached = false; ! this.lastProfitOrLossTime = new Time("00:00:00"); ! if(this.account.Portfolio.Count > 0) { try{ --- 606,613 ---- { //this.previousAccountValue has been set at opening positions ! if( this.account.Portfolio.Count > 0 && ! this.takeProfitConditionReached == false && ! this.stopLossConditionReached == false && ! this.lastProfitOrLossTime == new Time("00:00:00") ) { try{ *************** *** 583,587 **** } catch(Exception ex) ! {string forBreakpoint = ex.Message; forBreakpoint = forBreakpoint + "";} } } --- 631,635 ---- } catch(Exception ex) ! {string forBreakpoint = ex.Message; forBreakpoint = forBreakpoint + "";} } } *************** *** 589,592 **** --- 637,650 ---- #endregion newDateTimeEventHandler_updateStopLossAndTakeProfitConditions + private void newDateTimeEventHandler_resetForNewResearch(bool inefficiencyIsMovingBack, + bool previousPeriodsWereEfficient, + Time currentTime) + { + if( currentTime > this.lastInefficiencyTime.AddMinutes(this.minutesFromLastInefficiencyTimeToWaitBeforeOpening) || + (inefficiencyIsMovingBack == true && previousPeriodsWereEfficient == true) ) + + this.lastInefficiencyTime = new Time(0,0,0); //it forces a new research of an inefficiency + } + public virtual void NewDateTimeEventHandler( Object sender , DateTime dateTime ) *************** *** 596,618 **** this.newDateTimeEventHandler_closePositions(currentTime); if( this.account.Portfolio.Count == 0 && ! this.chosenPVOPositions != null && ! this.lastInefficiencyTime == new Time(0,0,0) && ! currentTime < getLastEventTimeWithCachedBars() && ! currentTime >= ! getFirstEventTimeWithCachedBars().AddMinutes(inefficiencyLengthInMinutes) ) ! //portfolio empty, optimization done, no inefficiency found, time OK this.newDateTimeEventHandler_setPositionsAndStatus(currentTime); if( this.account.Portfolio.Count == 0 && ! currentTime >= ! this.lastInefficiencyTime.AddMinutes(this.minutesFromLastInefficiencyTimeToWaitBeforeOpening) ! && ! this.newDateTimeEventHandler_inefficiencyIsMovingBack(currentTime) ! ) ! //it's time for starting checking if the last inefficiency found is moving back this.newDateTimeEventHandler_openPositions(currentTime); ! if( currentTime == getLastEventTimeWithCachedBars() ) ! //it's time for new optimization, if the case { this.newDateTimeEventHandler_updateTestingPositions( dateTime ); --- 654,682 ---- this.newDateTimeEventHandler_closePositions(currentTime); if( this.account.Portfolio.Count == 0 && ! this.chosenPVOPositions != null && ! this.lastInefficiencyTime == new Time(0,0,0) && ! currentTime < getLastEventTimeWithCachedBars() && ! currentTime >= ! getFirstEventTimeWithCachedBars().AddMinutes( inefficiencyLengthInMinutes + ! inefficiencyLengthInMinutes * this.numberOfPreviousEfficientPeriods ) ) ! //portfolio empty, optimization done, no inefficiency found (or found but not deployed), time OK this.newDateTimeEventHandler_setPositionsAndStatus(currentTime); + bool inefficiencyIsMovingBack = + this.newDateTimeEventHandler_inefficiencyIsMovingBack(currentTime); + bool previousPeriodsWereEfficient = + this.newDateTimeEventHandler_previousPeriodsWereEfficient(currentTime); if( this.account.Portfolio.Count == 0 && ! this.lastInefficiencyTime != new Time(0, 0, 0) && ! currentTime >= ! this.lastInefficiencyTime.AddMinutes(this.minutesFromLastInefficiencyTimeToWaitBeforeOpening) ! && inefficiencyIsMovingBack && previousPeriodsWereEfficient ! ) this.newDateTimeEventHandler_openPositions(currentTime); ! this.newDateTimeEventHandler_resetForNewResearch(inefficiencyIsMovingBack, ! previousPeriodsWereEfficient, ! currentTime); if( currentTime == getLastEventTimeWithCachedBars() ) ! //it's time for new optimization, if the case { this.newDateTimeEventHandler_updateTestingPositions( dateTime ); *************** *** 621,625 **** this.lastInefficiencyTime = new Time(0,0,0); } - } --- 685,688 ---- *************** *** 688,695 **** this.benchmark.Ticker ); if(this.inSampleChooser is PVOIntradayCorrelationChooser) ! returnIntervals = ! new IntradayIntervals(firstDateTime, lastDateTime, ! ((PVOIntradayCorrelationChooser)this.inSampleChooser).ReturnIntervalLengthInMinutes, ! this.benchmark.Ticker); if( this.inSampleChooser is PVOCorrelationChooser ) --- 751,758 ---- this.benchmark.Ticker ); if(this.inSampleChooser is PVOIntradayCorrelationChooser) ! returnIntervals = ! new IntradayIntervals(firstDateTime, lastDateTime, ! ((PVOIntradayCorrelationChooser)this.inSampleChooser).ReturnIntervalLengthInMinutes, ! this.benchmark.Ticker); if( this.inSampleChooser is PVOCorrelationChooser ) Index: PVOStrategyIntradayMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOStrategyIntradayMain.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PVOStrategyIntradayMain.cs 29 Mar 2009 18:04:32 -0000 1.5 --- PVOStrategyIntradayMain.cs 29 Mar 2009 18:31:00 -0000 1.6 *************** *** 66,69 **** --- 66,70 ---- private HistoricalMarketValueProvider historicalMarketValueProviderForTheBackTester; private double inefficiencyLengthInMinutes; + private int numberOfPreviousEfficientPeriods; private double maxOpeningLengthInMinutes; private double minutesFromLastInefficiencyToWaitBeforeOpening; *************** *** 78,82 **** { this.inefficiencyLengthInMinutes = 30; ! this.maxOpeningLengthInMinutes = 240; this.minutesFromLastInefficiencyToWaitBeforeOpening = 1; this.minutesFromLastLossOrProfitToWaitBeforeClosing = 0; --- 79,84 ---- { this.inefficiencyLengthInMinutes = 30; ! this.numberOfPreviousEfficientPeriods = 1; ! this.maxOpeningLengthInMinutes = 180; this.minutesFromLastInefficiencyToWaitBeforeOpening = 1; this.minutesFromLastLossOrProfitToWaitBeforeClosing = 0; *************** *** 84,88 **** this.intervalFrameInSeconds = 60; ! this.firstDateTime = new DateTime( 2006 , 2 , 1 ); this.lastDateTime = new DateTime( 2006 , 12, 31 ); --- 86,90 ---- this.intervalFrameInSeconds = 60; ! this.firstDateTime = new DateTime( 2006 , 1, 1 ); this.lastDateTime = new DateTime( 2006 , 12, 31 ); *************** *** 93,98 **** this.historicalMarketValueProviderForInSample = ! // new HistoricalAdjustedQuoteProvider(); ! new HistoricalBarInterpolatingProvider( this.getBarCache() ); this.historicalMarketValueProviderForTheBackTester = --- 95,100 ---- this.historicalMarketValueProviderForInSample = ! new HistoricalAdjustedQuoteProvider(); ! // new HistoricalBarInterpolatingProvider( this.getBarCache() ); this.historicalMarketValueProviderForTheBackTester = *************** *** 117,131 **** int maxNumberOfEligiblesToBeChosen = 100; ! string tickersGroupId = "SP500"; bool temporizedGroup = true; int numDaysForAverageRawOpenPriceComputation = 10; ! double minPrice = 30; double maxPrice = 300; ! // int maxNumberOfMostLiquidTickersToBeChosen = 150; ! // int numDaysForVolatility = 10; ! int minimumNumberOfMinutelyBarsForEachDayForInSample = 20; // IEligiblesSelector eligiblesSelector = --- 119,134 ---- int maxNumberOfEligiblesToBeChosen = 100; ! //int numOfTopRowsToDeleteFromSelectorByLiquidity = 0; ! string tickersGroupId = "SP500"; bool temporizedGroup = true; int numDaysForAverageRawOpenPriceComputation = 10; ! double minPrice = 25; double maxPrice = 300; ! int maxNumberOfMostLiquidTickersToBeChosen = 150; ! int numDaysForVolatility = 10; ! // int minimumNumberOfMinutelyBarsForEachDayForInSample = 20; // IEligiblesSelector eligiblesSelector = *************** *** 137,156 **** // this.benchmark.Ticker ); // LAST GOOD - // IEligiblesSelector eligiblesSelector = - // new ByPriceMostLiquidLessVolatileOTCAlwaysQuoted( - // tickersGroupId , temporizedGroup , - // maxNumberOfEligiblesToBeChosen , - // maxNumberOfMostLiquidTickersToBeChosen , - // numDaysForAverageRawOpenPriceComputation , - // numDaysForVolatility , - // minPrice , maxPrice ); - IEligiblesSelector eligiblesSelector = ! new ByPriceMostLiquidAlwaysIntradayQuoted( ! tickersGroupId , this.benchmark, temporizedGroup , maxNumberOfEligiblesToBeChosen , ! numDaysForAverageRawOpenPriceComputation , ! minPrice , maxPrice, ! minimumNumberOfMinutelyBarsForEachDayForInSample ); // IEligiblesSelector eligiblesSelector = --- 140,160 ---- // this.benchmark.Ticker ); // LAST GOOD IEligiblesSelector eligiblesSelector = ! new ByPriceMostLiquidLessVolatileOTCAlwaysQuoted( ! tickersGroupId , temporizedGroup , maxNumberOfEligiblesToBeChosen , ! maxNumberOfMostLiquidTickersToBeChosen , ! numDaysForAverageRawOpenPriceComputation , ! numDaysForVolatility , ! minPrice , maxPrice ); ! ! // IEligiblesSelector eligiblesSelector = ! // new ByPriceMostLiquidAlwaysIntradayQuoted( ! // tickersGroupId , this.benchmark, temporizedGroup , ! // maxNumberOfEligiblesToBeChosen , ! // numOfTopRowsToDeleteFromSelectorByLiquidity, ! // numDaysForAverageRawOpenPriceComputation , ! // minPrice , maxPrice, ! // minimumNumberOfMinutelyBarsForEachDayForInSample ); // IEligiblesSelector eligiblesSelector = *************** *** 187,196 **** double maxCorrelationAllowed = 0.96; ! int numberOfBestTestingPositionsToBeReturned = 50; ! numberOfBestTestingPositionsToBeReturned = 50; bool balancedWeightsOnVolatilityBase = true; float minimumAbsoluteReturnValue = 0.00005f; float maximumAbsoluteReturnValue = 100000f; ! int returnIntervalLengthInMinutesForCorrelationProvider = 120; //correlation is computed only for returns //between minimum and maximum --- 191,199 ---- double maxCorrelationAllowed = 0.96; ! int numberOfBestTestingPositionsToBeReturned = 40; bool balancedWeightsOnVolatilityBase = true; float minimumAbsoluteReturnValue = 0.00005f; float maximumAbsoluteReturnValue = 100000f; ! //int returnIntervalLengthInMinutesForCorrelationProvider = 120; //correlation is computed only for returns //between minimum and maximum *************** *** 204,214 **** // minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker); IInSampleChooser inSampleChooser = ! // new PVO_CTCCorrelationChooser(numberOfBestTestingPositionsToBeReturned, ! // 1 , maxCorrelationAllowed , balancedWeightsOnVolatilityBase, ! // minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker); ! new PVOIntradayCorrelationChooser(numberOfBestTestingPositionsToBeReturned, ! returnIntervalLengthInMinutesForCorrelationProvider , ! maxCorrelationAllowed , balancedWeightsOnVolatilityBase, minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker); // //office --- 207,217 ---- // minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker); IInSampleChooser inSampleChooser = ! new PVO_CTCCorrelationChooser(numberOfBestTestingPositionsToBeReturned, ! 1 , maxCorrelationAllowed , balancedWeightsOnVolatilityBase, minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker); + // new PVOIntradayCorrelationChooser(numberOfBestTestingPositionsToBeReturned, + // returnIntervalLengthInMinutesForCorrelationProvider , + // maxCorrelationAllowed , balancedWeightsOnVolatilityBase, + // minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker); // //office *************** *** 220,224 **** // inSampleChooser = // new PVOChooserFromSavedBackTestLog( ! // @"C:\Utente\MarcoVarie\Vari\qP\LogArchive\2009_02_17_23_17_03_PVOIntraday_from_2006_01_01_to_2007_12_31_annlRtrn_24.44_maxDD_3.05\2009_02_17_23_17_03_PVOIntraday_from_2006_01_01_to_2007_12_31_annlRtrn_24.44_maxDD_3.05.qpL", // numberOfBestTestingPositionsToBeReturned); return inSampleChooser; --- 223,227 ---- // inSampleChooser = // new PVOChooserFromSavedBackTestLog( ! // @"C:\Utente\MarcoVarie\Vari\qP\LogArchive\2009_03_22_10_29_04_PVOIntraday_from_2006_02_01_to_2006_12_29_annlRtrn_.17_maxDD_5.03\2009_03_22_10_29_04_PVOIntraday_from_2006_02_01_to_2006_12_29_annlRtrn_.17_maxDD_5.03.qpL", // numberOfBestTestingPositionsToBeReturned); return inSampleChooser; *************** *** 228,240 **** { //int inSampleDays = 90; ! int inSampleDays = 30; ! int numDaysBetweenEachOptimization = 4; int minNumOfEligiblesForValidOptimization = 20; ! double oversoldThreshold = 0.005;//0.006 ! double overboughtThreshold = 0.005;//0.006 ! double oversoldThresholdMAX = 0.025; ! double overboughtThresholdMAX = 0.025; double stopLoss = 0.02; ! double takeProfit = 0.0025;//0.0045 IStrategyForBacktester strategyForBacktester --- 231,243 ---- { //int inSampleDays = 90; ! int inSampleDays = 90; ! int numDaysBetweenEachOptimization = 5; int minNumOfEligiblesForValidOptimization = 20; ! double oversoldThreshold = 0.006;//0.006 ! double overboughtThreshold = 0.006;//0.006 ! double oversoldThresholdMAX = 0.02; ! double overboughtThresholdMAX = 0.02; double stopLoss = 0.02; ! double takeProfit = 0.003;//0.0045 IStrategyForBacktester strategyForBacktester *************** *** 250,255 **** historicalMarketValueProviderForInSample, historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes , minutesFromLastInefficiencyToWaitBeforeOpening, ! this.minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, this.getDailyTimes(), stopLoss , takeProfit ); --- 253,260 ---- historicalMarketValueProviderForInSample, historicalMarketValueProviderForOutOfSample, ! inefficiencyLengthInMinutes , ! numberOfPreviousEfficientPeriods, ! minutesFromLastInefficiencyToWaitBeforeOpening, ! minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, this.getDailyTimes(), stopLoss , takeProfit ); *************** *** 291,295 **** // new InteractiveBrokerAccountProvider(fixedPercentageSlippage); double cashToStart = 25000; ! double maxRunningHours = 15; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( --- 296,300 ---- // new InteractiveBrokerAccountProvider(fixedPercentageSlippage); double cashToStart = 25000; ! double maxRunningHours = 240; EndOfDayStrategyBackTester endOfDayStrategyBackTester = new EndOfDayStrategyBackTester( Index: PVOPositionsStatus.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOPositionsStatus.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PVOPositionsStatus.cs 14 Aug 2008 23:28:06 -0000 1.2 --- PVOPositionsStatus.cs 29 Mar 2009 18:31:00 -0000 1.3 *************** *** 35,39 **** InTheMiddle, Overbought, ! OverMaximumThresholds } } --- 35,40 ---- InTheMiddle, Overbought, ! OverMaximumThresholds, ! NotComputable } } |