[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Difference betwee OOS and IS



PureBytes Links

Trading Reference Links

Hi Louis --

If the system you are working with is actually the crossover of two simple moving averages, the results you get will probably not be very good.  I often suggest a simple system when I am trying to make a point that requires a system and I do not want the definition of the system to confuse the other point.  You will need a system that is more sophisticated to show good results.  Try the CMO Oscillator in the code posted below.

// CCT CMO Oscillator.afl
//
//    A CMO Oscillator
//
//

//    Two variables are set up for optimizing
CMOPeriods=Optimize("pds",61,1,101,5);
AMAAvg=Optimize("AMAAvg",36,1,101,5);

//    The change in the closing price is summed
//    into two variables -- up days and down days
SumUp = Sum(IIf(C>Ref(C,-1),(C-Ref(C,-1)),0),CMOPeriods);
SumDown = Sum(IIf(C<Ref(C,-1),(Ref(C,-1)-C),0),CMOPeriods);

//    The CMO Oscillator calculation
CMO = 100 * (SumUp - SumDown) / (SumUp + SumDown);

//Plot(CMO,"CMO",colorGreen,styleLine);

//    Smooth the CMO Oscillator
CMOAvg = DEMA(CMO,AMAAvg);
//    And smooth it again to form a trigger line
Trigger = DEMA(CMOAvg,3);
//    Buy when the smoothed oscillator crosses
//    up through the trigger line
Buy = Cross(CMOAvg,Trigger);
//    Sell on a downward cross, or 6 days,
//    whichever comes first
Sell = Cross(Trigger,CMOAvg) OR BarsSince(Buy)>=6;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

Plot(C,"C",colorBlack,styleCandle);

PlotShapes(Buy*shapeUpArrow+Sell*shapeDownArrow,
    IIf(Buy,colorGreen,colorRed));
Plot (CMOAvg,"CMOAvg",colorGreen,
    style=styleLine|styleOwnScale|styleThick,-100,100);
//Figure 20.2 CMO Oscillator

Now -- back to the issue of validating a trading system --

Tomorrow is out-of-sample.  You want to increase your confidence that your trading system will be profitable when you trade it tomorrow.  In order to do this, observe what happens after you have optimized a system over an in-sample period, then tested it on the immediately following out-of-sample data.  The automated walk forward process helps you do this.  Every step gives one more observation of the in-sample to out-of-sample transition.  If the cumulative out-of-sample results are satisfactory to you, then you have increased confidence that your real trades are likely to be profitable.  No guarantees.  The best we can hope for is a high level of confidence. 

At this point, do not worry about Monte Carlo. 

Just concentrate on:

1.  Select the objective function that You feel most comfortable with.
2.  Design and test the systems of interest to You.
3.  Experiment to find the length of the in-sample period.
4.  Perform the automated walk forward analysis.
5.  Examine the out-of-sample results.
6.  Decide whether or not to trade your system.

Thanks for listening,
Howard
www.quantitativetradingsystems.com


On Tue, Apr 15, 2008 at 7:03 PM, Louis Préfontaine <rockprog80@xxxxxxxxx> wrote:

Hi,

I've been experimenting with walking-forward, and I have some questions regarding how it works.

I ran a complete random optimization or buying/selling using the variables I set (a MCS in fact), and systematically OOS results were worst than IS.  I don't understand how it works, because whatever if the sampling is IS or OOS it is always the same variables that are in place.

Anyone could explain how this work?

Thanks,

Louis


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___