Topic: Generate In Sample and validate OOS

I'm using three separate commands in this CMD file.
I'll show them separately.


1. Update the historical data

We update the data first - 20000 bars EURUSD M30

TITLE OOS Workflow - EURUSD M30

REM Fetch EURUSD M30

node .\bin\fetch.js ^
  --fx-rates      true   ^
  --symbol        EURUSD ^
  --period        M30    ^
  --max-data-bars 20000

2. Generate strategy on the first 75% of the data. ( In Sample )

Here we set "gen" to load 20000 bars of EURUSD M30 and to use from 0% to 75%
  --data-start-percent      0
  --data-end-percent        75

I'm collecting the first 300 strategies. This is different from the usual practice of running the Generator for some time and getting the collection.
  --collection-capacity     300
  --max-ascended-strategies 300

I set the Express Generator to update the best strategy on the screen (default behaviour) and not show the top strategies after the generator finishes.
  --update-best             true
  --show-top                0

I set the generator to export the collection to "Coll-In-Sample-EURUSD-M30" file.
Here  "--output-replace true" sets the generator to overwrite a previous file with the same name. This is important because I'' load the file for validation in the next section.

node .\bin\gen.js ^
  --symbol                  EURUSD ^
  --period                  M30    ^
  --max-data-bars           20000  ^
  --data-start-percent      0      ^
  --data-end-percent        75     ^
  --collection-capacity     300    ^
  --max-ascended-strategies 300    ^
  --update-best             true   ^
  --show-top                0      ^
  --output-replace          true   ^
  --output                  Coll-In-Sample-EURUSD-M30

3. Validate strategies on 25% OOS and get top 10

Here I set the Generator to load 20000 bars of EURUSD M30 but only use the latest 25%.
  --max-data-bars           20000
  --data-start-percent      75 
  --data-end-percent        100

I collect only the top 10 by setting the collection capacity to 10 strategies
  --collection-capacity     10

I want strategies with min 10 trades (100 by default)
--min-count-of-trades     10


I don't want to see the best one updated but want to see all the top 10 printed
--update-best             false
  --show-top                10   

I set the generator to work in validation mode by providing "--input" parameter
  --input                   Coll-In-Sample-EURUSD-M3
The program loads the previously generated IN sample collection

node .\bin\gen.js ^
  --symbol                  EURUSD ^
  --period                  M30    ^
  --max-data-bars           20000  ^
  --data-start-percent      75     ^
  --data-end-percent        100    ^
  --collection-capacity     10     ^
  --min-count-of-trades     10     ^
  --update-best             false  ^
  --show-top                10     ^
  --input                   Coll-In-Sample-EURUSD-M30 ^
  --output                  Coll-OOS-EURUSD-M30

https://image-holder.forexsb.com/store/oos-eurusd-m30-express-generator-thumb.png


This is an example of how we can use several actions to compose a workflow. I'm using the default Acceptance Criteria, but you may modify the code.

Post's attachments

OOS-EURUSD-M30.cmd 1.3 kb, 24 downloads since 2022-10-28 

You don't have the permssions to download the attachments of this post.

Re: Generate In Sample and validate OOS

Is it possible to import an entire folder of strategies?

For example, I'm generating EURUSD on 24 different cmd instances.
They then export 24 different collections.

Currently, I'm using the validator in EA studio to sort through the top strategies in the 24 collections.

I want to be able to do this in the express-generator because it's so much faster.

Re: Generate In Sample and validate OOS

Yes Matthew just put the folder path in the import command rather than the file path

Re: Generate In Sample and validate OOS

Thanks so much! This is going to be so helpful!