LotSize Calculation Percentage of Balance

Popov wrote:

Side note!

I'll add a Risk calculation functionality to the "Top 10 Robots App".
It will be ready next week.

If it works fine, I may add such options to EA Studio.

It works as follows:
  - The strategy needs Stop Loss (if not, we may assume 100 pips loss)
  - Select Rsik percent (let's say 1% of the account)
  - The program will calculate the proper Entry Lots depending on the Initial Account, the Stop Loss pips the spread and the commission.

Here is an example from the Prop Firm app (it also show the Stop Loss in dollars)

https://image-holder.forexsb.com/store/prop-app-risk-to-lot-size-thumb.png


Hello Popov, what's new about this?

MACD does not really close when Crossing the zero line downward ?

Thank you for the report!

I'll examine the case and will post a comment.

MACD does not really close when Crossing the zero line downward ?

Dear Popov and Staff,
the EA has the following conditions:

Open Long when Macd Line crosses the zero line upward
Close Long when Macd Line crosses the zero line downward

but it has not closed, I had to close the position manually:

https://i.postimg.cc/wMnBBTw7/image.png

PLease find EA studio EA attached.

Thanks

Express Generator - News and Updates

Hello Traders,

We have now: Express Generator v2.71

This release comes with internal code cleanup and refactoring.

The visible changes are:
- rearranged and grouped the parameters in mm. settings.ini to be more meaningful and easier to grasp.
- fixed and improved comments in the settings files.
- updated the forex rates and the symbol info files included in the distribution.

Have a great trading week!

Express Generator - News and Updates

Hello Traders,

New release: Express Generator v2.70

It comes with a new Multi-Market tool.
The script is named mm.js with a default settings file mm.settings.ini.

Example use:

express-generator> node .\bin\mm.js                  ^
    --server Premium                                 ^
    --symbol EURUSD                                  ^
    --period M15                                     ^
    --max-data-bars 100000                           ^
    --input Coll_[SERVER]_[SYMBOL]_[PERIOD].json     ^
    --test-servers Premium                           ^
    --test-periods M15                               ^
    --test-symbols auto                              ^
    --count-of-tests 8                               ^
    --min-passed-tests 5                             ^
    --output Coll_[SERVER]_[SYMBOL]_[PERIOD]_MM.json

https://image-holder.forexsb.com/store/exgen-mm-export-collection_mm-thumb.png

I'll make a documentation and a video next week.
Please see this forum's thread for the ideas and the development steps: https://forexsb.com/forum/topic/10045/m … generator/

Please report any issues you discover.

Swaps Do Change

Hello Traders,

I was curious whether swaps change frequently and whether I need to use "real swaps" in my newest and greatest backtester.

I made a simple script to collect swaps from MetaTrader 5 for each day. It stores the swaps in a local database for later use.

I checked it today and noticed the swaps had already changed twice over the last two weeks.

https://image-holder.forexsb.com/store/mt-editor-db-swaps-2026-02-21-thumb.png

I'll try to find historical information for the swaps and will use it in my next program.

Trade Safe!

Multi-Market validator in Express Generator

--test-symbols auto

The "auto" option is useful when we use the Multi-Market validator in an automated workflow with input strategies with various symbols.

We can use --test-symbols auto only when the main symbol of the input collection is a valid Forex symbol.

The program selects the test-symbols in the following order:
- symbols with the same quoted (underlying) currency "USD" for EURUSD
- symbols with the same base currency "EUR" for EURUSD
- symbols with quoted currency equal to the base currency of the main symbol
- symbols with base currency equal to the quoted currency of the main symbol
- some of the rest symbols

The symbols are selected from the list of symbols provided by the server.

The count of the symbols is determined by the count of the combinations of test-servers and test-periods, and the required count-of-tests.

Multi-Market validator in Express Generator

The Multi-Market tool can automatically set testing symbols and export a collection of the strategies that passed.

Here is a demo command:

express-generator> node .\bin\mm.js                  ^
    --server Premium                                 ^
    --symbol EURUSD                                  ^
    --period M15                                     ^
    --max-data-bars 100000                           ^
    --input Coll_[SERVER]_[SYMBOL]_[PERIOD].json     ^
    --test-servers Premium                           ^
    --test-periods M15                               ^
    --test-symbols auto                              ^
    --count-of-tests 8                               ^
    --output Coll_[SERVER]_[SYMBOL]_[PERIOD]_MM.json ^
    --min-passed-tests 5   

With the following parameters "--symbol EURUSD", "--test-symbols auto", and "--count-of-tests 8", Multi-Market will set 8 symbols automatically.

         ..:: Express Generator Multi Market v2.69 ::..

Fetched: Premium Data EURUSD M15, From: 2022-02-14 14:15, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data GBPUSD M15, From: 2022-02-14 02:30, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data AUDUSD M15, From: 2022-02-14 12:30, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data NZDUSD M15, From: 2022-02-11 20:45, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data EURGBP M15, From: 2022-02-14 13:30, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data EURAUD M15, From: 2022-02-13 23:15, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data EURCHF M15, From: 2022-02-13 23:15, To: 2026-02-18 06:00, Bars: 100000
Fetched: Premium Data EURJPY M15, From: 2022-02-14 06:45, To: 2026-02-18 06:00, Bars: 100000

Multi-Market fetch ready!

When completed, it will export a collection of strategies that pass at least 5 of 8 tests.

https://image-holder.forexsb.com/store/exgen-mm-export-collection_mm-thumb.png

Multi-Market validator in Express Generator

The Multi-Market shows some signs of life.

Here, I generate 100 strategies.

Generator command:

express-generator> node ./bin/gen.js `
    --server Premium `
    --symbol EURUSD `
    --period M15    `
    --output Coll_[SERVER]_[SYMBOL]_[PERIOD].json

Generator output:

                        ..:: Express Generator v2.69 ::..

    Market : Premium Data EURUSD M15
    From   : 2022-02-11 20:15, To: 2026-02-17 12:00, Bars: 100000
    Spread : 10, Swap long: -21.08, Swap short: 13.08, Commission: 6 USD
    Account: 10000 USD, Leverage: 100, Entry: 0.01 lots

    10358 ┤                         ╭╮    ╭────╮╭─     Net profit      353.77 USD
    10328 ┤                        ╭╯╰─╮╭─╯    ╰╯      Profit per day  0.24   USD
    10298 ┤                     ╭──╯   ╰╯              Profit factor   1.34   
    10269 ┤          ╭──╮  ╭────╯                      Max drawdown    77.19  USD
    10239 ┤         ╭╯  ╰──╯                           Max drawdown    0.75   %
    10209 ┤        ╭╯                                  Return/drawdown 4.58   
    10179 ┤       ╭╯                                   Win / loss      0.70   
    10149 ┤     ╭─╯                                    Max stagnation  414    days
    10119 ┤    ╭╯                                      Max stagnation  28.29  %
    10090 ┤   ╭╯                                       R - squared     64.48  
    10060 ┤  ╭╯                                        Max cons losses 4      
    10030 ┤╭─╯                                         Count of trades 509    
    10000 ┼╯                                           Avrg pos length 171    bars

  - Ascended: 343, Calculated: 17606, Time: 03:00 of 03:00, Coll: 100 

Collection exported: collections/Coll_Premium_Data_EURUSD_M15.json

Then I run the new Multi-Market tool. The count of tests is determined by the combinations of servers, symbols, and periods. (18 in this example).

express-generator> node ./bin/mm.js                   `
    --server Premium --symbol EURUSD --period M15 `
    --input Coll_[SERVER]_[SYMBOL]_[PERIOD].json  `
    --count-of-tests 20                           `
    --test-servers MetaQuotes Premium             `
    --test-periods M5 M15 M30                     `
    --test-symbols EURUSD GBPUSD AUDUSD

It fetches historical data:

         ..:: Express Generator Multi Market v2.69 ::..

Fetched: MetaQuotes AUDUSD M5,  From: 2024-10-11 01:25, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes EURUSD M5,  From: 2024-10-10 22:45, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes GBPUSD M5,  From: 2024-10-11 01:35, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes AUDUSD M15, From: 2022-02-08 04:45, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes EURUSD M15, From: 2022-02-08 04:00, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes GBPUSD M15, From: 2022-02-08 05:15, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes AUDUSD M30, From: 2018-01-30 08:30, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes EURUSD M30, From: 2018-01-30 07:00, To: 2026-02-17 12:30, Bars: 100000
Fetched: MetaQuotes GBPUSD M30, From: 2018-01-30 09:00, To: 2026-02-17 12:30, Bars: 100000
Fetched: Premium Data AUDUSD M5,  From: 2024-10-14 17:30, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data EURUSD M5,  From: 2024-10-14 20:25, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data GBPUSD M5,  From: 2024-10-14 09:30, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data AUDUSD M15, From: 2022-02-11 18:30, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data EURUSD M15, From: 2022-02-11 20:15, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data GBPUSD M15, From: 2022-02-11 08:30, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data AUDUSD M30, From: 2018-02-08 07:00, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data EURUSD M30, From: 2018-02-08 10:30, To: 2026-02-17 12:00, Bars: 100000
Fetched: Premium Data GBPUSD M30, From: 2018-02-07 21:00, To: 2026-02-17 12:00, Bars: 100000

Then it calculates the input collection against each market. It shows progress and stats for each calculations.

...
Market : Premium Data GBPUSD M5
From   : 2024-10-14 09:30, To: 2026-02-17 12:00, Bars: 100000
Spread : 10, Swap long: -9.96, Swap short: -0.28, Commission: 6 USD
Account: 10000 USD, Leverage: 100, Entry: 0.01 lots

 - Passed: 7, Calculated: 100 of 100 

Market : Premium Data AUDUSD M15
From   : 2022-02-11 18:30, To: 2026-02-17 12:00, Bars: 100000
Spread : 10, Swap long: -11.18, Swap short: 2.52, Commission: 6 USD
Account: 10000 USD, Leverage: 100, Entry: 0.01 lots

 - Passed: 14, Calculated: 100 of 100 

Market : Premium Data EURUSD M15
From   : 2022-02-11 20:15, To: 2026-02-17 12:00, Bars: 100000
Spread : 10, Swap long: -21.08, Swap short: 13.08, Commission: 6 USD
Account: 10000 USD, Leverage: 100, Entry: 0.01 lots

 - Passed: 100, Calculated: 100 of 100 

Market : Premium Data GBPUSD M15
From   : 2022-02-11 08:30, To: 2026-02-17 12:00, Bars: 100000
Spread : 10, Swap long: -9.96, Swap short: -0.28, Commission: 6 USD
Account: 10000 USD, Leverage: 100, Entry: 0.01 lots

 - Passed: 19, Calculated: 100 of 100 
...

The Multi-Market application shows stats when it finishes.

Multi-Market validator ready!
  9 of 100 strategies passed  1 of 18 tests
 23 of 100 strategies passed  2 of 18 tests
 20 of 100 strategies passed  3 of 18 tests
 12 of 100 strategies passed  4 of 18 tests
 16 of 100 strategies passed  5 of 18 tests
  6 of 100 strategies passed  6 of 18 tests
  6 of 100 strategies passed  7 of 18 tests
  3 of 100 strategies passed  8 of 18 tests
  4 of 100 strategies passed 10 of 18 tests
  1 of 100 strategies passed 12 of 18 tests

ToDo:
- make it possible to select the test symbols automatically
- make it export the output collection
- inspect the code for issues and best practices
- test for proper work on my workflow
- prepare a release version and publish

Multi-Market validator in Express Generator

Thee new tool can fetch data and load collections

https://image-holder.forexsb.com/store/ex-gen-multi-market-loading-data-and-collection-thumb.png

It loads an input collection in a similar way as "./bin/node.js".

The parameters ""--server",  "--symbol", "--period", and "--input" serve to determine the input collection. I'm using template variables in the example, but it can be a simple collection file path.

It shows loaded 28 strategies here. I'll make it showing the collection name also.

The Multi-Market markets are set as a combination of "--test-servers", "--test-periods", and "--test-symbols". The program will load a combination of them (Cartesian product ) until it reaches the "--count-of-tests" value.

It loaded 8 markets because I set 4 symbols, 2 servers, and 1 period.

Here is more extreme example:

https://image-holder.forexsb.com/store/ex-gen-multi-market-load-a-lot-of-data-thumb.png

Here I intentionally skip fetching fresher than 20 minutes data. (loaded during the first example).

I mark the Monday complete.

Happy Trading!