1 (edited by lisaforex 2023-05-29 05:59:25)

Topic: simulating DEMO trading

Hi, my process is currently:
- use 2 years of data to generate strategies
- simulate DEMO trading
- move to LIVE trading.

So I am at "simulate DEMO step". I already have a bunch of strategies. I am trying to simulate DEMO trading for the past week of data.

step5a_a_template.cmd

set symbol=%1
set period=%2
set startd=%3
set endd=%4
set filen=%5

if "%symbol%" == "" EXIT
if "%period%" == "" EXIT

node .\bin\gen.js ^
 --server                 GoMarkets ^
 --symbol                  %symbol% ^
 --period                 %period% ^
 --max-data-bars          200000 ^
 --use_data_start         true ^
 --data_start             %startd% ^
 --use_data_end           true ^
 --data_end               %endd% ^
 --entry_lots             0.1 ^
 --min_count_of_trades    3 ^
 --min_profit             1 ^
 --account_currency       AUD ^
 --initial_account        1000 ^
 --leverage               100 ^
 --collection-capacity    10 ^
 --trade_on_sunday        false ^
 --input                  %filen% ^
 --output                 %filen%_demo ^
 --output_replace         true
 

step5a_demo.cmd

start step5a_a_template AUDJPY H1 "22 May 2023 00:00 GMT" "27 May 2023 00:00 GMT" Coll_GoMarkets_Real_1_AUDJPY_H1_2023-05-20

However, as you can see from the output, it is picking up 300 bars of data from 2023-05-10 till 2023-05-27. I only want the past week of data (2023-05-22 till 2023-05-27). I can't see any bugs in my code. Hoping someone can point out my issue?

                        ..:: Express Generator v2.28 ::..

Validating strategies: 200

    Market : GoMarkets-Real 1 AUDJPY H1
    From   : 2023-05-10 12:00, To: 2023-05-27 00:00, Bars: 300
    Spread : 10, Swap long: 9.1, Swap short: -11.3, Commission: 6 AUD
    Account: 1000 AUD, Leverage: 100, Entry: 0.1 lots

     1383 ┤                                      ╭     Net profit      383.36 AUD
     1349 ┤                                      │     Profit per day  26.59  AUD
     1314 ┤                             ╭────────╯     Profit factor   383.36
     1279 ┤                            ╭╯              Max drawdown    96.30  AUD
     1244 ┤                            │               Max drawdown    7.36   %
     1209 ┤                   ╭────────╯               Return/drawdown 3.98
     1174 ┤                   │                        Win / loss      1.00
     1139 ┤                  ╭╯                        Max stagnation  5      days
     1105 ┤   ╭──────────────╯                         Max stagnation  31.79  %
     1070 ┤  ╭╯                                        R - squared     75.72
     1035 ┤  │                                         Max cons losses 0
     1000 ┼──╯                                         Count of trades 4

  - Ascended: 105, Calculated: 200 of 200, Time: 00:00 of 03:00, Coll: 10

Validator Ready!

Collection exported: collections\Coll_GoMarkets_Real_1_AUDJPY_H1_2023-05-20_demo.json

Re: simulating DEMO trading

> However, as you can see from the output, it picks up 300 bars of data from 2023-05-10 till 2023-05-27. I only want the past week of data (2023-05-22 till 2023-05-27).

There is a hardcoded minimum data length of 300 bars. Whenever the program sees less than 300 bars, it tries to expand the given range until it accomplishes 300 bars.

This is an example scheme of the Data Horizon. (the 200000 bars limit is not valid for Express Generator)

https://forexsb.com/wiki/_media/eas-guide/eas-data-horizon.png

Re: simulating DEMO trading

Thanks for the clarification. Looks like EA Studio also has the 300 minimum limit. Hmm. No worries. I will find a work around.

Re: simulating DEMO trading

I'm thinking of a possible workaround: introducing a date for starting the actual trading.

This idea comes from the recent MetaTrader versions. When we set a "start date" in the Meta Trader tester, it loads data for about a month before the specified date and uses that date for the start of the trading.
The earlier versions of MetaTrader loaded data from the given date and stated the trade 100 bars later.

If I introduce two new parameters, "--use-trade-start" and "--trade-start", we can control the data series length and easily set after what date the backtester will open the first trade.

This will also improve the precision of Exponential Moving Averages because they will have more warmup bars.

Re: simulating DEMO trading

Yes, that would be fantastic. I would really love to have the ability to simulate DEMO and REAL trading with shorter time periods like a week. More loading of data bars for calculation of MAs wouldn't get in the way of testing.

smile

Re: simulating DEMO trading

Thanks so much for including this in your latest update Express Generator v2.36 Popov!

Re: simulating DEMO trading

lisaforex wrote:

Thanks so much for including this in your latest update Express Generator v2.36 Popov!

Yes, these new updates for collections, symbol and timeframe variables, and flexible start and end for number of days instead of specific dates has really made scripting easier!