{"id":20852837,"url":"https://github.com/vbprojects/npmmtradingstrategy","last_synced_at":"2026-04-15T14:03:20.087Z","repository":{"id":205547118,"uuid":"686109052","full_name":"vbprojects/NPMMTradingStrategy","owner":"vbprojects","description":"This project implements a financial trading strategy in Julia which nowcast local highs and lows to create trading signals, comparing stable rule set classifiers and gradient boosted tree models for trading performance.","archived":false,"fork":false,"pushed_at":"2024-04-18T17:26:04.000Z","size":120517,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T06:27:17.683Z","etag":null,"topics":["feature-engineering","financial-machine-learning","financial-modeling","julia","machine-learning","python","time-series-analysis"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vbprojects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-01T19:09:20.000Z","updated_at":"2024-04-18T17:28:52.000Z","dependencies_parsed_at":"2024-11-18T03:30:19.231Z","dependency_job_id":null,"html_url":"https://github.com/vbprojects/NPMMTradingStrategy","commit_stats":null,"previous_names":["vbprojects/340w"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbprojects%2FNPMMTradingStrategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbprojects%2FNPMMTradingStrategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbprojects%2FNPMMTradingStrategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbprojects%2FNPMMTradingStrategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbprojects","download_url":"https://codeload.github.com/vbprojects/NPMMTradingStrategy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243222186,"owners_count":20256229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feature-engineering","financial-machine-learning","financial-modeling","julia","machine-learning","python","time-series-analysis"],"created_at":"2024-11-18T03:19:02.063Z","updated_at":"2025-12-25T14:33:55.271Z","avatar_url":"https://github.com/vbprojects.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# N-Period Min Max Prediction Through Stable Rule Set Classifiers for Financial Trading Signals\n## Authors: Varun Bhatnagar, Miranda Goodman \nThis project needs Julia 1.9 to run. It also needs a valid Python distribution as it will install Python dependencies.\n\nPackage dependencies\n\nPlots, LinearAlgebra, Statistics, DataFrames, CSV, NLsolve, Memoize, MLJBase, Pkg, MLJModels, ScikitLearn, Flux, Zygote, StatsBase, PyCall, Dates, MLJParticleSwarmOptimization, StatisticalMeasures, MLJTuning, Distributions, MethodChains, SIRUS, EvoTrees\n\nPython Dependencies\n\nta, pandas, pandas_datareader, yfinance\n\nResults are stored in the notebooks folder under airlines.ipynb, beverages.ipynb, and tech.ipynb. Data download commences on the first run, ensure that you have a stable internet connection. Startup and first recompilation times for Julia are long and Python dependencies will be downloaded by the script itself on the first launch to its own Anaconda environment. The Julia installations, Python installations, and data downloads can take more than 10 gigabytes of space, be aware of space constraints when downloading data. Unfortunately, julia's package manager at this time does not allow for sending a requirements.txt, Packages can be downloaded with these commands.\n\n```\nusing Pkg\nPkg.add(split(\"Plots LinearAlgebra Statistics DataFrames CSV NLsolve Memoize MLJBase MLJModels ScikitLearn Flux Zygote StatsBase PyCall Dates MLJParticleSwarmOptimization StatisticalMeasures MLJTuning Distributions SIRUS EvoTrees\", \" \"))\nPkg.add(url=\"https://github.com/uniment/MethodChains.jl\")\n```\n\n# Introduction\n\nStock market forecasting and trading strategies have been extensively\nstudied by statisticians when concerning traditional statistical models.\n\u003cspan class=\"mark\"\u003eNumerous companies and strategies exist to profit off\neven traditional forecasting methods, however, with the advent of newer\nmachine learning techniques like Gradient Boosted Trees, Long-Term\nShort-term memory networks, and even Transformer models, long standing\nassumptions of the inability of previous data to create profitable\ntrading strategies above the average annualized returns of a single\nstock have been challenged.\u003c/span\u003e We hope to show that a novel\ncombination of machine learning techniques can outperform previous\nmethods and generate profitable returns despite the stochastic nature of\nfinancial data, particularly financial securities relating to the\nvarious sectors of the American Market.\n\nThis study seeks to answer the following research questions:\n\n1\\. Can a higher profit margin be achieved using NPMM labeling along\nwith financial feature engineering methods and a Stable and\nInterpretable Rule Sets model?\n\n2\\. How do Stable Rule Set models compare to Gradient Boosted Tree\nMethods within financial time series modeling?\n\n3\\. What are the decisions being made by Stable Rule Set models in\nregard to financial engineering\n\nThe focus of this research is to optimize a trading strategy pursuant to\nbuying and selling assets at optimal times. Given model predictions, we\nemit a \u003cspan class=\"mark\"\u003ebuy\u003c/span\u003e or \u003cspan class=\"mark\"\u003esell\u003c/span\u003e\nsignal which alternates over some interval. We must buy the asset to\nsell it and must sell the asset before buying again. This gives a\nsimplistic view of markets where we cannot sell without holding the\nasset at all (short the asset) or simply buy more of the asset over a\ntime interval. However, the evaluation of trading strategies that\nconsider multiple buys, sells, shorts, and other financial derivatives\nmakes validation difficult. Thus, we stick to our simple trading\nstrategy for evaluation. \n\nThe difficulty in justifying the use of this financial strategy is in\nconsidering the opportunity cost of holding the asset or buying and\n\u003cspan class=\"mark\"\u003ethen\u003c/span\u003e not selling the asset till the end of the\ntime interval. Consider a risk-free asset that grows at a constant rate.\n\u003cspan class=\"mark\"\u003eIn the absence of volatility, it would not be optimal\nto sell the asset after buying before the end of the interval as we keep\nexpecting the asset to increase in value, thus selling the asset and\nthen buying at a later date only disqualifies us from collecting the\nappreciation of the asset over the interval where we did not hold\nit.\u003c/span\u003e While the financial securities we are concerned about are not\nrisk free, the sentiment generally holds. \u003cspan class=\"mark\"\u003eOptimal\ntrades, periods of times before paired and ordered buys and sells, must\noccur when the asset is undervalued to when the asset is overvalued to\nprofit from the volatility. However, that volatility is difficult to\npredict and makes our opportunity cost not only money we may lose on the\ntrade but also that profit relative to the appreciation of the\nunderlying asset.\u003c/span\u003e The rise of machine learning techniques like\nXGBoost and Deep Learning have led to many being able to create\ntheoretically profitable methods. The method we plan on implementing is\na Stable Rule Set Classifier (SBC) and a XGBoost model.\n\nAdditionally, the response variable for supervised machine learning\nmodels is not well defined and several competing labeling techniques\nexist within this space. One prominent example within the literature is\nup-down labeling, where we label whether an asset at any given time step\nwill go up or down one time interval in the future. Difficulties with\nthis strategy are with volatility of the stock. While a less difficult\nproblem on paper than forecasting, much of the problems with both\nremain. For example, the naïve assumption that the asset will rise if\nthe asset rose in the previous interval or vice versa can become a\nsuboptimal convergence point for algorithms of this nature. The response\nitself is also noisy and relates heavily to the volatility of the underlying\nasset (Han, Y., Kim, J., \u0026 Enke, D. (2023)). While up-down labeling\nmakes this a classification problem, the realm of regression where a\nsignal is emitted given some threshold of model output is littered with\nfailed methods. While continuous label methods hope to overcome the\nbiases relating to categorical methods, the difficulty comes in\nadjusting for look-ahead bias, where the label itself relies heavily on\nfuture data to set a target using a past interval and becomes too\ndifficult to predict while also retaining the model's volatility (We et.\nall 2020). N-Period Min Max Labeling hopes to address failures in\ncategorical methods by creating a simple and learnable label. Another\ndifficulty with supervised learning for financial time series is feature\nengineering. Financial assets generally come with five features- the\nopening price over the interval, closing price, high price, low price,\nand volume of assets traded. There has been a large effort by technical\ntraders to create a variety of indicators based of these features\nincluding looking at how values modulate over time to create an\nextensive set of variables that could be related to our response. We use\na combination of feature selection techniques and Partial Least Squares\nregression to attempt to capture as much relevant information from these\nindicators as possible.\n\n\u003cimg src=\"./attachments/paper/media/image1.jpeg\"\nstyle=\"width:3.37917in;height:2.60208in\"\nalt=\"A diagram of a software system Description automatically generated\" /\u003e\n\nFigure 1. \u003cspan class=\"mark\"\u003eVisual of modeling process (Wu et. all,\n2020)\u003c/span\u003e\n\n\u003cspan class=\"mark\"\u003eFigure 1 represents the general process necessary for\nimplementing our various techniques.\u003c/span\u003e We plan on using N-Period\nMin Max Labeling for our Labeling Method, a Stable Rule Set Classifier\nand a XGBoost model, and Partial Least Squares Regression for our\nfeature processing.\n\n#  LITERATURE REVIEW\n\n## NPMM Labeling\n\nThis study uses a labeling strategy and data sources from the paper\nwritten by Han, Y., Kim, J., \u0026 Enke, D. (2023). The labeling schema is\nan N-period min max labeling technique which identifies the local\nmaximums and minimums of a stock trade only labeling at definite time\npoints in the stock trade. Then for a trading strategy, one would want\nto sell a stock at the maximum (When the stocks are worth the most) and\nbuy at the minimum (When the stock is not worth much). There has not\nbeen much prior work done on NPMM labeling in the financial world. Much\nresearch prior to the work done by Han, Y., Kim, J., \u0026 Enke, D. (2023)\nwho attempted to label all points in the stock market using up-down\nlabeling - a strategy that led to small price change sensitivity and\ninaccurately labeled training sets. Up-down labeling views all changes in\nthe stock market as being equally important, which is not always the\ncase. *Wu, Wang, Su, Tang,* and *Wu* (2020) found that up-down labeling does\nnot accurately predict continuous trends in the stock market. This\ncreated flaws between the data labels and the actual market results.\nWith NPMM only labeling at definite points, it allows the training set\nto not be as affected by small price changes. The data for both this\nstudy and the work done by Han, Y., Kim, J., \u0026 Enke, D. (2023) comes\nfrom Yahoo Finance.\n\n\u003cimg src=\"./attachments/paper/media/image2.jpeg\"\nstyle=\"width:3.37917in;height:1.63889in\"\nalt=\"A graph showing a line graph Description automatically generated\" /\u003e\n\nFigure 2. \u003cspan class=\"mark\"\u003eVisual of Up Down Labelling (Han et al.,\n2023)\u003c/span\u003e\n\n\u003cspan class=\"mark\"\u003eUp-down labeling is only looking at the overall trend\nof the market. Are the trends going up or are they going down? In figure\n2 the green triangle symbols show when the stock trends are increasing,\nand the red triangle symbols show when the stock trends are decreasing.\nThis approach to stock market analysis is almost oversimplified because\nit is susceptible to small price change variability, something that is\navoided with NPMM labeling.\u003c/span\u003e\n\n## Technical Indicators and PLS\n\nThrough the use of technical indicators paired with both our models this\nresearch aims to achieve higher accuracy results. A technical indicator\nis on a per stock basis, and it is a measurement or calculation that\nprovides one with some kind of information about the stock. Combining\nthese indicators forms trading strategies. One of the most used\ntechnical indicators is MACD which looks at the direction a stock is\nheaded. It summarizes if a stock is moving upward (meaning the stock is\nworth more money) or downward (meaning we're losing money). MACD also\nlooks at how strongly the stock is moving in that direction and for how\nlong. Using this information in combination with other indicators gives\na stronger understanding of the overall market. This research was\nexemplified by the work of Wen, C., Zhu, H., \u0026 Dai, Z. (2023) who\ncombined over 100 different technical indicators and used a PLS strategy\nfor reduction. *Kelly* and *Pruitt* (2013, 2015) developed the PLS\nmethod, but it was the work of *Huang et al.* (2015), *Stivers* (2018),\nand *Hoang et al.* (2020) that showed the reliability and superior\nperformance of PLS compared to other reduction techniques. This research\nwill use PLS to do reduction on the technical indicators. PLS finds a\nlimited set of variables that maximizes covariance between independent\nand dependent variables. Even for classification tasks, PLS can\noutperform Linear Discriminate Analysis or LDA when there lacks\nsimilarity between the covariance of independent variables to the\ndependent variables. LDA is also used for dimensionality reduction but\nmakes assumptions that the independent and dependent variables have the\nsame covariance which is not the case with stock market prediction. PLS\ndoes not make this assumption. PCA is also usually thought of for\ndimensionality reduction but can easily struggle when handling noisy\ndata. The stock market has very noisy data and Wen, C., Zhu, H., \u0026 Dai,\nZ. (2023) research found that PLS is better at handling these types of\ndata sets.\n\n## Stable Interpretable Rule Sets\n\nGradient Boosted Tree models have become common place for modeling\ntabular datasets. Difficulties in their use arise when considering the\ninterpretability of their predictions, especially for applications where\npotential mishaps equate to incorrigible losses. While better\nunderstanding of model insights may not increase any empirical accuracy,\nhuman trust in models and evaluation of the decision-making processes of\nblack-box models have become a prominent field of study. State of the\nart methods like Shapely Additive Explanations (SHAP) assign feature\nimportance per instance which can be averaged over a set of predictions\nto get a better understanding of how features are used in the model\n(Lundberg, 2017).\n\nInstead of assessing interpretability through feature importance, Stable\nInterpretable Rule Set (SIRUS) models give a set of rules whose\nconditions contribute additively to the prediction.\n\u003cspan class=\"mark\"\u003eThese models fit random forests composed of shallow\ndecision trees and extract a set of rules which when a condition is\nmet increase the model's certainty in the prediction of a classification\ntarget.\u003c/span\u003e SIRUS models inherit performances of random forests while\nexhibiting robustness to data perturbations, and within the context of\nnoisy financial time series data, these properties make the model an\ninteresting candidate for implementation of trading strategies. (Bénard\net al., \u003cspan class=\"mark\"\u003e2019)\u003c/span\u003e\n\n# Novel Implementation\n\nThis research was completed in stages to accurately predict stock market\ntrends. The first stage was the gathering and labeling of the data.\nStock market data is noisy and difficult to analyze when considering\nsmall price change variability. This research addresses these concerns\nachieving a solution that is unique from most historical labeling\nmethods. This study then considers many of the market and technical\nindicators as features. There were 92 technical indicators applied to\none stock at a time and 5 market indicators. PLS will be used as a\nreduction technique on the technical indicators and will be added to the\nlist of indicators, but there is still a significant amount of\nhyperparameters being used in the model. To reduce the hyperparameters\nwe will use an adaptive particle swarm cross validation which reduces\nthe grid for optimizing our parameters. The data and features will be\nfed into a gradient boosted tree model and a stable rule regressor.\nThese models will be validated using a time series cross validation.\n\n## Data Sets\n\nThe data set used in this paper comes from Yahoo Finance and contains\ndata from the United States stock market for years 2000 until 2022.\nStock trends from 2000 until 2021 will be used as training data and\nstock market data from 2022 will be unseen data used for testing. We\nwill specifically be looking at various assets grouped by type. For\nexample, we will be looking at technology stocks which include Apple,\nMicrosoft, Google, and Tesla. We will also be looking at beverage stocks\nlike the Coco-Cola company. A full list of stocks used for training can\nbe found in our results section.\n\nFinancial assets generally come with five features- the opening price,\nclosing price, high price, low price, and volume of assets traded over\neach interval. This holds true for this study. We use a combination of\nfeature selection techniques and PLS regression to capture as much\nrelevant information from both these features and our technical\nindicators as possible.\n\n## Labeling Schema\n\nThis study uses an NPMM labeling schema combined with both market and\ntechnical indicators to predict stock market trends. Remember from\nprevious studies, NPMM labeling does not always have the highest win\nratio of a labeling strategy especially when compared to up-down\nlabeling. However, NPMM labeling had a higher profit factor than other\nlabeling strategies. When we think about stock market prediction, we\ncare less about accuracy and more about profit. So, breaking this down\nfurther, when NPMM labels a trade, it is not always correct even\ncompared with other labeling schemas. Though when NPMM labeling is\nright, it is right by significantly more than other labeling schemas and\nwhen NPMM labeling is wrong it is less wrong compared to the other\nschemas. This means when using NPMM labeling as a schema, we have a\nhigher probability of making money even though it is less accurate than\nother models. NPMM labeling is described in figure 3 below. A NPMM\nlabeling technique identifies the local maximums and minimums of a stock\ntrade only labeling at definite time points in the stock trade. In\nfigure 3 the maximums are labeled in green, and the minimums are labeled\nin red. For a trading strategy, one would want to sell a stock at the\nmaximum (When the stocks are worth the most) and buy at the minimum\nvalues (When the stock is not worth much).\n\n\u003cimg src=\"./attachments/paper/media/image3.jpg\"\nstyle=\"width:3.02778in;height:1.51576in\"\nalt=\"A graph showing a line graph Description automatically generated\" /\u003e\n\n\u003cspan class=\"mark\"\u003eFigure 3: Diagram showing an NPMM labeling\nschema.\u003c/span\u003e\n\n## Using Technical and Market Indicators\n\nWe will pair each stock from our data set sample (Tesla, apple, and\nbeverage stocks) with five market indicators: S\u0026P 500, NASDAQ, VIX\nscore, Dow Jones Industrial Average, and the Russel 2000 index. The S\u0026P\n500 stands for the Standard and Poor 500. It is a stock market index\nthat looks at the largest 500 companies in the United States and how\nmuch of an influence each of them has over the market based on a market\ncapitalization index. It is one of the single largest indicators of how\nthe stock market is doing as a whole. The NASDAQ is similar to the S\u0026P\n500, but only looks at tech companies and how they are influencing the\nstock market. The NASDAQ incorporates the market capitalization of over\n3000 tech companies. The VIX score looks at the volatility of the market\nand analyzes the likelihood of stock market trends drastically changing.\nIt is often referred to more commonly as the fear index because when the\nentire market moves drastically it usually means that a lot of stocks\nare going to drop quickly. Stocks rarely will drastically move up all at\nonce, but they all can drop at the same time. This was seen most\nrecently during the economic trouble in 2008 and during the COVID 19\npandemic. The Dow Jones Industrial Average looks at larger publicly\nowned companies with the idea that the companies with greater stocks\nhave greater control over the performance of the stock market. The\nRussel 2000 index is almost the opposite of the S\u0026P 500. Instead of\nlooking at bigger-sized companies with a greater market capitalization,\nRussel 2000 looks at larger companies but with a lot of small market\ncapitalization.\n\n\u003cspan class=\"mark\"\u003eThis study applied 92 technical indicators for each\nstock and market indicator making a matrix to analyze 552 x N\nvalues.\u003c/span\u003e 552 is obtained by multiplying our 92 indicators by the\nspecific stock and by the 5 market indicators.\n\n# Methodology\n\n## Data Preparation\n\nWe obtained market data from the earliest year data was available for a\nspecific asset after 2000 to 2022. We then used the *ta* library in\npython to add technical indicators to each of the training datasets. We\nconcatenated the columns of our axillary market indicators to each of\nthe tickers present in our composites. We then used PLS to create an\nadditional feature for our training dataset on top of the other\ntechnical indicators present.\n\n## Model Selection\n\nDue to the large search space of possible Gradient Boosted Tree\nParameters, we opted to use an Adaptive Particle Swarm Approach with\nresampling done through Cross Validation. We used a Time Series Cross\nValidation Split on the N-Period Min Max data from 2000 to 2021 for\nhyperparameter tuning. Model selection during hyperparameter tuning was\nconducted by comparing the Briar Loss of probabilistic predictions made\nby EvoTree and Stable Rule Set Classifiers to whether or not an extremum\nwas a min or max. We used 3 particles for each step and trained a total\nof 50 models. For our Stable Rule Set Classifier, we opted to use\ndefault settings as listed by the Julia \u003cspan class=\"mark\"\u003eSIRUS.JL\npackage\u003c/span\u003e. We did not record significant change in performance due\nto parameter tuning for Stable Rule Set Classifiers.\n\n\u003e (J. Zhang et al., \u003cspan class=\"mark\"\u003e2011)\u003c/span\u003e\n\n## Evaluation Criteria\n\nFor evaluation purposes, we held 2022 from training. For evaluating the\ntest set, a different methodology was used. \u003cspan class=\"mark\"\u003eInstead\nof attempting to predict whether or not a point was a local extremum and\nthen classify it as a minimum or maximum, all instances in the test were\nclassified, then a signal to sell was generated if the probability of\nthe prediction was greater than some threshold θ, and a signal to buy if\nless than 1 – θ.\u003c/span\u003e Threshold values lie between 0.5 and 1, the\nchoice impacting the amount of trade and confidence of whether the trade\nwould represent buying or selling at the appropriate extrema.\n\nWhile signals generated may not be alternating, in evaluation given a\nbuy signal we only buy if we are not holding the asset and given sell\nsignal we only sell if holding the asset. We consider signals that are\nacted on buy orders and sell orders. Applying this strategy to the time\nseries could lead to misleading results, particularly if at the end of\nthe time series we are still holding the asset. Instead, we consider the\nperformance of trades, or pairs of buy orders and sell orders.\n\u003cspan class=\"mark\"\u003eConsidering that the value of a trade per asset is\nthe sale price minus the buy price, we looked at the mean value of\ntrades, the standard deviation, mean value of winning trades or trades\nthat are positive, the mean value of losing trades or trades that are\nnegative, and the win rate or percentage of trades that are\npositive.\u003c/span\u003e\n\nWe split our evaluation data over three composites, tech, beverage, and\n\u003cspan class=\"mark\"\u003eairline\u003c/span\u003e. \u003cspan class=\"mark\"\u003eTech assets are\ngenerally high growth, however 2022 presents an interesting case study\non the performance of the algorithm given that 2022 represented a period\nof high volatility with a sharp decline in the first 3 quarters and\nuptick in the last.\u003c/span\u003e Beverage assets are generally stable and\nairline assets are just another easily grouped asset class we could\ntrain to show some amount of generalization.\n\n#  Results\n\n\u003cspan class=\"mark\"\u003eThe following represent performance by EvoTree\n(XGBoost implementation in Pure Julia) and Stable Rules Classifier\nperformance all at thresholds of 80%.\u003c/span\u003e\n\nNote: predictions are modes of possible categories, for thresholding we\ntook the ratio of predicted categories instead of the value for each,\ni.e. If a class must be chosen what is the probability of it being\npositive. For Stable Rule Set Classifiers consider that the output is\nnormalized with respect to the possible maximum of the decisions.\n\nEvoTrees/XGBoost =\u0026gt; GBT, Stable Rule Set Classifier =\u0026gt; SBC\n\n## Beverages\n\nTickers: \"KO\", \"PEP\", \"CELH\", \"MNST\", \"KDP\", \"FIZZ\", \"BUD\", \"SBUX\", \"TAP\"\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 35%\" /\u003e\n\u003ccol style=\"width: 64%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003eWin Rate GBT/SBC\u003c/th\u003e\n\u003cth\u003e70.91% / 70.00%\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC Value of Trade\u003c/td\u003e\n\u003ctd\u003e$0.156 / $0.265\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. GBT/SBC Value of Trade\u003c/td\u003e\n\u003ctd\u003e$2.363 / $2.742\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC Win\u003c/td\u003e\n\u003ctd\u003e$ 0.985 / $ 1.253\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eMean GBT/SBC Loss\u003c/td\u003e\n\u003ctd\u003e$-1.880 / $-2.067\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC NPMM return rate\u003c/td\u003e\n\u003ctd\u003e15.826 % / 18.612%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. GBT/SBC NPMM Return Rate\u003c/td\u003e\n\u003ctd\u003e27.489% / 21.576%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean Asset Return Rate\u003c/td\u003e\n\u003ctd\u003e4.553 %\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. Asset Return Rate\u003c/td\u003e\n\u003ctd\u003e14.733 %\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nTime Series Cross Validation Accuracy\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 15%\" /\u003e\n\u003ccol style=\"width: 16%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eFold 1\u003c/th\u003e\n\u003cth\u003eFold 2\u003c/th\u003e\n\u003cth\u003eFold 3\u003c/th\u003e\n\u003cth\u003eFold 4\u003c/th\u003e\n\u003cth\u003eFold 5\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eGBT\u003c/td\u003e\n\u003ctd\u003e91.9%\u003c/td\u003e\n\u003ctd\u003e92.7%\u003c/td\u003e\n\u003ctd\u003e94.2%\u003c/td\u003e\n\u003ctd\u003e91.5%\u003c/td\u003e\n\u003ctd\u003e91.1%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eSBC\u003c/td\u003e\n\u003ctd\u003e82.1%\u003c/td\u003e\n\u003ctd\u003e87.1%\u003c/td\u003e\n\u003ctd\u003e76.1%\u003c/td\u003e\n\u003ctd\u003e77.8%\u003c/td\u003e\n\u003ctd\u003e83.7%\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nBest Hyper Parameters GBT\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 31%\" /\u003e\n\u003ccol style=\"width: 68%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003eMax Depth\u003c/th\u003e\n\u003cth\u003e4\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eColumn Sample\u003c/td\u003e\n\u003ctd\u003e56.213 %\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eRow Sample\u003c/td\u003e\n\u003ctd\u003e38.569%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eLearning Rate\u003c/td\u003e\n\u003ctd\u003e1.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eNumber of Rounds\u003c/td\u003e\n\u003ctd\u003e21\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eL2 Regularization\u003c/td\u003e\n\u003ctd\u003e0.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eAlpha Regularization\u003c/td\u003e\n\u003ctd\u003e0.456\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eLambda regularization\u003c/td\u003e\n\u003ctd\u003e3.127\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eGamma Regularization\u003c/td\u003e\n\u003ctd\u003e0.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMinimum Weight\u003c/td\u003e\n\u003ctd\u003e3.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eNumber of Bins\u003c/td\u003e\n\u003ctd\u003e97\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eTree Type\u003c/td\u003e\n\u003ctd\u003eBinary\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nSBC Logic\n\nif Stochastic \u0026lt; 67.058784 then 0.003 else 0.02 +\n\nif Williams %R \u0026lt; -32.94121 then 0.003 else 0.02 +\n\nif Keltner Channel P Band \u0026lt; 0.7670374 then 0.002 else 0.015 +\n\nif Keltner Channel H Indicator Band \u0026lt; 1.0 then 0.012 else 0.058 +\n\nif Stochastic RSI \u0026lt; 0.64570004 then 0.003 else 0.019 +\n\nif Williams %R \u0026lt; -50.015392 then 0.0 else 0.001 +\n\nif Bollinger Band P Band \u0026lt; 0.65591186 then 0.004 else 0.023\n\n## Technology\n\nTickers: \"AAPL\", \"MSFT\", \"NVDA\", \"ORCL\", \"AMZN\", \"GOOG\", \"INTC\", \"META\",\n\"TSLA\"\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 35%\" /\u003e\n\u003ccol style=\"width: 64%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003eWin Rate GBT/SBC\u003c/th\u003e\n\u003cth\u003e61.23% / 56.65%\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC Value of Trade\u003c/td\u003e\n\u003ctd\u003e$-1.209 / $ -3.529\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. GBT/SBC Value of Trade\u003c/td\u003e\n\u003ctd\u003e$ 9.875 / $19.816\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC Win\u003c/td\u003e\n\u003ctd\u003e$ 3.390 / $4.374\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eMean GBT/SBC Loss\u003c/td\u003e\n\u003ctd\u003e$ -8.548 / $-13.858\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC NPMM return rate\u003c/td\u003e\n\u003ctd\u003e‑30.482% / ‑30.066%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. GBT/SBC NPMM Return Rate\u003c/td\u003e\n\u003ctd\u003e14.674% / 17.293%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean Asset Return Rate\u003c/td\u003e\n\u003ctd\u003e-43.221 %\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. Asset Return Rate\u003c/td\u003e\n\u003ctd\u003e19.574 %\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nTime Series Cross Validation Accuracy\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 15%\" /\u003e\n\u003ccol style=\"width: 16%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eFold 1\u003c/th\u003e\n\u003cth\u003eFold 2\u003c/th\u003e\n\u003cth\u003eFold 3\u003c/th\u003e\n\u003cth\u003eFold 4\u003c/th\u003e\n\u003cth\u003eFold 5\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eGBT\u003c/td\u003e\n\u003ctd\u003e91.9%\u003c/td\u003e\n\u003ctd\u003e92.7%\u003c/td\u003e\n\u003ctd\u003e94.2%\u003c/td\u003e\n\u003ctd\u003e91.5%\u003c/td\u003e\n\u003ctd\u003e91.1%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eSBC\u003c/td\u003e\n\u003ctd\u003e82.1%\u003c/td\u003e\n\u003ctd\u003e87.1%\u003c/td\u003e\n\u003ctd\u003e76.1%\u003c/td\u003e\n\u003ctd\u003e77.8%\u003c/td\u003e\n\u003ctd\u003e83.7%\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nBest Hyper Parameters GBT\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 31%\" /\u003e\n\u003ccol style=\"width: 68%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003eMax Depth\u003c/th\u003e\n\u003cth\u003e6\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eColumn Sample\u003c/td\u003e\n\u003ctd\u003e41.541%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eRow Sample\u003c/td\u003e\n\u003ctd\u003e28.421%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eLearning Rate\u003c/td\u003e\n\u003ctd\u003e0.2055\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eNumber of Rounds\u003c/td\u003e\n\u003ctd\u003e21\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eL2 Regularization\u003c/td\u003e\n\u003ctd\u003e1.076\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eAlpha Regularization\u003c/td\u003e\n\u003ctd\u003e0.515\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eLambda regularization\u003c/td\u003e\n\u003ctd\u003e0.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eGamma Regularization\u003c/td\u003e\n\u003ctd\u003e10.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMinimum Weight\u003c/td\u003e\n\u003ctd\u003e5.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eNumber of Bins\u003c/td\u003e\n\u003ctd\u003e74\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eTree Type\u003c/td\u003e\n\u003ctd\u003eBinary\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nSBC Logic\n\nif Keltner Channel P Band \u0026lt; 0.80790466 then 0.002 else 0.012 +\n\nif Williams %R \u0026lt; -29.655165 then 0.003 else 0.016 +\n\nif Stochastic \u0026lt; 70.34483 then 0.003 else 0.017 +\n\nif Keltner Channel L Indicator Band \u0026lt; 1.0 then 0.119 else 0.006 +\n\nif Bollinger Band P Band \u0026lt; 0.6683319 then 0.005 else 0.02 +\n\nif Keltner Channel H Indicator Band \u0026lt; 1.0 then 0.007 else 0.032\n\n## Airlines\n\nTickers: \"AAL\", \"CPA\", \"DAL\", \"UAL\", \"AAL\", \"ALK\"\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 35%\" /\u003e\n\u003ccol style=\"width: 64%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003eWin Rate GBT/SBC\u003c/th\u003e\n\u003cth\u003e67.56% / 59.77%\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC Value of Trade\u003c/td\u003e\n\u003ctd\u003e$-0.044/ $ -0.131\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. GBT/SBC Value of Trade\u003c/td\u003e\n\u003ctd\u003e$ 2.007/ $2.613\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC Win\u003c/td\u003e\n\u003ctd\u003e$ 0.774/ $1.079\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eMean GBT/SBC Loss\u003c/td\u003e\n\u003ctd\u003e$ -1.795/ $-1.955\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean GBT/SBC NPMM return rate\u003c/td\u003e\n\u003ctd\u003e-8.969% / -13.609%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. GBT/SBC NPMM Return Rate\u003c/td\u003e\n\u003ctd\u003e13.116% / 11.491%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMean Asset Return Rate\u003c/td\u003e\n\u003ctd\u003e-20.084%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eStd. Asset Return Rate\u003c/td\u003e\n\u003ctd\u003e11.876%\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nBest Hyper Parameters GBT\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 31%\" /\u003e\n\u003ccol style=\"width: 68%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003eMax Depth\u003c/th\u003e\n\u003cth\u003e4\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eColumn Sample\u003c/td\u003e\n\u003ctd\u003e60.229%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eRow Sample\u003c/td\u003e\n\u003ctd\u003e28.594%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eLearning Rate\u003c/td\u003e\n\u003ctd\u003e0.68171\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eNumber of Rounds\u003c/td\u003e\n\u003ctd\u003e25\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eL2 Regularization\u003c/td\u003e\n\u003ctd\u003e6.167\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eAlpha Regularization\u003c/td\u003e\n\u003ctd\u003e0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eLambda regularization\u003c/td\u003e\n\u003ctd\u003e1.0083\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eGamma Regularization\u003c/td\u003e\n\u003ctd\u003e1.5328\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eMinimum Weight\u003c/td\u003e\n\u003ctd\u003e1.0\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eNumber of Bins\u003c/td\u003e\n\u003ctd\u003e125\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eTree Type\u003c/td\u003e\n\u003ctd\u003eBinary\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nTime Series Cross Validation Accuracy\n\n\u003ctable\u003e\n\u003ccolgroup\u003e\n\u003ccol style=\"width: 15%\" /\u003e\n\u003ccol style=\"width: 16%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003ccol style=\"width: 17%\" /\u003e\n\u003c/colgroup\u003e\n\u003cthead\u003e\n\u003ctr class=\"header\"\u003e\n\u003cth\u003e\u003c/th\u003e\n\u003cth\u003eFold 1\u003c/th\u003e\n\u003cth\u003eFold 2\u003c/th\u003e\n\u003cth\u003eFold 3\u003c/th\u003e\n\u003cth\u003eFold 4\u003c/th\u003e\n\u003cth\u003eFold 5\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr class=\"odd\"\u003e\n\u003ctd\u003eGBT\u003c/td\u003e\n\u003ctd\u003e90.1%\u003c/td\u003e\n\u003ctd\u003e91.7%\u003c/td\u003e\n\u003ctd\u003e90.9%\u003c/td\u003e\n\u003ctd\u003e91.9%\u003c/td\u003e\n\u003ctd\u003e91.9%\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr class=\"even\"\u003e\n\u003ctd\u003eSBC\u003c/td\u003e\n\u003ctd\u003e80.8%\u003c/td\u003e\n\u003ctd\u003e74.1%\u003c/td\u003e\n\u003ctd\u003e79.2%\u003c/td\u003e\n\u003ctd\u003e84.6%\u003c/td\u003e\n\u003ctd\u003e81.1%\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nSBC Logic\n\nif Keltner Channel L Indicator Band \u0026lt; 1.0 then 0.139 else 0.013 +\n\nif Stochastic \u0026lt; 66.666664 then 0.002 else 0.014 +\n\nif Stochastic RSI \u0026lt; 0.6425483 then 0.004 else 0.015 +\n\nif Williams %R \u0026lt; -51.76471 then 0.001 else 0.004 +\n\nif Daily Returns \u0026lt; 0.3911308 then 0.001 else 0.004 +\n\nif Keltner Channel H Indicator Band \u0026lt; 1.0 then 0.008 else 0.034 +\n\nif Keltner Channel P Band \u0026lt; 0.7508161 then 0.002 else 0.009\n\n# Discussion\n\n## Reliability of Results\n\nDuring the evaluation year of 2022, the model outperformed the\nunderlying asset composites, and for most well-performing assets\noutperformed the S\u0026P 500 index. However, there are several reasons why\nthis performance may not be indicative of broader algorithmic\neffectiveness. Notably, the evaluation year, 2022, saw large downturns\nfor many industries leading the S\u0026P 500 to decrease by ‑19.64%. As the\ntechnology sector saw the largest depreciation, our composite assets\nreturned an average of ‑43.22%. It also does not benefit us to not\nconsider market conditions in 2022 in the assessment of our models,\nfinancial phenomena happen constantly and the ability of trading\nstrategies to be more profitable than the overall market in adverse\nconditions is surprising and speaks to the effects of the labeling\nmethod involved. However, further composites and market conditions must\nbe evaluated to ascertain whether these models can result in long-term\ngains.\n\n## Comparison of Gradient Boosted Trees and Stable Rule Sets\n\nWhile EvoTrees/XGBoost performed better on N-Period Min Max\nclassification, they did not generate better profit for beverage and\ntechnology composites. This highlights the discrepancy between our\nprediction target and our evaluation metrics. Increases in validation\naccuracy of local extrema classification do not necessarily lead to\nincreased profits. Stable Rule Set Classifiers did not seem to select\nany auxiliary features, preferring momentum and volatility-based\nindicators of the underlying asset itself. \u003cspan class=\"mark\"\u003eWhile this\nmay vary with increasing the maximum amount of rules, the performance of\nboth GBT and SBC models were not so different as to justify the\ncomputational or interpretability cost of using GBT models or increasing\nthe complexity of SBC models.\u003c/span\u003e\n\nSBC models tended to have a higher absolute value of mean trades,\nsuggesting that time intervals between orders were higher.\n\n## Feature Selection\n\n\u003cspan class=\"mark\"\u003eIn our evaluation even with emphasis on feature\nreduction techniques, it is not clear whether feature selection will\nheavily influence the outputs of these experiments especially given the\nvalidation scores of the models involved.\u003c/span\u003e There may be a wide\nrange of potential feature interactions present with the given technical\nindicators that produce well-performing classifiers.\n\u003cspan class=\"mark\"\u003eHeavy regularization penalties employed in our\nhyperparameter search is a definite indicator of collinearity and noise\nwithin our feature set, but the Stable Rule Set Classifier was able to\nsee past the nearly 400 features unrelated to the asset being evaluated\nand pin 7 rules that have some theoretical substance.\u003c/span\u003e Keltner and\nBollinger bands are often thought of as predictions on price floors and\nceilings, while Stochastic, Stochastic RSI, and Williams %R can be used\nto indicate over buying or selling, which represent changes in price\ndirection. PLS is not present in the SBC logic, which should be expected\nas feature reduction generally leads to less interpretable results (Liu\n\u0026 Motoda, 2002).\n\n# Future Work\n\n## NPMM Labeling as Instance Selection\n\nAs we and the authors of the N-Period Min Max Labeling paper have\napplied the method, it functions less as a true target and more a method\nof instance selection. Instance selection is a family of methods that\nincrease data quality by removing noise or difficult to classify data\npoints that \u003cspan class=\"mark\"\u003emay affect\u003c/span\u003e the rest of the time\nseries model. The target provided by NPMM labeling at first glance seems\ntangentially related to a trading strategy. \u003cspan class=\"mark\"\u003eWe cannot\nbe certain in a testing environment whether a point is or is not an\nextremum, however, local extremas seem to provide valuable information\non price direction that applies to all points in the time series.\u003c/span\u003e\nIf this form of instance selection is robust, it may be applicable to\nmore informative targets, such as opportunity cost or even forecasting\nmethods (Liu \u0026 Motoda, 2002).\n\n## Paper Trading Implementation\n\nSBC models produce interpretable and easily programmable models that can\nbe implemented on a variety of architectures and platforms. One such\nplatform to consider would be Pine Script, a language by Trading View\nmeant for back testing trading strategies. \u003cspan class=\"mark\"\u003eOther\nplatforms exist that can be implemented with Julia and Python such as\nAlpaca, that can be used to test the model's ability in a real\nenvironment with fees for making transactions, potential non-liquidity,\nand other fun problems that do not appear in simulated trading.\u003c/span\u003e\n\n## Fuzzy Inference Models\n\nThe connection between Stable Rule Set Classifiers and Fuzzy Inference\nmodels is most apparent when considering their outputs. Both produce\nrules that have an additive effect on the output, however, fuzzy\ninference makes rules from fuzzy sets while Stable Rule Set Classifiers\nuse deterministic sets. For example, if we were to want to predict\nwhether or not it rains tomorrow, we might consider 2 variables,\nhumidity, and temperature. A stable rule set classifier may arrive at a\nrule like if the temperature is less than 50 degrees and humidity is greater\nthan 70% then it will rain. Fuzzy inference systems create fuzzy sets\nfor which a data point can have a chance of belonging. For example,\nthe model may output a rule like if it is cold and humid it will rain.\nThe probability a point may be in the category cold could be Gaussian\ncentered at 30 degrees while humid is also Gaussian centered at 90%. We can\nthen calculate the probability that the rule is true based on the\nprobability that the point falls into the sets cold and humid.\n\u003cspan class=\"mark\"\u003eThey both provide interpretable rule sets, but fuzzy\ninference systems can communicate the confidence of a prediction based\non the probability that new data points fit with previously established\ncategories, which could lead to trading strategies that prevent losses\nwhen market conditions change and make the model potentially\nunprofitable (Hassanniakalager et. al 2020)\u003c/span\u003e.\n\n# Concluding thoughts\n\nGoing over the research questions we posed in our introduction, we now\nhave insight into these answers.\n\n1.  Can a higher profit margin be achieved using NPMM labeling along\n    with financial feature engineering methods and a Stable and\n    Interpretable Rule Sets model?\n\nWhile both methods outlined in this paper seem to outperform composites\nand the overall market, it is difficult to truly validate the use of\nthese algorithms have given market anomalies in 2022. Paper trading or live\ntrading over an extended period of time may increase our confidence in\nthese methods.\n\n1.  How do Stable Rule Set models compare to Gradient Boosted Tree\n    Methods within financial time series modeling?\n\nStable Rule Set Models seem to outperform Gradient Boosted Tree Models\nin conditions where stocks are generally non-volatile with growth rates.\n\n1.  What are the decisions being made by Stable Rule Set models in\n    regard to financial engineering\n\nStable Rule Set Models seem to prefer the individual stock's momentum and\nvolatility-based technical indicators, forgoing PLS and auxiliary market\nindicators. More complex models may turn to these indicators, however,\nthe trade-off between interpretability and complexity still exists. It\nmay not be worth using more complex models given the simplicity and near\nequivalence of profitability between Gradient Boosted Trees and Stable\nRule Set Models.\n\n##### References\n\n1.  \u003cspan class=\"mark\"\u003ehtBénard, C., Biau, G., Veiga, S. da, \u0026\n    Scornet, E. (2019, August 19).\u003c/span\u003e \u003cspan class=\"mark\"\u003e*SIRUS:\n    Stable and interpretable rule set for classification*.\u003c/span\u003e\n    arXiv.Org. \u003cspan class=\"mark\"\u003eh.s://arxiv.org/abs/1908.06852\u003c/span\u003e\n\n2.  Chang, P. C., Liu, C. H., \u0026 Lai, R. K. (2008). *A fuzzy case-based\n    reasoning model for \u003cspan class=\"mark\"\u003e\u003c/span\u003esales forecasting in\n    print circuit board industries. Expert Systems with Applications*,\n    34(3), 2049–2058.\n\n3.  G. Eason, B. Noble, and I. N. Sneddon, “*On certain integrals of\n    Lipschitz-Hankel type \u003cspan class=\"mark\"\u003e\u003c/span\u003einvolving products\n    of Bessel functions*,” Phil. Trans. Roy. Soc. London, vol. A247, pp.\n    529–551, April 1955. *(references)*\n\n4.  Gradojevic, N., \u0026 Gençay, R. (2013). Fuzzy logic, trading\n    uncertainty and technical \u003cspan class=\"mark\"\u003e\u003c/span\u003etrading. Journal\n    of Banking \u0026 Finance, 37(2), 578–586.\n\n5.  Han, Y., Kim, J., \u0026 Enke, D. (2023). *A machine learning trading\n    system for the stock \u003cspan class=\"mark\"\u003e\u003c/span\u003emarket based on\n    N-period Min-Max labeling using XGBoost*. Expert Systems with\n    \u003cspan class=\"mark\"\u003e\u003c/span\u003eApplications, 211, 118581.\n    doi\u003cspan class=\"mark\"\u003e:10.1016/j.eswa.2022.118581\u003c/span\u003e\n\n6.  Hassanniakalager, A., Sermpinis, G., Stasinakis, C., \u0026 Verousis, T.\n    (2020). A \u003cspan class=\"mark\"\u003e\u003c/span\u003econditional fuzzy inference\n    approach in forecasting. European Journal of Operational Research,\n    283(1), 196–216. doi:10.1016/j.ejor.2019.11.006\n\n7.  \u003cspan class=\"mark\"\u003eHoang, K., Cannavan, D., Huang, R., Peng, X.,\n    2020.\u003c/span\u003e *Predicting stock returns with implied cost of capital:\n    a partial least squares approach.* J. Financ. Mark. 100576.\n\n8.  Hruschka, H. (1988). *Use of fuzzy relations in rule-based decision\n    support systems for \u003cspan class=\"mark\"\u003e\u003c/span\u003ebusiness planning\n    problems*. European Journal of Operational Research, 34(3), 326–335.\n\n9.  Huang, D., Jiang, F., Tu, J., Zhou, G., 2015. *Investor sentiment\n    aligned: a powerful predictor of stock returns*. Rev. Financ. Stud.\n    28 (3), 791–837.\n\n10. J. Zhang et al., \"Evolutionary Computation Meets Machine Learning: A\n    Survey,\" *in IEEE Computational Intelligence Magazine*, vol. 6, no.\n    4, pp. 68-75, Nov. 2011, doi: 10.1109/MCI.2011.942584.\n\n11. Kelly, B., Pruitt, S., 2013. *Market expectations in the\n    cross-section of present values*. J. Financ. 68 (5), 1721–1756.\n\n12. Kelly, B., Pruitt, S., 2015. *The three-pass regression filter: a\n    new \u003cspan class=\"mark\"\u003eapproach to\u003c/span\u003e forecasting using many\n    predictors*. J. Econ. 186 (2), 294–316.\n\n13. Kuo, R. J. (2001). *A sales forecasting system based on fuzzy neural\n    network with initial \u003cspan class=\"mark\"\u003e\u003c/span\u003eweights generated by\n    genetic algorithm*. European Journal of Operational Research,\n    129(3), 496–517.\n\n14. Liu, H., \u0026 Motoda, H. (2002, April 1). \u003cspan class=\"mark\"\u003e*On issues\n    of instance selection*.\u003c/span\u003e Springer Nature.\n    https://www.researchgate.net/publication/220451759\\_On\\_Issues\\_of\\_Instance\\_Selection)\n\n15. Lundberg, S., \u0026 Lee, S.-I. (2017, May 22). *A unified approach to\n    interpreting model \u003cspan class=\"mark\"\u003e\u003c/span\u003epredictions*.\n    arXiv.Org. https://arxiv.org/abs/1705.07874\n\n16. Piramuthu, S. (1999). *Financial credit-risk evaluation with neural\n    and neurofuzzy \u003cspan class=\"mark\"\u003e\u003c/span\u003esystems*. European Journal\n    of Operational Research, 112(2), 310–321.\n\n17. Stivers, A., 2018. *Equity premium predictions with many predictors:\n    a risk-based \u003cspan class=\"mark\"\u003e\u003c/span\u003eexplanation of the size and\n    value factors.* J. Empir. Financ. 45, 126–140.\n\n18. Teodorovic, ´ D. (1994). *Fuzzy sets theory applications in traffic\n    and transportation*. European Journal of Operational Research,\n    74(3), 379–390.\n\n19. Wen, C., Zhu, H., \u0026 Dai, Z. (2023). *Forecasting commodity prices\n    returns: The role of \u003cspan class=\"mark\"\u003e\u003c/span\u003epartial least squares\n    approach*. Energy \u003cspan class=\"mark\"\u003eEconomics, 125, 106825.\n    doi:10.1016/j.eneco.2023.106825\u003c/span\u003e\n\n20. Wu, D., Wang, X., Su, J., Tang, B., \u0026 Wu, S. (2020). *A labeling\n    method for financial \u003cspan class=\"mark\"\u003e\u003c/span\u003etime series\n    prediction based on trends*. Entropy, 22(10), 1162.\n    https://doi.org/10.3390/ e22101162\n\n21. Zadeh, L. A. (1965). Fuzzy sets. *Information and Control*, 8(3),\n    338-3\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbprojects%2Fnpmmtradingstrategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbprojects%2Fnpmmtradingstrategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbprojects%2Fnpmmtradingstrategy/lists"}