forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Software

Create and Test Forex Strategies

You are not logged in. Please login or register.


Forex Software → Express Generator → How to Force "Do Not Exit" Strategy in Express Generator

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 6

Topic: How to Force "Do Not Exit" Strategy in Express Generator

After months of effort, I've finally found a solution to a common problem many users face with the Express Generator. While we can't directly create strategies that only exit with TP and Stop Loss, we can modify how these strategies are saved. Here's a step-by-step guide to achieve this:
Open the file bin/lib/collection.js.
Locate the serializeCollection function. This function is responsible for converting strategies to the format saved in the JSON file.
Inside this function, find the part where strategies are mapped. It should look similar to:

return collectionRecords.map((rec) => {
    // ... other code ...
    strategy: {
        properties: {
            // ... properties ...
        },
        openFilters: rec.strategy.entryParams.map(mapIndParam),
        closeFilters: rec.strategy.exitParams.map(mapIndParam),
        timeUpdated: rec.strategy.timeUpdated,
    },
    // ... other code ...
});

Modify the closeFilters part to always use the "Do not Exit" indicator. Replace the line:

closeFilters: rec.strategy.exitParams.map(mapIndParam),

subscrube foir

closeFilters: [{
    name: 'Do not Exit',
    listIndexes: [0],
    numValues: []
}],

5. Save the file after making these changes.
These modifications will ensure that all strategies are saved with the "Do not Exit" indicator as the only exit indicator, regardless of how they were originally generated.
Note: This change only affects how strategies are saved, not how they're generated or tested. For the generator to use only "Do not Exit" during generation and testing, additional changes to other files would be necessary, which only Popov can implement.
After making these changes, all your strategies will be generated with no exit. You should then perform a single test again using the Express Generator as a validator, or even optimize it, because by default, the "Do not Exit" will always be included, and it won't close positions prematurely before reaching TP or Stop Loss.
Another observation: in your .ini configuration file, it's necessary to set only one slot for closing operations as the default.
I sincerely hope this tutorial has made you as happy as it has made me. While it's not the ideal solution we'd prefer, consider this: if you generated 1 million strategies using Express and they were saved with these modifications, after performing a single test, you'd be left with 700,000 strategies. That's only a 30% reduction, which is truly remarkable as it doesn't make such a significant difference.
Trade safely, everyone!

Re: How to Force "Do Not Exit" Strategy in Express Generator

Wow thanks great work.

Re: How to Force "Do Not Exit" Strategy in Express Generator

I'm without. Sleeping since yesterday I managed to speed up countless jobs after that

Re: How to Force "Do Not Exit" Strategy in Express Generator

Hey gabdecsters,
Seeing your efforts encouraged me to dive into the codebase and I found a very simple fix.

Follow the steps and 100% of strats generated will have exit indicator as "Do not exit" and hence useful for SL and TP.
1] Open file:- bin/lib/xgen.min.js

2] Find in the file:- t.openOnlyNames=["Entry Time","Long or Short","Pin Bar"]

3] Replace it with:- t.openOnlyNames = ["Accelerator Oscillator", "Accumulation Distribution", "ADX", "Alligator", "Average True Range", "Awesome Oscillator", "Bears Power", "Bollinger Bands", "Bulls Power", "Candle Color", "Commodity Channel Index", "DeMarker", "Directional Indicators", "Donchian Channel", "Entry Time", "Envelopes", "Force Index", "Long or Short", "MACD", "MACD Signal", "Momentum", "Money Flow Index", "Moving Average", "Moving Average of Oscillator", "Moving Averages Crossover", "On Balance Volume", "Pin Bar", "RSI", "RVI", "RVI Signal", "Standard Deviation", "Stochastic", "Stochastic Signal", "Volumes", "Williams' Percent Range"]

4] Save and don't forget to use --max_exit_slots 1 --ind_exit_time false

5] Enjoy !

Re: How to Force "Do Not Exit" Strategy in Express Generator

Well, in my case it generates several random strategies and saves it as not to leave and all I do after that is to make a single test again

Today I'm going to try your way, let's see if it literally already generates with the not coming out

Re: How to Force "Do Not Exit" Strategy in Express Generator

Let me know

Posts: 6

Pages 1

You must login or register to post a reply

Forex Software → Express Generator → How to Force "Do Not Exit" Strategy in Express Generator

Similar topics in this forum