[Quantproject-developers] QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOs
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2009-08-30 21:43:45
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20419/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator Modified Files: PVOLogItem.cs PVOMain.cs PVOPositions.cs PVOStrategy.cs PVOStrategyIntraday.cs PVOStrategyIntradayMain.cs Log Message: PVO script files have been updated Index: PVOStrategy.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOStrategy.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PVOStrategy.cs 29 Sep 2008 21:18:34 -0000 1.7 --- PVOStrategy.cs 30 Aug 2009 21:43:34 -0000 1.8 *************** *** 23,26 **** --- 23,27 ---- using System.Data; using System.Collections; + using System.Collections.Generic; using QuantProject.ADT; *************** *** 46,49 **** --- 47,51 ---- using QuantProject.Data.DataTables; using QuantProject.ADT.Optimizing.Genetic; + using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.EntryConditions; using QuantProject.Scripts.TickerSelectionTesting.EfficientPortfolios; using QuantProject.Scripts.WalkForwardTesting.LinearCombination; *************** *** 81,86 **** protected PVOPositions pvoPositionsForOutOfSample; protected DateTime lastCloseDate; - protected bool portfolioHasBeenOverbought; - protected bool portfolioHasBeenOversold; protected Account account; public Account Account --- 83,86 ---- *************** *** 91,94 **** --- 91,97 ---- protected bool stopLossConditionReached; protected bool takeProfitConditionReached; + protected bool maxNumberOfDaysOnTheMarketReached; + protected int maxNumberOfDaysOnTheMarket; + protected int daysOnTheMarket; protected double currentAccountValue; protected double previousAccountValue; *************** *** 97,100 **** --- 100,108 ---- protected double oversoldThresholdMAX; protected double overboughtThresholdMAX; + protected double numOfStdDevForSignificantPriceMovements; + protected double leverage; + protected bool openOnlyLongPositions; + protected List<IEntryCondition> entryConditions; + protected bool allEntryConditionsHaveToBeSatisfied; private string description_GetDescriptionForChooser() *************** *** 138,144 **** double oversoldThresholdMAX, double overboughtThresholdMAX, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain) { this.eligiblesSelector = eligiblesSelector; --- 146,158 ---- double oversoldThresholdMAX, double overboughtThresholdMAX, + double numOfStdDevForSignificantPriceMovements, + double leverage, + bool openOnlyLongPositions, + int maxNumberOfDaysOnTheMarket, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain, ! List<IEntryCondition> entryConditions, ! bool allEntryConditionsHaveToBeSatisfied) { this.eligiblesSelector = eligiblesSelector; *************** *** 155,163 **** this.oversoldThresholdMAX = oversoldThresholdMAX; this.overboughtThresholdMAX = overboughtThresholdMAX; this.stopLossConditionReached = false; this.currentAccountValue = 0.0; this.previousAccountValue = 0.0; ! this.portfolioHasBeenOverbought = false; ! this.portfolioHasBeenOversold = false; } --- 169,181 ---- this.oversoldThresholdMAX = oversoldThresholdMAX; this.overboughtThresholdMAX = overboughtThresholdMAX; + this.numOfStdDevForSignificantPriceMovements = numOfStdDevForSignificantPriceMovements; + this.leverage = leverage; + this.openOnlyLongPositions = openOnlyLongPositions; + this.maxNumberOfDaysOnTheMarket = maxNumberOfDaysOnTheMarket; this.stopLossConditionReached = false; this.currentAccountValue = 0.0; this.previousAccountValue = 0.0; ! this.entryConditions = entryConditions; ! this.allEntryConditionsHaveToBeSatisfied = allEntryConditionsHaveToBeSatisfied; } *************** *** 173,179 **** double oversoldThresholdMAX, double overboughtThresholdMAX, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain) { --- 191,203 ---- double oversoldThresholdMAX, double overboughtThresholdMAX, + double numOfStdDevForSignificantPriceMovements, + double leverage, + bool openOnlyLongPositions, + int maxNumberOfDaysOnTheMarket, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain, ! List<IEntryCondition> entryConditions, ! bool allEntryConditionsHaveToBeSatisfied) { *************** *** 182,187 **** oversoldThreshold, overboughtThreshold, oversoldThresholdMAX, overboughtThresholdMAX, ! historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain ); this.inSampleChooser = inSampleChooser; } --- 206,217 ---- oversoldThreshold, overboughtThreshold, oversoldThresholdMAX, overboughtThresholdMAX, ! numOfStdDevForSignificantPriceMovements, ! leverage, ! openOnlyLongPositions, ! maxNumberOfDaysOnTheMarket, ! historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain, ! entryConditions, ! allEntryConditionsHaveToBeSatisfied); this.inSampleChooser = inSampleChooser; } *************** *** 196,202 **** double oversoldThreshold, double overboughtThreshold, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain) { --- 226,238 ---- double oversoldThreshold, double overboughtThreshold, + double numOfStdDevForSignificantPriceMovements, + double leverage, + bool openOnlyLongPositions, + int maxNumberOfDaysOnTheMarket, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain, ! List<IEntryCondition> entryConditions, ! bool allEntryConditionsHaveToBeSatisfied) { *************** *** 205,210 **** oversoldThreshold, overboughtThreshold, double.MaxValue, double.MaxValue, historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain ); this.inSampleChooser = inSampleChooser; } --- 241,252 ---- oversoldThreshold, overboughtThreshold, double.MaxValue, double.MaxValue, + numOfStdDevForSignificantPriceMovements, + leverage, + openOnlyLongPositions, + maxNumberOfDaysOnTheMarket, historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain, ! entryConditions, ! allEntryConditionsHaveToBeSatisfied ); this.inSampleChooser = inSampleChooser; } *************** *** 221,227 **** double oversoldThresholdMAX, double overboughtThresholdMAX, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain) { --- 263,275 ---- double oversoldThresholdMAX, double overboughtThresholdMAX, + double numOfStdDevForSignificantPriceMovements, + double leverage, + bool openOnlyLongPositions, + int maxNumberOfDaysOnTheMarket, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain, ! List<IEntryCondition> entryConditions, ! bool allEntryConditionsHaveToBeSatisfied) { *************** *** 230,235 **** oversoldThreshold, overboughtThreshold, oversoldThresholdMAX, overboughtThresholdMAX, historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain ); this.chosenPVOPositions = chosenPVOPositions; } --- 278,289 ---- oversoldThreshold, overboughtThreshold, oversoldThresholdMAX, overboughtThresholdMAX, + numOfStdDevForSignificantPriceMovements, + leverage, + openOnlyLongPositions, + maxNumberOfDaysOnTheMarket, historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain, ! entryConditions, ! allEntryConditionsHaveToBeSatisfied ); this.chosenPVOPositions = chosenPVOPositions; } *************** *** 244,250 **** double oversoldThreshold, double overboughtThreshold, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain) { --- 298,310 ---- double oversoldThreshold, double overboughtThreshold, + double numOfStdDevForSignificantPriceMovements, + double leverage, + bool openOnlyLongPositions, + int maxNumberOfDaysOnTheMarket, HistoricalMarketValueProvider historicalQuoteProvider, double maxAcceptableCloseToCloseDrawdown, ! double minimumAcceptableGain, ! List<IEntryCondition> entryConditions, ! bool allEntryConditionsHaveToBeSatisfied) { *************** *** 253,258 **** oversoldThreshold, overboughtThreshold, double.MaxValue , double.MaxValue , historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain ); this.chosenPVOPositions = chosenPVOPositions; } --- 313,324 ---- oversoldThreshold, overboughtThreshold, double.MaxValue , double.MaxValue , + numOfStdDevForSignificantPriceMovements, + leverage, + openOnlyLongPositions, + maxNumberOfDaysOnTheMarket, historicalQuoteProvider , maxAcceptableCloseToCloseDrawdown , ! minimumAcceptableGain, ! entryConditions, ! allEntryConditionsHaveToBeSatisfied ); this.chosenPVOPositions = chosenPVOPositions; } *************** *** 279,325 **** { DateTime beginOfOscillatingPeriod = ! HistoricalEndOfDayTimer.GetMarketOpen( (DateTime)timer.IndexQuotes.Rows[ timer.CurrentDateArrayPosition-this.numDaysForOscillatingPeriod]["quDate"] ); return beginOfOscillatingPeriod; - // return new EndOfDayDateTime( (DateTime)timer.IndexQuotes.Rows[timer.CurrentDateArrayPosition-this.numDaysForOscillatingPeriod]["quDate"], - // EndOfDaySpecificTime.MarketClose ); - } - - private void marketCloseEventHandler_reverseIfNeeded_reverse(PVOPositionsStatus currentStatus) - { - if(currentStatus == PVOPositionsStatus.Overbought) - { - this.portfolioHasBeenOversold = false; - this.portfolioHasBeenOverbought = true; - } - else if(currentStatus == PVOPositionsStatus.Oversold) - { - this.portfolioHasBeenOversold = true; - this.portfolioHasBeenOverbought = false; - } - AccountManager.ReversePositions(this.account); - this.previousAccountValue = this.account.GetMarketValue(); - } - - private void marketCloseEventHandler_reverseIfNeeded(IndexBasedEndOfDayTimer timer) - { - DateTime today = timer.GetCurrentDateTime(); - DateTime beginOfOscillatingPeriod = this.getBeginOfOscillatingPeriod(timer); - PVOPositionsStatus pvoPositionsStatus = - this.pvoPositionsForOutOfSample.GetStatus(beginOfOscillatingPeriod, today , this.benchmark.Ticker, this.historicalQuoteProvider, - double.MaxValue, double.MaxValue); - if(pvoPositionsStatus == PVOPositionsStatus.Overbought && - this.portfolioHasBeenOversold) - //open positions derive from an overSold period but now - //the overbought threshold has been reached - this.marketCloseEventHandler_reverseIfNeeded_reverse(pvoPositionsStatus); - - if(pvoPositionsStatus == PVOPositionsStatus.Oversold && - this.portfolioHasBeenOverbought) - //open positions derive from an overBought period but now - //the overSold threshold has been reached - this.marketCloseEventHandler_reverseIfNeeded_reverse(pvoPositionsStatus); } private PVOPositionsStatus marketCloseEventHandler_openPositions_getStatus(IndexBasedEndOfDayTimer timer) { --- 345,354 ---- { DateTime beginOfOscillatingPeriod = ! HistoricalEndOfDayTimer.GetMarketClose( (DateTime)timer.IndexQuotes.Rows[ timer.CurrentDateArrayPosition-this.numDaysForOscillatingPeriod]["quDate"] ); return beginOfOscillatingPeriod; } + private PVOPositionsStatus marketCloseEventHandler_openPositions_getStatus(IndexBasedEndOfDayTimer timer) { *************** *** 346,365 **** } ! protected void marketCloseEventHandler_openPositions(IndexBasedEndOfDayTimer timer) { PVOPositionsStatus pvoPositionsStatus = PVOPositionsStatus.InTheMiddle; if(timer.CurrentDateArrayPosition >= this.numDaysForOscillatingPeriod) pvoPositionsStatus = this.marketCloseEventHandler_openPositions_getStatus(timer); switch (pvoPositionsStatus){ case PVOPositionsStatus.Overbought: { #region manage Overbought case - this.pvoPositionsForOutOfSample.WeightedPositions.Reverse(); try{ ! AccountManager.OpenPositions( this.pvoPositionsForOutOfSample.WeightedPositions, ! this.account ); ! this.portfolioHasBeenOverbought = true; ! this.portfolioHasBeenOversold = false; this.previousAccountValue = this.account.GetMarketValue(); } --- 375,439 ---- } ! private bool areEntryConditionsSatisfied() ! { ! bool returnValue = true; ! if( this.allEntryConditionsHaveToBeSatisfied ) ! { ! for(int i = 0; i<this.entryConditions.Count; i++) ! if( !this.entryConditions[i].IsConditionSatisfiedByGivenPVOPositions(this.now(), ! this.pvoPositionsForOutOfSample) ) ! { ! returnValue = false; ! i = this.entryConditions.Count;//returnValue == false -> exit ! } ! } ! else // !this.allEntryConditionsHaveToBeSatisfied ! { ! for(int i = 0; i<this.entryConditions.Count; i++) ! if( this.entryConditions[i].IsConditionSatisfiedByGivenPVOPositions(this.now(), ! this.pvoPositionsForOutOfSample) ) ! i = this.entryConditions.Count;//returnValue == true -> exit ! } ! return returnValue; ! } ! ! private WeightedPositions marketCloseEventHandler_openPositionsIfTheCase_getWeightedPositionsToInvest() ! { ! WeightedPositions weightedPositions = ! this.pvoPositionsForOutOfSample.WeightedPositions; ! if(this.openOnlyLongPositions) ! { ! SignedTickers signedTickers = new SignedTickers(); ! foreach(WeightedPosition position in this.pvoPositionsForOutOfSample.WeightedPositions.GetValueList()) ! if(position.IsLong) ! { ! signedTickers.Add(new SignedTicker(position.Ticker)); ! weightedPositions = ! new WeightedPositions(signedTickers); ! } ! } ! return weightedPositions; ! } ! ! ! protected void marketCloseEventHandler_openPositionsIfTheCase(IndexBasedEndOfDayTimer timer) { PVOPositionsStatus pvoPositionsStatus = PVOPositionsStatus.InTheMiddle; if(timer.CurrentDateArrayPosition >= this.numDaysForOscillatingPeriod) + { pvoPositionsStatus = this.marketCloseEventHandler_openPositions_getStatus(timer); + } switch (pvoPositionsStatus){ case PVOPositionsStatus.Overbought: { #region manage Overbought case try{ ! if( this.areEntryConditionsSatisfied() ) ! { ! this.pvoPositionsForOutOfSample.WeightedPositions.Reverse(); ! AccountManager.OpenPositions( marketCloseEventHandler_openPositionsIfTheCase_getWeightedPositionsToInvest(), ! this.account, 10000.0, this.leverage ); ! } this.previousAccountValue = this.account.GetMarketValue(); } *************** *** 378,385 **** { #region manage Oversold case ! AccountManager.OpenPositions( this.pvoPositionsForOutOfSample.WeightedPositions, ! this.account ); ! this.portfolioHasBeenOverbought = false; ! this.portfolioHasBeenOversold = true; this.previousAccountValue = this.account.GetMarketValue(); #endregion --- 452,459 ---- { #region manage Oversold case ! if( this.areEntryConditionsSatisfied() ) ! AccountManager.OpenPositions( marketCloseEventHandler_openPositionsIfTheCase_getWeightedPositionsToInvest(), ! this.account, 10000.0, this.leverage ); ! this.previousAccountValue = this.account.GetMarketValue(); #endregion *************** *** 403,421 **** protected virtual void marketCloseEventHandler_closePositionsIfNeeded() { ! if(this.stopLossConditionReached || ! this.takeProfitConditionReached || ! this.numDaysElapsedSinceLastOptimization + 1 == this.numDaysBetweenEachOptimization ) { AccountManager.ClosePositions(this.account); ! this.portfolioHasBeenOverbought = false; ! this.portfolioHasBeenOversold = false; } } ! protected virtual void marketCloseEventHandler_updateStopLossAndTakeProfitConditions() { //this.previousAccountValue has been set at opening positions this.stopLossConditionReached = false; this.takeProfitConditionReached = false; this.currentAccountValue = this.account.GetMarketValue(); double portfolioGainOrLoss = (this.currentAccountValue - this.previousAccountValue) --- 477,497 ---- protected virtual void marketCloseEventHandler_closePositionsIfNeeded() { ! if( this.stopLossConditionReached || ! this.takeProfitConditionReached || ! this.maxNumberOfDaysOnTheMarketReached ) { AccountManager.ClosePositions(this.account); ! this.currentAccountValue = 0.0; ! this.previousAccountValue = 0.0; ! this.daysOnTheMarket = 0; } } ! protected virtual void marketCloseEventHandler_updateClosingConditions() { //this.previousAccountValue has been set at opening positions this.stopLossConditionReached = false; this.takeProfitConditionReached = false; + this.maxNumberOfDaysOnTheMarketReached = false; this.currentAccountValue = this.account.GetMarketValue(); double portfolioGainOrLoss = (this.currentAccountValue - this.previousAccountValue) *************** *** 435,438 **** --- 511,516 ---- this.takeProfitConditionReached = true; } + if ( this.maxNumberOfDaysOnTheMarket == this.daysOnTheMarket ) + this.maxNumberOfDaysOnTheMarketReached = true; } *************** *** 441,445 **** { try{ ! this.marketCloseEventHandler_updateStopLossAndTakeProfitConditions(); //this.marketCloseEventHandler_closePositionsIfNeeded(); if( this.chosenPVOPositions != null ) --- 519,523 ---- { try{ ! this.marketCloseEventHandler_updateClosingConditions(); //this.marketCloseEventHandler_closePositionsIfNeeded(); if( this.chosenPVOPositions != null ) *************** *** 447,455 **** { if(this.account.Portfolio.Count == 0) ! this.marketCloseEventHandler_openPositions((IndexBasedEndOfDayTimer)sender); //positions are opened only if thresholds are reached else//there are some opened positions this.marketCloseEventHandler_closePositionsIfNeeded(); - //this.marketCloseEventHandler_reverseIfNeeded((IndexBasedEndOfDayTimer)sender); } } --- 525,532 ---- { if(this.account.Portfolio.Count == 0) ! this.marketCloseEventHandler_openPositionsIfTheCase((IndexBasedEndOfDayTimer)sender); //positions are opened only if thresholds are reached else//there are some opened positions this.marketCloseEventHandler_closePositionsIfNeeded(); } } *************** *** 459,463 **** } } - #endregion --- 536,539 ---- *************** *** 573,577 **** this.numDaysElapsedSinceLastOptimization = 0; } ! } #endregion --- 649,654 ---- this.numDaysElapsedSinceLastOptimization = 0; } ! if( this.account.Portfolio.Count > 0 ) ! this.daysOnTheMarket++; } #endregion *************** *** 587,591 **** this.oneHourAfterMarketCloseEventHandler( sender , dateTime ); } - } } --- 664,667 ---- Index: PVOLogItem.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOLogItem.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PVOLogItem.cs 13 Mar 2009 15:11:23 -0000 1.7 --- PVOLogItem.cs 30 Aug 2009 21:43:34 -0000 1.8 *************** *** 22,25 **** --- 22,26 ---- using System; + using System.Collections.Generic; using System.Windows.Forms; *************** *** 33,36 **** --- 34,38 ---- using QuantProject.Business.Strategies.ReturnsManagement.Time; using QuantProject.Business.Strategies.ReturnsManagement.Time.IntervalsSelectors; + using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.EntryConditions; using QuantProject.Business.Timing; using QuantProject.Presentation; *************** *** 185,188 **** --- 187,198 ---- //positionsToTest[0] = this.bestPVOPositionsInSample[0]; positionsToTest = this.BestPVOPositionsInSample; + List<IEntryCondition> entryConditions = new List<IEntryCondition>(); + IEntryCondition entryCondition = + new AlwaysTrueEntryCondition(); + // new PreviousPeriodsWereEfficientEntryCondition(1, historicalQuoteProviderForStrategy, + // numDaysForOscillatingPeriodForOutOfSample * 24 *60, + // new MarketDateTimeManager(benchmark, firstDateTime, lastDateTime, 60) ); + entryConditions.Add(entryCondition); + bool allEntryConditionsHaveToBeTrue = true; PVOStrategy strategy = new PVOStrategy(eligiblesSelector, *************** *** 193,198 **** ((PVOPositions)positionsToTest[0]).OversoldThreshold, ((PVOPositions)positionsToTest[0]).OverboughtThreshold, historicalQuoteProviderForStrategy , ! maxAcceptableCloseToCloseDrawdown , minimumAcceptableGain ); EndOfDayStrategyBackTester endOfDayStrategyBackTester = --- 203,210 ---- ((PVOPositions)positionsToTest[0]).OversoldThreshold, ((PVOPositions)positionsToTest[0]).OverboughtThreshold, + 0.0, 1.0, false, 1, historicalQuoteProviderForStrategy , ! maxAcceptableCloseToCloseDrawdown , minimumAcceptableGain, ! entryConditions, allEntryConditionsHaveToBeTrue); EndOfDayStrategyBackTester endOfDayStrategyBackTester = *************** *** 200,204 **** "PVO" , new QuantProject.Business.Timing.IndexBasedEndOfDayTimer( ! HistoricalEndOfDayTimer.GetMarketOpen( firstDateTime ) , benchmark.Ticker ) , strategy , --- 212,216 ---- "PVO" , new QuantProject.Business.Timing.IndexBasedEndOfDayTimer( ! HistoricalEndOfDayTimer.GetMarketClose( firstDateTime ) , benchmark.Ticker ) , strategy , Index: PVOMain.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOMain.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PVOMain.cs 12 Nov 2008 20:42:39 -0000 1.8 --- PVOMain.cs 30 Aug 2009 21:43:34 -0000 1.9 *************** *** 23,29 **** --- 23,31 ---- using System; using System.Collections; + using System.Collections.Generic; using System.IO; using QuantProject.ADT; + using QuantProject.ADT.Timing; using QuantProject.ADT.FileManaging; using QuantProject.Business.DataProviders; *************** *** 42,50 **** using QuantProject.Presentation; using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.InSampleChoosers; - using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.Decoding; using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.FitnessEvaluators; using QuantProject.Scripts.General; using QuantProject.Scripts.General.Logging; using QuantProject.Scripts.General.Reporting; --- 44,55 ---- using QuantProject.Presentation; using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.InSampleChoosers; using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.FitnessEvaluators; + using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.InSampleChoosers.PriceRatioChooser; + using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.Decoding; + using QuantProject.Scripts.TechnicalAnalysisTesting.Oscillators.FixedLevelOscillators.PortfolioValueOscillator.EntryConditions; using QuantProject.Scripts.General; using QuantProject.Scripts.General.Logging; using QuantProject.Scripts.General.Reporting; + using QuantProject.Business.Timing.TimingManagement; *************** *** 60,88 **** private Benchmark benchmark; private HistoricalMarketValueProvider historicalQuoteProvider; public PVOMain() { ! this.benchmark = new Benchmark( "BMC" ); ! this.historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); ! ! // definition for the Fitness Evaluator ! // IEquityEvaluator equityEvaluator = new SharpeRatio(); } protected override IEligiblesSelector getEligiblesSelector() { ! ! int maxNumberOfEligiblesToBeChosen = 100; ! ! string tickersGroupId = "SP500"; bool temporizedGroup = true; int numDaysForAverageRawOpenPriceComputation = 10; ! double minPrice = 30; ! double maxPrice = 75; ! int maxNumberOfMostLiquidTickersToBeChosen = 150; int numDaysForVolatility = 10; IEligiblesSelector eligiblesSelector = --- 65,103 ---- private Benchmark benchmark; private HistoricalMarketValueProvider historicalQuoteProvider; + + private double maxAcceptableDrawDown; + private double minimumAcceptableGain; + private int closeToCloseIntervalLength; + private int numberOfPortfolioPositions; + private int numberOfBestTestingPositionsToBeReturned; + private IEquityEvaluator equityEvaluator; + private DateTime firstDateTime; + private DateTime lastDateTime; public PVOMain() { ! this.benchmark = new Benchmark( "ENI.MI" ); this.historicalQuoteProvider = new HistoricalAdjustedQuoteProvider(); ! this.maxAcceptableDrawDown = 0.03; ! this.minimumAcceptableGain = 0.01; ! this.closeToCloseIntervalLength = 2; ! this.numberOfPortfolioPositions = 2; ! this.numberOfBestTestingPositionsToBeReturned = 40; ! this.firstDateTime = new DateTime( 2004 , 1 , 1 ); ! this.lastDateTime = new DateTime( 2004 , 6, 30 ); } protected override IEligiblesSelector getEligiblesSelector() { ! int maxNumberOfEligiblesToBeChosen = 50; ! string tickersGroupId = "STOCKMI"; bool temporizedGroup = true; int numDaysForAverageRawOpenPriceComputation = 10; ! double minPrice = 0.1; ! double maxPrice = 1500; ! int maxNumberOfMostLiquidTickersToBeChosen = 100; int numDaysForVolatility = 10; IEligiblesSelector eligiblesSelector = *************** *** 94,112 **** numDaysForVolatility , minPrice , maxPrice ); ! // IEligiblesSelector eligiblesSelector = ! // new ByPriceMostLiquidAlwaysQuoted( ! // tickersGroupId , temporizedGroup , ! // maxNumberOfEligiblesToBeChosen , ! // numDaysForAverageRawOpenPriceComputation , ! // minPrice , maxPrice ); ! // IEligiblesSelector eligiblesSelector = ! // new ByPriceLessVolatileOTCAlwaysQuoted( ! // tickersGroupId , temporizedGroup , ! // maxNumberOfEligiblesToBeChosen , ! // numDaysForAverageRawOpenPriceComputation , ! // minPrice , maxPrice ); ! eligiblesSelector = ! new DummyEligibleSelector(); ! // return eligiblesSelector; } --- 109,116 ---- numDaysForVolatility , minPrice , maxPrice ); ! ! // eligiblesSelector = ! // new DummyEligibleSelector(); ! return eligiblesSelector; } *************** *** 115,145 **** { // parameters for the genetic optimizer ! // double crossoverRate = 0.85; ! // double mutationRate = 0.02; ! // double elitismRate = 0.001; ! // int populationSizeForGeneticOptimizer = 3000; ! // int generationNumberForGeneticOptimizer = 4; ! // int seedForRandomGenerator = ! // QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator; ! ! // IDecoderForTestingPositions decoderForWeightedPositions = ! // new DecoderForPairsTradingTestingPositionsWithBalancedWeights(); ! ! double maxCorrelationAllowed = 0.96; ! int numberOfBestTestingPositionsToBeReturned = 50; ! numberOfBestTestingPositionsToBeReturned = 10; ! bool balancedWeightsOnVolatilityBase = true; ! float minimumAbsoluteReturnValue = 0.000001f; ! float maximumAbsoluteReturnValue = 100000f; ! // int closeToCloseIntervalLengthForCorrelation = 2; //correlation is computed only for returns //between minimum and maximum ! IInSampleChooser inSampleChooser = // new PVO_CTCCorrelationChooser(numberOfBestTestingPositionsToBeReturned, // closeToCloseIntervalLengthForCorrelation , maxCorrelationAllowed , balancedWeightsOnVolatilityBase, // minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker ); ! new PVO_CTCStrongCorrelationChooser(numberOfBestTestingPositionsToBeReturned, ! maxCorrelationAllowed , minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, ! balancedWeightsOnVolatilityBase, this.benchmark.Ticker ); // IInSampleChooser inSampleChooser = // new PVO_OTCCTOCorrelationChooser(numberOfBestTestingPositionsToBeReturned, --- 119,166 ---- { // parameters for the genetic optimizer ! // ! double crossoverRate = 0.85; ! double mutationRate = 0.1; ! double elitismRate = 0.01; ! int populationSizeForGeneticOptimizer = 5000; ! int generationNumberForGeneticOptimizer = 5; ! int seedForRandomGenerator = ! QuantProject.ADT.ConstantsProvider.SeedForRandomGenerator; ! int divisorForThresholdComputation = 1000; ! bool symmetricalThreshold = true; ! bool overboughtMoreThanOversoldThresholdsForStationaryPortfolios = false; ! IDecoderForTestingPositions decoderForWeightedPositions = ! new BasicDecoderForPVOPositions(symmetricalThreshold, divisorForThresholdComputation, ! this.closeToCloseIntervalLength); ! this.equityEvaluator = new SharpeRatio(); ! IFitnessEvaluator pvoFitnessEvaluator = ! new PVOFitnessEvaluator(this.equityEvaluator, this.minimumAcceptableGain, ! this.maxAcceptableDrawDown); ! IInSampleChooser inSampleChooser = ! new PVOGeneticChooser(this.closeToCloseIntervalLength, this.numberOfPortfolioPositions, ! this.numberOfBestTestingPositionsToBeReturned, this.benchmark, ! decoderForWeightedPositions, pvoFitnessEvaluator, ! this.historicalQuoteProvider, crossoverRate, mutationRate, ! elitismRate, populationSizeForGeneticOptimizer, generationNumberForGeneticOptimizer, ! seedForRandomGenerator, 5, 5, 5, 5, divisorForThresholdComputation, ! symmetricalThreshold, overboughtMoreThanOversoldThresholdsForStationaryPortfolios); ! // ! // double maxCorrelationAllowed = 0.96; ! // bool balancedWeightsOnVolatilityBase = true; ! // float minimumAbsoluteReturnValue = 0.000001f; ! // float maximumAbsoluteReturnValue = 100000f; ! // int closeToCloseIntervalLengthForCorrelation = 1; //correlation is computed only for returns //between minimum and maximum ! // IInSampleChooser inSampleChooser = // new PVO_CTCCorrelationChooser(numberOfBestTestingPositionsToBeReturned, // closeToCloseIntervalLengthForCorrelation , maxCorrelationAllowed , balancedWeightsOnVolatilityBase, // minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, this.benchmark.Ticker ); ! ! // new PVOLessVolatilePriceRatioChooser(numberOfBestTestingPositionsToBeReturned, balancedWeightsOnVolatilityBase); ! ! // new PVO_CTCStrongCorrelationChooser(numberOfBestTestingPositionsToBeReturned, ! // maxCorrelationAllowed , minimumAbsoluteReturnValue , maximumAbsoluteReturnValue, ! // balancedWeightsOnVolatilityBase, this.benchmark.Ticker ); // IInSampleChooser inSampleChooser = // new PVO_OTCCTOCorrelationChooser(numberOfBestTestingPositionsToBeReturned, *************** *** 152,159 **** // numberOfBestTestingPositionsToBeReturned); //home ! inSampleChooser = ! new PVOChooserFromSavedBackTestLog( ! @"C:\Utente\MarcoVarie\Vari\qP\LogArchive\2008_06_03_18_33_29_PVO_CTC_from_2001_01_01_to_2004_12_31_annlRtrn_4.72_maxDD_13.57\2008_06_03_18_33_29_PVO_CTC_from_2001_01_01_to_2004_12_31_annlRtrn_4.72_maxDD_13.57.qpL", ! numberOfBestTestingPositionsToBeReturned); return inSampleChooser; } --- 173,180 ---- // numberOfBestTestingPositionsToBeReturned); //home ! // inSampleChooser = ! // new PVOChooserFromSavedBackTestLog( ! // @"C:\Utente\MarcoVarie\Vari\qP\LogArchive\2008_06_03_18_33_29_PVO_CTC_from_2001_01_01_to_2004_12_31_annlRtrn_4.72_maxDD_13.57\2008_06_03_18_33_29_PVO_CTC_from_2001_01_01_to_2004_12_31_annlRtrn_4.72_maxDD_13.57.qpL", ! // numberOfBestTestingPositionsToBeReturned); return inSampleChooser; } *************** *** 164,185 **** // uncomment the following line for a faster script //inSampleDays = 50; ! int numDaysBetweenEachOptimization = 5; ! double oversoldThreshold = 0.002; ! double overboughtThreshold = 0.002; ! double oversoldThresholdMAX = 0.02; ! double overboughtThresholdMAX = 0.02; ! double maxAcceptableDrawDown = 0.01; ! double minimumAcceptableGain = 0.002; ! int closeToCloseIntervalLength = 1; IStrategyForBacktester strategyForBacktester ! // = new PVO_OTCStrategyLessCorrelated(eligiblesSelector ,inSampleChooser , ! // inSampleDays , benchmark , numDaysBetweenEachOptimization , ! // oversoldThreshold , overboughtThreshold , historicalQuoteProvider); ! // = new PVOStrategy(eligiblesSelector , inSampleChooser , ! inSampleDays , closeToCloseIntervalLength , 2 , benchmark , numDaysBetweenEachOptimization , oversoldThreshold , overboughtThreshold , ! oversoldThresholdMAX , overboughtThresholdMAX , historicalQuoteProvider, ! maxAcceptableDrawDown, minimumAcceptableGain ); return strategyForBacktester; } --- 185,232 ---- // uncomment the following line for a faster script //inSampleDays = 50; ! int numDaysBetweenEachOptimization = 10; ! double oversoldThreshold = 0.015; ! double overboughtThreshold = 0.015; ! double oversoldThresholdMAX = 0.1; ! double overboughtThresholdMAX = 0.1; ! double numOfStdDevForSignificantPriceMovements = 1.5; ! double leverage = 1.0; ! bool openOnlyLongPositions = false; ! int maxNumberOfDaysOnTheMarket = 5; ! List<IEntryCondition> entryConditions = new List<IEntryCondition>(); ! IEntryCondition entryCondition = ! // new AlwaysTrueEntryCondition(); ! // new PriceRatioEntryCondition(45, this.historicalQuoteProvider, 1.0); ! new PreviousPeriodsWereEfficientEntryCondition(1, this.historicalQuoteProvider, ! this.closeToCloseIntervalLength, ! new MarketDaysManager(this.benchmark, ! this.firstDateTime, this.lastDateTime, ! new Time("16:00:00"))); ! entryConditions.Add(entryCondition); ! bool allEntryConditionsHaveToBeTrue = true; ! IStrategyForBacktester strategyForBacktester ! //pair trading ! // = new PVOStrategy(eligiblesSelector , inSampleChooser , ! // inSampleDays , closeToCloseIntervalLength , 2 , benchmark , numDaysBetweenEachOptimization , ! // oversoldThreshold , overboughtThreshold , ! // oversoldThresholdMAX , overboughtThresholdMAX , ! // numOfStdDevForSignificantPriceMovements, ! // leverage , openOnlyLongPositions , ! // maxNumberOfDaysOnTheMarket, ! // historicalQuoteProvider, ! // maxAcceptableDrawDown, minimumAcceptableGain ); = new PVOStrategy(eligiblesSelector , inSampleChooser , ! inSampleDays , closeToCloseIntervalLength , ! this.numberOfPortfolioPositions , benchmark , numDaysBetweenEachOptimization , oversoldThreshold , overboughtThreshold , ! oversoldThresholdMAX , overboughtThresholdMAX , ! numOfStdDevForSignificantPriceMovements, ! leverage , openOnlyLongPositions , ! maxNumberOfDaysOnTheMarket, ! historicalQuoteProvider, ! maxAcceptableDrawDown, minimumAcceptableGain, entryConditions, ! allEntryConditionsHaveToBeTrue); ! return strategyForBacktester; } *************** *** 192,200 **** // accountProvider = // new InteractiveBrokerAccountProvider(fixedPercentageSlippage); ! double cashToStart = 25000; ! DateTime firstDateTime = new DateTime( 2001 , 1 , 1 ); ! DateTime lastDateTime = new DateTime( 2004 , 12, 31 ); ! double maxRunningHours = 8; HistoricalMarketValueProvider quoteProviderForBackTester = this.historicalQuoteProvider; --- 239,245 ---- // accountProvider = // new InteractiveBrokerAccountProvider(fixedPercentageSlippage); ! double cashToStart = 10000; ! double maxRunningHours = 10; HistoricalMarketValueProvider quoteProviderForBackTester = this.historicalQuoteProvider; *************** *** 205,209 **** backTestId , new QuantProject.Business.Timing.IndexBasedEndOfDayTimer( ! HistoricalEndOfDayTimer.GetMarketOpen( firstDateTime ) , this.benchmark.Ticker ) , this.strategyForBacktester , --- 250,254 ---- backTestId , new QuantProject.Business.Timing.IndexBasedEndOfDayTimer( ! HistoricalEndOfDayTimer.GetMarketClose( firstDateTime ) , this.benchmark.Ticker ) , this.strategyForBacktester , Index: PVOPositions.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOPositions.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PVOPositions.cs 13 Mar 2009 15:11:23 -0000 1.6 --- PVOPositions.cs 30 Aug 2009 21:43:34 -0000 1.7 *************** *** 45,48 **** --- 45,50 ---- private int numOfDaysOrMinutesForOscillatingPeriod; private int generation; + private DateTime lastInefficiencyDateTime; + private PVOPositionsStatus statusAtLastInefficiencyTime; private static ReturnsManager returnsManager; *************** *** 64,67 **** --- 66,81 ---- } + public DateTime LastInefficiencyDateTime + { + get{return this.lastInefficiencyDateTime;} + set{this.lastInefficiencyDateTime = value;} + } + + public PVOPositionsStatus StatusAtLastInefficiencyTime + { + get{return this.statusAtLastInefficiencyTime;} + set{this.statusAtLastInefficiencyTime = value;} + } + //explicit interface implementation //the property can be used only by a interface *************** *** 98,103 **** --- 112,134 ---- this.numOfDaysOrMinutesForOscillatingPeriod = numDaysForOscillatingPeriod; this.generation = -1; + this.statusAtLastInefficiencyTime = PVOPositionsStatus.InTheMiddle; + this.lastInefficiencyDateTime = new DateTime(1900,1,1,0,0,0); } + public PVOPositions(WeightedPositions weightedPositions, + double oversoldThreshold, + double overboughtThreshold, + int numDaysForOscillatingPeriod, + DateTime lastInefficiencyDateTime) : + base(weightedPositions) + + { + this.oversoldThreshold = oversoldThreshold; + this.overboughtThreshold = overboughtThreshold; + this.numOfDaysOrMinutesForOscillatingPeriod = numDaysForOscillatingPeriod; + this.generation = -1; + this.lastInefficiencyDateTime = lastInefficiencyDateTime; + this.statusAtLastInefficiencyTime = PVOPositionsStatus.InTheMiddle; + } private void setReturnsManager(DateTime beginOfPeriod, DateTime endOfPeriod, *************** *** 165,169 **** this.overboughtThreshold, maxOverboughtThreshold ); } ! public bool AreAllTickersMovingTogetherUpOrDown(DateTime beginOfPeriod, DateTime endOfPeriod, --- 196,209 ---- this.overboughtThreshold, maxOverboughtThreshold ); } ! public PVOPositionsStatus GetStatus(DateTime beginOfPeriod, ! DateTime endOfPeriod, ! string benchmark, ! HistoricalMarketValueProvider quoteProvider) ! { ! return this.GetStatus(beginOfPeriod, endOfPeriod, ! benchmark, quoteProvider, ! this.oversoldThreshold, double.MaxValue, ! this.overboughtThreshold, double.MaxValue ); ! } public bool AreAllTickersMovingTogetherUpOrDown(DateTime beginOfPeriod, DateTime endOfPeriod, Index: PVOStrategyIntraday.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/TechnicalAnalysisTesting/Oscillators/FixedLevelOscillators/PortfolioValueOscillator/PVOStrategyIntraday.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PVOStrategyIntraday.cs 29 Mar 2009 18:31:00 -0000 1.5 --- PVOStrategyIntraday.cs 30 Aug 2009 21:43:34 -0000 1.6 *************** *** 45,48 **** --- 45,49 ---- using QuantProject.Data; using QuantProject.Data.DataProviders; + using QuantProject.Data.DataProviders.Bars.Caching; using QuantProject.Data.Selectors; using QuantProject.Data.DataTables; *************** *** 75,78 **** --- 76,80 ---- protected HistoricalMarketValueProvider historicalMarketValueProviderForOutOfSample; + protected HistoricalAdjustedBarProvider historicalAdjBarProvider; protected double oversoldThreshold; protected double overboughtThreshold; *************** *** 103,106 **** --- 105,110 ---- protected double inefficiencyLengthInMinutes; protected int numberOfPreviousEfficientPeriods; + protected int numberOfDaysForPriceRatioAnalysis; + protected double numberOfStdDeviationForSignificantPriceRatioMovements; protected double maxOpeningLengthInMinutes; protected double minutesFromLastInefficiencyTimeToWaitBeforeOpening; *************** *** 114,117 **** --- 118,122 ---- protected double stopLoss; protected double takeProfit; + protected double leverage; private string description_GetDescriptionForChooser() *************** *** 175,183 **** double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.eligiblesSelector = eligiblesSelector; --- 180,190 ---- double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, + int numberOfDaysForPriceRatioAnalysis, + double numberOfStdDeviationForSignificantPriceRatioMovements, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit, double leverage) { this.eligiblesSelector = eligiblesSelector; *************** *** 191,198 **** this.oversoldThresholdMAX = oversoldThresholdMAX; this.overboughtThresholdMAX = overboughtThresholdMAX; ! this.historicalMarketValueProviderForInSample = historicalMarketValueProviderForInSample; ! this.historicalMarketValueProviderForOutOfSample = historicalMarketValueProviderForOutOfSample; this.inefficiencyLengthInMinutes = inefficiencyLengthInMinutes; this.numberOfPreviousEfficientPeriods = numberOfPreviousEfficientPeriods; this.minutesFromLastInefficiencyTimeToWaitBeforeOpening = minutesFromLastInefficiencyTimeToWaitBeforeOpening; --- 198,210 ---- this.oversoldThresholdMAX = oversoldThresholdMAX; this.overboughtThresholdMAX = overboughtThresholdMAX; ! this.historicalMarketValueProviderForInSample = ! historicalMarketValueProviderForInSample; ! this.historicalMarketValueProviderForOutOfSample = ! historicalMarketValueProviderForOutOfSample; this.inefficiencyLengthInMinutes = inefficiencyLengthInMinutes; this.numberOfPreviousEfficientPeriods = numberOfPreviousEfficientPeriods; + this.numberOfDaysForPriceRatioAnalysis = numberOfDaysForPriceRatioAnalysis; + this.numberOfStdDeviationForSignificantPriceRatioMovements = + numberOfStdDeviationForSignificantPriceRatioMovements; this.minutesFromLastInefficiencyTimeToWaitBeforeOpening = minutesFromLastInefficiencyTimeToWaitBeforeOpening; *************** *** 203,208 **** --- 215,225 ---- this.stopLoss = stopLoss; this.takeProfit = takeProfit; + this.leverage = leverage; this.lastOptimizationDateTime = DateTime.MinValue; + this.historicalAdjBarProvider = + new HistoricalAdjustedBarProvider( new HistoricalBarProvider( new SimpleBarCache(60) ), + new HistoricalRawQuoteProvider(), + new HistoricalAdjustedQuoteProvider() ); this.pvoStrategyIntraday_checkTimeParameters(); this.lastEntryTime = new Time("00:00:00"); *************** *** 225,233 **** double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { --- 242,253 ---- double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, + int numberOfDaysForPriceRatioAnalysis, + double numberOfStdDeviationForSignificantPriceRatioMovements, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit, ! double leverage) { *************** *** 240,248 **** inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit); this.inSampleChooser = inSampleChooser; } --- 260,270 ---- inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, + numberOfDaysForPriceRatioAnalysis, + numberOfStdDeviationForSignificantPriceRatioMovements, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit, leverage); this.inSampleChooser = inSampleChooser; } *************** *** 260,268 **** double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { --- 282,292 ---- double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, + int numberOfDaysForPriceRatioAnalysis, + double numberOfStdDeviationForSignificantPriceRatioMovements, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit, double leverage) { *************** *** 275,283 **** inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit); this.inSampleChooser = inSampleChooser; } --- 299,309 ---- inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, + numberOfDaysForPriceRatioAnalysis, + numberOfStdDeviationForSignificantPriceRatioMovements, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit, leverage); this.inSampleChooser = inSampleChooser; } *************** *** 296,304 **** double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { --- 322,332 ---- double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, + int numberOfDaysForPriceRatioAnalysis, + double numberOfStdDeviationForSignificantPriceRatioMovements, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit, double leverage) { *************** *** 311,319 **** inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit); this.chosenPVOPositions = chosenPVOPositions; } --- 339,349 ---- inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, + numberOfDaysForPriceRatioAnalysis, + numberOfStdDeviationForSignificantPriceRatioMovements, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit, leverage); this.chosenPVOPositions = chosenPVOPositions; } *************** *** 330,338 **** double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, --- 360,370 ---- double inefficiencyLengthInMinutes, int numberOfPreviousEfficientPeriods, + int numberOfDaysForPriceRatioAnalysis, + double numberOfStdDeviationForSignificantPriceRatioMovements, double minutesFromLastInefficiencyTimeToWaitBeforeOpening, double minutesFromLastLossOrProfitToWaitBeforeClosing, double maxOpeningLengthInMinutes, List<Time> openingTimesForAvailableBars, ! double stopLoss, double takeProfit, double leverage) { this.pvoStrategyIntraday(eligiblesSelector, minimumNumberOfEligiblesForValidOptimization, *************** *** 344,352 **** inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, minutesFromLastInefficiencyTimeToWaitBeforeOpening, minutesFromLastLossOrProfitToWaitBeforeClosing, maxOpeningLengthInMinutes, openingTimesForAvailableBars, ! stopLoss, takeProfit); this.chosenPVOPositions = chosenPVOPositions; } --- 376,386 ---- inefficiencyLengthInMinutes, numberOfPreviousEfficientPeriods, + numberOfDaysForPriceRatioAnalysis, + numberOfStdDeviationForSignificantPriceRatioMovements, minut... [truncated message content] |