Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to combine more than two scores? #45

Open
alphawolf1988 opened this issue Mar 24, 2024 · 1 comment
Open

How to combine more than two scores? #45

alphawolf1988 opened this issue Mar 24, 2024 · 1 comment

Comments

@alphawolf1988
Copy link

Hello,

currently it's not possible to combine more than two scores, right?
The columns property only allows two values, the buy column and the sell column.
How can i combine the scores of multiple prediction models like in addition "high_20_lc", "low_20_lc", "high_10_lc" and "low_10_lc" to get a final score.

 "signal_sets": [
        {
            // Combine two unsigned scores into one signed score
            "generator": "combine", "config": {
                "columns": ["high_20_lc", "low_20_lc"],  // 2 columns: with grow score and fall score
                "names": "trade_score",  // Output column name: positive values - buy, negative values - sell
                "combine": "difference", // "no_combine" (or empty), "relative", "difference"
                "coefficient": 1.0, "constant": 0.0  // Normalize
            }
        }
    ],
@asavinov
Copy link
Owner

Hi, yes, you cannot use it for mor than 2 inputs. It is because we assume the existence of two separate predictors: upward predictors and downward predictors. One model tries to understand if the price will increase and another model does the same by predicting of the price will decrease. It is possible to work with them directly, for example, using two thresholds: "buy_score > buy_threashod AND sell_score < sell_threashod". However, here we combine them into one score and then compare to one threshold.

If we need to combine score in some different way then apply another generator. In particular, now (in the current dev version) it is possible to define a custom generator function. Just define your own Python function in some file (with the same signature as existing functions), and use its name as generator name: "generator": "my_module:my_combiner". It will take the config via arguments and combine the scores in some specific way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants