Express Generator - Wish List

> Filter out results that are below Return / DD of 2 at 95% Confidence level.

Is it different than:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Monte Carlo                      ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

enable_monte_carlo            = true
count_of_tests                =  20
valid_tests_percent           =  95
mc_min_return_to_drawdown     =   2

Express Generator - Wish List

Hi Popov, I would like the ability to add the following requirement in the Monte Carlo Validation:

Filter out results that are below Return / DD of 2 at 95% Confidence level.

90% of trades opening at 0:00

Great to hear it helped. Yes, that will obviously not work on D1 as all the logic is only always checked on bar open.

90% of trades opening at 0:00

Thanks Geektrader. I've adjusted the session times to skip trading in the first hour "01:00 - 23:59", which works great for 1H and 4H timeframes. However, I can't seem to get it working on D1 timeframes. Seems like the logic is only checked at the opening of the bar. So if trading is disabled for the first hour, D1 EAs never trade.

Where does the Express Generator start for each run?

> If it starts from the beginning each time, is there a way to tell where it stopped so that I can put in that date and start from there?

Express Generator generates new collections every time you run it by default.

We can also use it to validate previously generated collections. We do it by setting the --input parameter.

 node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 --input my-generated-collection.json

(Provided that we have a collection named "my-generated-collection.json" )

The principle is the same — Express Generator will use the complete data set for the calculation, with the limitation we provide, as I mentioned in my previous post.

Forward Testing

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Forward testing          ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Validate strategies on new unseen data.

use_forward_testing = false
preload_data_bars   = 0

We can set the Generator to calculate Backtest statistics only on the new data with these parameters.
It will work only if the loaded collection was tested with an Out-of-sample or with data limited by other means.

Let's have a collection generated on data ending on 31st December 2024. We can set the backtest calculating only on the new data (since January 1st 2025).

PS C:\express-generator> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 `
>> --input my-generated-collection.json --use-forward-testing true --preload-data-bars 1000

The --preload-data-bars 1000 sets the Generator to load 1000 bars more. The trades will still start from the time the calculation was calculated.

Let's recap:

The Generator will use the complete data set when you validate an already generated collection.

You can set it to calculate on the new (unseen or Out-of-sample) data in two ways:

1) Limit the data start:

PS C:\express-generator> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 `
>> --input my-generated-collection.json `
>> --use-data-start true --data-start "2025-01-01 00:00 UTC"

https://image-holder.forexsb.com/store/ex-gen-data-start-back-tick-1.png

2) Forward testing

PS C:\express-generator> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 `
>> --input my-generated-collection.json --use-forward-testing true --preload-data-bars 1000

The Generator will load data 1000 bars earlier than the time the original strategy was generated and will perform trading only on thenew data.

Where does the Express Generator start for each run?

Express Generator calculates the backtest on all of the provided data by default.

We have several means to control the data set.

1) Limit the count of the data bars:

We can do it when fetching the data or when running the Generator.

> node .\bin\fetch.js --server Eightcap --symbol EURUSD --period M30 --max-data-bars 100000

         ..:: Express Generator Fetch v2.65 ::..

Fetched: Eightcap EURUSD M30, From: 2017-03-08 00:00, To: 2025-03-21 22:30, Bars: 100000


> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30

We see that the Generator uses the complete data set.

https://image-holder.forexsb.com/store/ex-gen-run-eightcap-100000-bars.png


We obtained the same result by downloading the complete data set and limiting the data bars when running the generator.


> node .\bin\fetch.js --server Eightcap --symbol EURUSD --period M30

         ..:: Express Generator Fetch v2.65 ::..

Fetched: Eightcap EURUSD M30, From: 2009-02-04 17:00, To: 2025-03-21 22:30, Bars: 200000

Data fetch ready!

> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 --max-data-bars 100000

2) Limit the data's start and end dates.

We have four parameters to control the start and end dates of the data set. The

use_data_start  = false
data_start      = "01 Jan 2020 00:00 UTC"

use_data_end    = false
data_end        = "30 Jun 2023 00:00 UTC"

We enable the corresponding limitation and set the desired date and time.

Usually, we limit the "data end" and use the count of bars limitation.

https://image-holder.forexsb.com/store/ex-gen-data-end-max-bars-back-tick.png

( I'm using "backtick `"  and shift+enter to make a new line)

We see that the Generator loads 100,000 bars ending at 2024-12-31 23:00.


We can also make it by setting the count of days for the data end. This is useful because we can have it in a settings file, which will work with the time.

PS C:\express-generator> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 `
>> --use-data-end true --data-end -90 --max-data-bars 100000

--use-data-end true --data-end -90 - it sets the Generator to load data up to 90 days back from the current time.


3) Out of sample

We have a convenient way to cut part of the data.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Out of sample            ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Use these parameters to set the data range.
; The program cuts data after applying Data Horizon.

data_start_percent = 0
data_end_percent   = 100

The out-of-sample parameters are applied after the data-sart, data-end, and max-bars limitations.

Here is how to have the oldest 80% of the data

PS C:\express-generator> node .\bin\gen.js --server Eightcap --symbol EURUSD --period M30 `
>> --data-start-percent 0 --data-end-percent 80

                        ..:: Express Generator v2.65 ::..


    Market : Eightcap EURUSD M30
    From   : 2017-03-08 00:00, To: 2023-08-11 06:30, Bars: 80000
    Spread : 20, Swap long: -7.44, Swap short: 2.9, Commission: 6 USD
    Account: 10000 USD, Leverage: 100, Entry: 0.01 lots

Where does the Express Generator start for each run?

Ele comeca sempre do início a única hora que ele randomiza e quando monte Carlo é ligado

Expert Advisor Studio - Wish list

A thousand pardons indeed you are totally right now I see the scenario that I had not understood before maybe this discrepancy would decrease because I always trade in h1 and h2 and the reports I do in ohlc of one minute so really the discrepancy is minimal for my use.. Now in your case your logic is right

Export bulk report csv with asset+timeframe+magic number Needed

This function to export reports csv with their respective strategy as file names would be good to include to analyze the entire collection in other applications.

Expert Advisor Studio - Wish list

gabdecsters wrote:

This is already possible the reason why you want to add this

In other words, everything you described already happens

It is not necessary to add this for these purposes because the ea already behaves like this

Perhaps for another reason it is interesting

Good evening,
thanks for your feedback, but I'got different results many times when backtesting in Open Price Only, vs Tick Mode or Real Tick.

As said, "when the SL and TP are very very strict" in Real Ticks or in LIve Trading, the EA does not wait for the next candle to close the position, if the SL or TP is reached!

If SL or TP is reached before the next candle opening, the trade is closed. I want to avoid this, so that I can know that Open Price backtesting is accurate 100%, no matter what.

Open Price only is the fastest way to backtest, but currently on MT5, results are not always the same while changing backtesting mode.

I just found the "EXIT TIME" on EaStudio for closing condition following this need, but I don't find it suitable for this.

Which setting/condition are you referring to when you say that my request is already possible? I haven't found it.

Thanks