Machine Learning RSI [BackQuant]Machine Learning RSI
The Machine Learning RSI is a cutting-edge trading indicator that combines the power of Relative Strength Index (RSI) with Machine Learning (ML) clustering techniques to dynamically determine overbought and oversold thresholds. This advanced indicator adapts to market conditions in real-time, offering traders a robust tool for identifying optimal entry and exit points with increased precision.
Core Concept: Relative Strength Index (RSI)
The RSI is a well-known momentum oscillator that measures the speed and change of price movements, oscillating between 0 and 100. Typically, RSI values above 70 are considered overbought, and values below 30 are considered oversold. However, static thresholds may not be effective in all market conditions.
This script enhances the RSI by integrating a dynamic thresholding system powered by Machine Learning clustering, allowing it to adapt thresholds based on historical RSI behavior and market context.
Machine Learning Clustering for Dynamic Thresholds
The Machine Learning (ML) component uses clustering to calculate dynamic thresholds for overbought and oversold levels. Instead of relying on fixed RSI levels, this indicator clusters historical RSI values into three groups using a percentile-based initialization and iterative optimization:
Cluster 1: Represents lower RSI values (typically associated with oversold conditions).
Cluster 2: Represents mid-range RSI values.
Cluster 3: Represents higher RSI values (typically associated with overbought conditions).
Dynamic thresholds are determined as follows:
Long Threshold: The upper centroid value of Cluster 3.
Short Threshold: The lower centroid value of Cluster 1.
This approach ensures that the indicator adapts to the current market regime, providing more accurate signals in volatile or trending conditions.
Smoothing Options for RSI
To further enhance the effectiveness of the RSI, this script allows traders to apply various smoothing methods to the RSI calculation, including:
Simple Moving Average (SMA)
Exponential Moving Average (EMA)
Weighted Moving Average (WMA)
Hull Moving Average (HMA)
Linear Regression (LINREG)
Double Exponential Moving Average (DEMA)
Triple Exponential Moving Average (TEMA)
Adaptive Linear Moving Average (ALMA)
T3 Moving Average
Traders can select their preferred smoothing method and adjust the smoothing period to suit their trading style and market conditions. The option to smooth the RSI reduces noise and makes the indicator more reliable for detecting trends and reversals.
Long and Short Signals
The indicator generates long and short signals based on the relationship between the RSI value and the dynamic thresholds:
Long Signals: Triggered when the RSI crosses above the long threshold, signaling bullish momentum.
Short Signals: Triggered when the RSI falls below the short threshold, signaling bearish momentum.
These signals are dynamically adjusted to reflect real-time market conditions, making them more robust than static RSI signals.
Visualization and Clustering Insights
The Machine Learning RSI provides an intuitive and visually rich interface, including:
RSI Line: Plotted in real-time, color-coded based on its position relative to the dynamic thresholds (green for long, red for short, gray for neutral).
Dynamic Threshold Lines: The script plots the long and short thresholds calculated by the ML clustering process, providing a clear visual reference for overbought and oversold levels.
Cluster Plots: Each RSI cluster is displayed with distinct colors (green, orange, and red) to give traders insights into how RSI values are grouped and how the dynamic thresholds are derived.
Customization Options
The Machine Learning RSI is highly customizable, allowing traders to tailor the indicator to their preferences:
RSI Settings : Adjust the RSI length, source price, and smoothing method to match your trading strategy.
Threshold Settings : Define the range and step size for clustering thresholds, allowing you to fine-tune the clustering process.
Optimization Settings : Control the performance memory, maximum clustering steps, and maximum data points for ML calculations to ensure optimal performance.
UI Settings : Customize the appearance of the RSI plot, dynamic thresholds, and cluster plots. Traders can also enable or disable candle coloring based on trend direction.
Alerts and Automation
To assist traders in staying on top of market movements, the script includes alert conditions for key events:
Long Signal: When the RSI crosses above the long threshold.
Short Signal: When the RSI crosses below the short threshold.
These alerts can be configured to notify traders in real-time, enabling timely decisions without constant chart monitoring.
Trading Applications
The Machine Learning RSI is versatile and can be applied to various trading strategies, including:
Trend Following: By dynamically adjusting thresholds, this indicator is effective in identifying and following trends in real-time.
Reversal Trading: The ML clustering process helps identify extreme RSI levels, offering reliable signals for reversals.
Range-Bound Trading: The dynamic thresholds adapt to market conditions, making the indicator suitable for trading in sideways markets where static thresholds often fail.
Final Thoughts
The Machine Learning RSI represents a significant advancement in RSI-based trading indicators. By integrating Machine Learning clustering techniques, this script overcomes the limitations of static thresholds, providing dynamic, adaptive signals that respond to market conditions in real-time. With its robust visualization, customizable settings, and alert capabilities, this indicator is a powerful tool for traders seeking to enhance their momentum analysis and improve decision-making.
As always, thorough backtesting and integration into a broader trading strategy are recommended to maximize the effectiveness!
Machine
AI Adaptive Money Flow Index (Clustering) [AlgoAlpha]🌟🚀 Dive into the future of trading with our latest innovation: the AI Adaptive Money Flow Index by AlgoAlpha Indicator! 🚀🌟
Developed with the cutting-edge power of Machine Learning, this indicator is designed to revolutionize the way you view market dynamics. 🤖💹 With its unique blend of traditional Money Flow Index (MFI) analysis and advanced k-means clustering, it adapts to market conditions like never before.
Key Features:
📊 Adaptive MFI Analysis: Utilizes the classic MFI formula with a twist, adjusting its parameters based on AI-driven clustering.
🧠 AI-Driven Clustering: Applies k-means clustering to identify and adapt to market states, optimizing the MFI for current conditions.
🎨 Customizable Appearance: Offers adjustable settings for overbought, neutral, and oversold levels, as well as colors for uptrends and downtrends.
🔔 Alerts for Key Market Movements: Set alerts for trend reversals, overbought, and oversold conditions, ensuring you never miss a trading opportunity.
Quick Guide to Using the AI Adaptive MFI (Clustering):
🛠 Customize the Indicator: Customize settings like MFI source, length, and k-means clustering parameters to suit your analysis.
📈 Market Analysis: Monitor the dynamically adjusted overbought, neutral, and oversold levels for insights into market conditions. Watch for classification symbols ("+", "0", "-") for immediate understanding of the current market state. Look out for reversal signals (▲, ▼) to get potential entry points.
🔔 Set Alerts: Utilize the built-in alert conditions for trend changes, overbought, and oversold signals to stay ahead, even when you're not actively monitoring the charts.
How It Works:
The AI Adaptive Money Flow Index employs the k-means clustering machine learning algorithm to refine the traditional Money Flow Index, dynamically adjusting overbought, neutral, and oversold levels based on market conditions. This method analyzes historical MFI values, grouping them into initial clusters using the traditional MFI's overbought, oversold and neutral levels, and then finding the mean of each cluster, which represent the new market states thresholds. This adaptive approach ensures the indicator's sensitivity in real-time, offering a nuanced understanding of market trend and volume analysis.
By recalibrating MFI thresholds for each new data bar, the AI Adaptive MFI intelligently conforms to changing market dynamics. This process, assessing past periods to adjust the indicator's parameters, provides traders with insights finely tuned to recent market behavior. Such innovation enhances decision-making, leveraging the latest data to inform trading strategies. 🌐💥
Machine Learning: STDEV Oscillator [YinYangAlgorithms]This Indicator aims to fill a gap within traditional Standard Deviation Analysis. Rather than its usual applications, this Indicator focuses on applying Standard Deviation within an Oscillator and likewise applying a Machine Learning approach to it. By doing so, we may hope to achieve an Adaptive Oscillator which can help display when the price is deviating from its standard movement. This Indicator may help display both when the price is Overbought or Underbought, and likewise, where the price may face Support and Resistance. The reason for this is that rather than simply plotting a Machine Learning Standard Deviation (STDEV), we instead create a High and a Low variant of STDEV, and then use its Highest and Lowest values calculated within another Deviation to create Deviation Zones. These zones may help to display these Support and Resistance locations; and likewise may help to show if the price is Overbought or Oversold based on its placement within these zones. This Oscillator may also help display Momentum when the High and/or Low STDEV crosses the midline (0). Lastly, this Oscillator may also be useful for seeing the spacing between the High and Low of the STDEV; large spacing may represent volatility within the STDEV which may be helpful for seeing when there is Momentum in the form of volatility.
Tutorial:
Above is an example of how this Indicator looks on BTC/USDT 1 Day. As you may see, when the price has parabolic movement, so does the STDEV. This is due to this price movement deviating from the mean of the data. Therefore when these parabolic movements occur, we create the Deviation Zones accordingly, in hopes that it may help to project future Support and Resistance locations as well as helping to display when the price is Overbought and Oversold.
If we zoom in a little bit, you may notice that the Support Zone (Blue) is smaller than the Resistance Zone (Orange). This is simply because during the last Bull Market there was more parabolic price deviation than there was during the Bear Market. You may see this if you refer to their values; the Resistance Zone goes to ~18k whereas the Support Zone is ~10.5k. This is completely normal and the way it is supposed to work. Due to the nature of how STDEV works, this Oscillator doesn’t use a 1:1 ratio and instead can develop and expand as exponential price action occurs.
The Neutral (0) line may also act as a Support and Resistance location. In the example above we can see how when the STDEV is below it, it acts as Resistance; and when it’s above it, it acts as Support.
This Neutral line may also provide us with insight as towards the momentum within the market and when it has shifted. When the STDEV is below the Neutral line, the market may be considered Bearish. When the STDEV is above the Neutral line, the market may be considered Bullish.
The Red Line represents the STDEV’s High and the Green Line represents the STDEV’s Low. When the STDEV’s High and Low get tight and close together, this may represent there is currently Low Volatility in the market. Low Volatility may cause consolidation to occur, however it also leaves room for expansion.
However, when the STDEV’s High and Low are quite spaced apart, this may represent High levels of Volatility in the market. This may mean the market is more prone to parabolic movements and expansion.
We will conclude our Tutorial here. Hopefully this has given you some insight into how applying Machine Learning to a High and Low STDEV then creating Deviation Zones based on it may help project when the Momentum of the Market is Bullish or Bearish; likewise when the price is Overbought or Oversold; and lastly where the price may face Support and Resistance in the form of STDEV.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: Optimal Length [YinYangAlgorithms]This Indicator aims to solve an issue that most others face; static lengths. This Indicator will scan lengths from the Min to Max setting (1 - 400 by default) to calculate which is the most Optimal Length in the current market condition. Almost every Indicator uses a length in some part of their calculation, and this length is usually adjustable via the Settings; however it is generally a static fixed length. Static non changing lengths may not always produce optimal results. As market conditions change generally the optimal length will too. For this reason we have created this indicator.
This Indicator will create a Neutral (Min - Max Length), Fast (Min - Mid Length ((Max - Min) / 2)) and Slow (Mid Length ((Max - Min) / 2) - Max Length). This allows you to understand which the Optimal Fast, Slow and Neutral lengths are within the given Mix and Max length settings.
This Indicator then plots these Optimal Lengths as an Oscillator which can then be used within ANOTHER Indicator as a Source within its Settings. Stand alone this Indicator may not prove all that useful, however when its Lengths are inputted into another Indicator it may prove very useful. This allows other Indicators to use the Optimal Length within its calculations from the Settings rather than relying on simply a fixed length. Unfortunately this results in users needing to manually plug the Optimal Length plots into the second Indicator; but it also allows for endless possibilities with applying Machine Learning Optimal Lengths within both Traditional and Non-Traditional Indicators and may give other Pine Coders an easy and effective way to add Machine Learning auto adjustable lengths within their already created Indicators.
The beautiful part about this Indicator is that aside from inputting the Optimal Length Plot into another Indicator, there is no manual updating needed. When the Optimal Length changes, the change will automatically reflect in the other Indicator without the need for you to manually adjust its length. This may be very useful with both time preservation, as well as if there is an automated strategy based upon said Indicator that now won’t need manual intervention.
Tutorial:
By default this is what the Machine Learning: Optimal Length Indicator looks like. It is simply a way of both Displaying and Plotting our current Optimal Length so that we may then use it as a source within ANOTHER Indicator. This will allow the automation of an Optimal Length to be updated, rather than needing any manual input from yourself (aside from set up).
For instance if you set the start length to 1 and the end length to 400 (default settings), it will scan to find the optimal Length setting between 1 and 400. This features 3 types of lengths:
Fast (Green Line): 1-199 (from start length to half way of total)
Slow (Red Line): 200 - 400 (mid way to end length)
Neutral (Blue Line): 1 - 400 (start to end length)
By breaking down the Optimal Length detection into these 3 different types, we can see how the Optimal Length compares and changes based on the lengths allotted to them and how performance changes.
For instance, you may notice that both the Fast and Slow Optimal Length didn’t change much in the example above; however the Neutral Optimal Length changed quite a bit. This is due to the fact that the Neutral is inclusive of all lengths available and may be considered the more accurate due to that. However, this doesn’t mean the Fast and Slow lengths aren’t important and should be used. They may be useful for seeing how something fairs in a Fast and Slow standpoint.
If you change your TimeFrame from 15 minute to 1 Day, you’ll notice that the Optimal Lengths gravitate towards their upper bounds:
199 is max for Fast, it’s at 195
400 is max for Slow, its at 393
400 is max for Neutral, its at 399
The Optimal Length may move up to its upper bounds on Higher Time Frames because there is a lot of price action and long term data being displayed. This may lead to higher lengths performing better in a profitability standpoint since its data is based on so far back and such drastic price movements.
Below we’re going to go through a few examples, including the code so you may reproduce the example and have an understanding of how versatile Inputting an Optimal Length as a source may be within Traditional Indicators.
Adding the Machine Learning: Optimal Length to another Indicator:
You may add the Optimal Length to another Indicator as shown in the example above. In the example we are adding the ‘Machine Learning: Optimal Length - Neutral’ to our Neutral Length within the Settings. The external Indicator needs to have the ability to input the Optimal Length as a Source, this way it can automatically change within the external Indicator when the Optimal Length Indicator changes its Optimal Length.
Please note you may get an error within an external Indicator that accepts the Length as a Source if you don’t select the Machine Learning: Optimal Length. For instance, if you use ‘Close’ within BTC/USDT the length used would be ~36,000. This length is too long and will throw an error.
For this reason, we will ensure the Max Length that may be used is 1000.
Please note, on lower Time Frames you may need to adjust the Max Length. For instance if 20k bar data is used, the Max Length ‘may’ fail to load when going by default Min: 1 and Max: 400. Generally with most pairs it will load if your TradingView subscription is Premium or greater; however if it is less there is a chance it may fail. If it fails for you too often please lower the Max Length Amount; or send us a message we can look into a fix for this.
*** If it fails to load, please try removing the external Indicator and re-adding it and adding the Lengths back as a Source within the Settings. Sometimes it fails, but re-adding may fix it. If it keeps failing afterwards, reduce the Max Length Amount as mentioned above. ***
Simple Moving Average:
In this example above have the Fast, Slow and Neutral Optimal Length formatted as a Slow Moving Average. The first example is on the 15 minute Time Frame and the second is on the 1 Day Time Frame, demonstrating how the length changes based on the Time Frame and the effects it may have.
Here is the code for the example Indicator shown above. This example shows how you may use the Optimal Length as a Source and then use that Optimal Length and plot it as a Simple Moving Average:
//@version=5
indicator("Optimal Length - Backtesting - MA", overlay=true, max_bars_back=5000)
outputType = input.string("All", "Output Type", options= )
lengthSource = input.source(close, "Neutral Length")
lengthSource_fast = input.source(close, "Fast Length")
lengthSource_slow = input.source(close, "Slow Length")
showNeutral = outputType == "Neutral" or outputType == "Fast + Neutral" or outputType == "Slow + Neutral" or outputType == "All"
showFast = outputType == "Fast" or outputType == "Fast + Neutral" or outputType == "Fast + Slow" or outputType == "All"
showSlow = outputType == "Slow" or outputType == "Slow + Neutral" or outputType == "Fast + Slow" or outputType == "All"
//Neutral
optimalLength = math.min(math.max(math.round(lengthSource), 1), 1000)
optimalMA = ta.sma(close, optimalLength)
//Fast
optimalLength_fast = math.min(math.max(math.round(lengthSource_fast), 1), 1000)
optimalMA_fast = ta.sma(close, optimalLength_fast)
//Slow
optimalLength_slow = math.min(math.max(math.round(lengthSource_slow), 1), 1000)
optimalMA_slow = ta.sma(close, optimalLength_slow)
plot(showNeutral ? optimalMA : na, color=color.blue)
plot(showFast ? optimalMA_fast : na, color=color.green)
plot(showSlow ? optimalMA_slow : na, color=color.red)
Bollinger Bands:
In the two examples above for Bollinger Bands we have first the 15 Minute Time Frame and then the 1 Day Time Frame. As described above in ‘Adding the Machine Learning: Optimal Length to another Indicator’ sometimes it may fail to load, for this reason in the 15 Minute it was reduced to a max of 300 Length.
Bollinger Bands are a way to see a Simple Moving Average (SMA) that then uses Standard Deviation to identify how much deviation has occurred. This Deviation is than Added and Subtracted from the SMA to create the Bollinger Bands which help Identify possible movement zones that are ‘within range’. This may mean that the price may face Support / Resistance when it reaches the Outer / Inner bounds of the Bollinger Bands. Likewise, it may mean the Price is ‘Overbought’ when outside and above or ‘Underbought’ when outside and below the Bollinger Bands.
By applying All 3 different types of Optimal Lengths towards a Traditional Bollinger Band calculation we may hope to see different ranges of Bollinger Bands and how different lookback lengths may imply possible movement ranges on both a Short Term, Long Term and Neutral perspective. By seeing these possible ranges you may have the ability to identify more levels of Support and Resistance over different lengths and Trading Styles.
Below is the code for the Bollinger Bands example above:
//@version=5
indicator("Optimal Length - Backtesting - Bollinger Bands", overlay=true, max_bars_back=5000)
outputType = input.string("All", "Output Type", options= )
lengthSource = input.source(close, "Neutral Length")
lengthSource_fast = input.source(close, "Fast Length")
lengthSource_slow = input.source(close, "Slow Length")
showNeutral = outputType == "Neutral" or outputType == "Fast + Neutral" or outputType == "Slow + Neutral" or outputType == "All"
showFast = outputType == "Fast" or outputType == "Fast + Neutral" or outputType == "Fast + Slow" or outputType == "All"
showSlow = outputType == "Slow" or outputType == "Slow + Neutral" or outputType == "Fast + Slow" or outputType == "All"
mult = 2.0
src = close
neutralColor = color.blue
slowColor = color.red
fastColor = color.green
//Neutral
optimalLength = math.min(math.max(math.round(lengthSource), 1), 1000)
optimalMA = ta.sma(close, optimalLength)
//Fast
optimalLength_fast = math.min(math.max(math.round(lengthSource_fast), 1), 1000)
optimalMA_fast = ta.sma(close, optimalLength_fast)
//Slow
optimalLength_slow = math.min(math.max(math.round(lengthSource_slow), 1), 1000)
optimalMA_slow = ta.sma(close, optimalLength_slow)
//Neutral Bollinger Bands
dev = mult * ta.stdev(src, math.round(optimalLength))
upper = optimalMA + dev
lower = optimalMA - dev
plot(showNeutral ? optimalMA : na, "Neutral Basis", color=color.new(neutralColor, 0))
p1 = plot(showNeutral ? upper : na, "Neutral Upper", color=color.new(neutralColor, 50))
p2 = plot(showNeutral ? lower : na, "Neutral Lower", color=color.new(neutralColor, 50))
fill(p1, p2, title = "Neutral Background", color=color.new(neutralColor, 96))
//Slow Bollinger Bands
dev_slow = mult * ta.stdev(src, math.round(optimalLength_slow))
upper_slow = optimalMA_slow + dev_slow
lower_slow = optimalMA_slow - dev_slow
plot(showFast ? optimalMA_slow : na, "Slow Basis", color=color.new(slowColor, 0))
p1_slow = plot(showFast ? upper_slow : na, "Slow Upper", color=color.new(slowColor, 50))
p2_slow = plot(showFast ? lower_slow : na, "Slow Lower", color=color.new(slowColor, 50))
fill(p1_slow, p2_slow, title = "Slow Background", color=color.new(slowColor, 96))
//Fast Bollinger Bands
dev_fast = mult * ta.stdev(src, math.round(optimalLength_fast))
upper_fast = optimalMA_fast + dev_fast
lower_fast = optimalMA_fast - dev_fast
plot(showSlow ? optimalMA_fast : na, "Fast Basis", color=color.new(fastColor, 0))
p1_fast = plot(showSlow ? upper_fast : na, "Fast Upper", color=color.new(fastColor, 50))
p2_fast = plot(showSlow ? lower_fast : na, "Fast Lower", color=color.new(fastColor, 50))
fill(p1_fast, p2_fast, title = "Fast Background", color=color.new(fastColor, 96))
Donchian Channels:
Above you’ll see two examples of Machine Learning: Optimal Length applied to Donchian Channels. These are displayed with both the 15 Minute Time Frame and the 1 Day Time Frame.
Donchian Channels are a way of seeing potential Support and Resistance within a given lookback length. They are a way of withholding the High’s and Low’s of a specific lookback length and looking for deviation within this length. By applying our Fast, Slow and Neutral Machine Learning: Optimal Length to these Donchian Channels way may hope to achieve a viable range of High’s and Low’s that one may use to Identify Support and Resistance locations for different ranges of Optimal Lengths and likewise potentially different Trading Strategies.
The code to reproduce these Donchian Channels as displayed above is so:
//@version=5
indicator("Optimal Length - Backtesting - Donchian Channels", overlay=true, max_bars_back=5000)
outputType = input.string("All", "Output Type", options= )
lengthSource = input.source(close, "Neutral Length")
lengthSource_fast = input.source(close, "Fast Length")
lengthSource_slow = input.source(close, "Slow Length")
showNeutral = outputType == "Neutral" or outputType == "Fast + Neutral" or outputType == "Slow + Neutral" or outputType == "All"
showFast = outputType == "Fast" or outputType == "Fast + Neutral" or outputType == "Fast + Slow" or outputType == "All"
showSlow = outputType == "Slow" or outputType == "Slow + Neutral" or outputType == "Fast + Slow" or outputType == "All"
mult = 2.0
src = close
neutralColor = color.blue
slowColor = color.red
fastColor = color.green
//Neutral
optimalLength = math.min(math.max(math.round(lengthSource), 1), 1000)
optimalMA = ta.sma(close, optimalLength)
//Fast
optimalLength_fast = math.min(math.max(math.round(lengthSource_fast), 1), 1000)
optimalMA_fast = ta.sma(close, optimalLength_fast)
//Slow
optimalLength_slow = math.min(math.max(math.round(lengthSource_slow), 1), 1000)
optimalMA_slow = ta.sma(close, optimalLength_slow)
//Neutral Donchian Channels
lower_dc = ta.lowest(optimalLength)
upper_dc = ta.highest(optimalLength)
basis_dc = math.avg(upper_dc, lower_dc)
plot(showNeutral ? basis_dc : na, "Donchain Channel - Neutral Basis", color=color.new(neutralColor, 0))
u = plot(showNeutral ? upper_dc : na, "Donchain Channel - Neutral Upper", color=color.new(neutralColor, 50))
l = plot(showNeutral ? lower_dc : na, "Donchain Channel - Neutral Lower", color=color.new(neutralColor, 50))
fill(u, l, color=color.new(neutralColor, 96), title = "Donchain Channel - Neutral Background")
//Fast Donchian Channels
lower_dc_fast = ta.lowest(optimalLength_fast)
upper_dc_fast = ta.highest(optimalLength_fast)
basis_dc_fast = math.avg(upper_dc_fast, lower_dc_fast)
plot(showFast ? basis_dc_fast : na, "Donchain Channel - Fast Neutral Basis", color=color.new(fastColor, 0))
u_fast = plot(showFast ? upper_dc_fast : na, "Donchain Channel - Fast Upper", color=color.new(fastColor, 50))
l_fast = plot(showFast ? lower_dc_fast : na, "Donchain Channel - Fast Lower", color=color.new(fastColor, 50))
fill(u_fast, l_fast, color=color.new(fastColor, 96), title = "Donchain Channel - Fast Background")
//Slow Donchian Channels
lower_dc_slow = ta.lowest(optimalLength_slow)
upper_dc_slow = ta.highest(optimalLength_slow)
basis_dc_slow = math.avg(upper_dc_slow, lower_dc_slow)
plot(showSlow ? basis_dc_slow : na, "Donchain Channel - Slow Neutral Basis", color=color.new(slowColor, 0))
u_slow = plot(showSlow ? upper_dc_slow : na, "Donchain Channel - Slow Upper", color=color.new(slowColor, 50))
l_slow = plot(showSlow ? lower_dc_slow : na, "Donchain Channel - Slow Lower", color=color.new(slowColor, 50))
fill(u_slow, l_slow, color=color.new(slowColor, 96), title = "Donchain Channel - Slow Background")
Envelopes / Envelopes Adjusted:
Envelopes are an interesting one in the sense that they both may be perceived as useful; however we deem that with the use of an ‘Optimal Length’ that the ‘Envelopes Adjusted’ may work best. We will start with examples of the Traditional Envelope then showcase the Adjusted version.
Envelopes:
As you may see, a Traditional form of Envelopes even produced with our Machine Learning: Optimal Length may not produce optimal results. Unfortunately this may occur with some Traditional Indicators and they may need some adjustments as you’ll notice with the ‘Envelopes Adjusted’ version. However, even without the adjustments, these Envelopes may be useful for seeing ‘Overbought’ and ‘Oversold’ locations within a Machine Learning: Optimal Length standpoint.
Envelopes Adjusted:
By adding an adjustment to these Envelopes, we may hope to better reflect out Optimal Length within it. This is caused by adding a ratio reflection towards the current length of the Optimal Length and the max Length used. This allows for the Fast and Neutral (and potentially Slow if Neutral is greater) to achieve a potentially more accurate result.
Envelopes, much like Bollinger Bands are a way of seeing potential movement zones along with potential Support and Resistance. However, unlike Bollinger Bands which are based on Standard Deviation, Envelopes are based on percentages +/- from the Simple Moving Average.
The code used to reproduce the example above is as follows:
//@version=5
indicator("Optimal Length - Backtesting - Envelopes", overlay=true, max_bars_back=5000)
outputType = input.string("All", "Output Type", options= )
displayType = input.string("Envelope Adjusted", "Display Type", options= )
lengthSource = input.source(close, "Neutral Length")
lengthSource_fast = input.source(close, "Fast Length")
lengthSource_slow = input.source(close, "Slow Length")
showNeutral = outputType == "Neutral" or outputType == "Fast + Neutral" or outputType == "Slow + Neutral" or outputType == "All"
showFast = outputType == "Fast" or outputType == "Fast + Neutral" or outputType == "Fast + Slow" or outputType == "All"
showSlow = outputType == "Slow" or outputType == "Slow + Neutral" or outputType == "Fast + Slow" or outputType == "All"
mult = 2.0
src = close
neutralColor = color.blue
slowColor = color.red
fastColor = color.green
//Neutral
optimalLength = math.min(math.max(math.round(lengthSource), 1), 1000)
optimalMA = ta.sma(close, optimalLength)
//Fast
optimalLength_fast = math.min(math.max(math.round(lengthSource_fast), 1), 1000)
optimalMA_fast = ta.sma(close, optimalLength_fast)
//Slow
optimalLength_slow = math.min(math.max(math.round(lengthSource_slow), 1), 1000)
optimalMA_slow = ta.sma(close, optimalLength_slow)
percent = 10.0
maxAmount = math.max(optimalLength, optimalLength_fast, optimalLength_slow)
//Neutral
k = displayType == "Envelope" ? percent/100.0 : (percent/100.0) / (optimalLength / maxAmount)
upper_env = optimalMA * (1 + k)
lower_env = optimalMA * (1 - k)
plot(showNeutral ? optimalMA : na, "Envelope - Neutral Basis", color=color.new(neutralColor, 0))
u_env = plot(showNeutral ? upper_env : na, "Envelope - Neutral Upper", color=color.new(neutralColor, 50))
l_env = plot(showNeutral ? lower_env : na, "Envelope - Neutral Lower", color=color.new(neutralColor, 50))
fill(u_env, l_env, color=color.new(neutralColor, 96), title = "Envelope - Neutral Background")
//Fast
k_fast = displayType == "Envelope" ? percent/100.0 : (percent/100.0) / (optimalLength_fast / maxAmount)
upper_env_fast = optimalMA_fast * (1 + k_fast)
lower_env_fast = optimalMA_fast * (1 - k_fast)
plot(showFast ? optimalMA_fast : na, "Envelope - Fast Basis", color=color.new(fastColor, 0))
u_env_fast = plot(showFast ? upper_env_fast : na, "Envelope - Fast Upper", color=color.new(fastColor, 50))
l_env_fast = plot(showFast ? lower_env_fast : na, "Envelope - Fast Lower", color=color.new(fastColor, 50))
fill(u_env_fast, l_env_fast, color=color.new(fastColor, 96), title = "Envelope - Fast Background")
//Slow
k_slow = displayType == "Envelope" ? percent/100.0 : (percent/100.0) / (optimalLength_slow / maxAmount)
upper_env_slow = optimalMA_slow * (1 + k_slow)
lower_env_slow = optimalMA_slow * (1 - k_slow)
plot(showSlow ? optimalMA_slow : na, "Envelope - Slow Basis", color=color.new(slowColor, 0))
u_env_slow = plot(showSlow ? upper_env_slow : na, "Envelope - Slow Upper", color=color.new(slowColor, 50))
l_env_slow = plot(showSlow ? lower_env_slow : na, "Envelope - Slow Lower", color=color.new(slowColor, 50))
fill(u_env_slow, l_env_slow, color=color.new(slowColor, 96), title = "Envelope - Slow Background")
Hopefully these examples, including reproducing code, have given you some insight as to how useful this Machine Learning: Optimal Length may be and how another Indicator may easily modify their existing code to incorporate the usage of such Machine Learning: Optimal Length. We likewise will publish a Backtesting Indicator which incorporates all of the concepts we’ve gone over within here; in case you wish to take advantage of the Traditional Indicators mentioned above that allow the input of Machine Learning: Optimal Length and don’t wish to code them.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: VWAP [YinYangAlgorithms]Machine Learning: VWAP aims to use Machine Learning to Identify the best location to Anchor the VWAP at. Rather than using a traditional fixed length or simply adjusting based on a Date / Time; by applying Machine Learning we may hope to identify crucial areas which make sense to reset the VWAP and start anew. VWAP’s may act similar to a Bollinger Band in the sense that they help to identify both Overbought and Oversold Price locations based on previous movements and help to identify how far the price may move within the current Trend. However, unlike Bollinger Bands, VWAPs have the ability to parabolically get quite spaced out and also reset. For this reason, the price may never actually go from the Lower to the Upper and vice versa (when very spaced out; when the Upper and Lower zones are narrow, it may bounce between the two). The reason for this is due to how the anchor location is calculated and in this specific Indicator, how it changes anchors based on price movement calculated within Machine Learning.
This Indicator changes the anchor if the Low < Lowest Low of a length of X and likewise if the High > Highest High of a length of X. This logic is applied within a Machine Learning standpoint that likewise amplifies this Lookback Length by adding a Machine Learning Length to it and increasing the lookback length even further.
Due to how the anchor for this VWAP changes, you may notice that the Basis Line (Orange) may act as a Trend Identifier. When the Price is above the basis line, it may represent a bullish trend; and likewise it may represent a bearish trend when below it. You may also notice what may happen is when the trend occurs, it may push all the way to the Upper or Lower levels of this VWAP. It may then proceed to move horizontally until the VWAP expands more and it may gain more movement; or it may correct back to the Basis Line. If it corrects back to the basis line, what may happen is it either uses the Basis Line as a Support and continues in its current direction, or it will change the VWAP anchor and start anew.
Tutorial:
If we zoom in on the most recent VWAP we can see how it expands. Expansion may be caused by time but generally it may be caused by price movement and volume. Exponential Price movement causes the VWAP to expand, even if there are corrections to it. However, please note Volume adds a large weighted factor to the calculation; hence Volume Weighted Average Price (VWAP).
If you refer to the white circle in the example above; you’ll be able to see that the VWAP expanded even while the price was correcting to the Basis line. This happens due to exponential movement which holds high volume. If you look at the volume below the white circle, you’ll notice it was very large; however even though there was exponential price movement after the white circle, since the volume was low, the VWAP didn’t expand much more than it already had.
There may be times where both Volume and Price movement isn’t significant enough to cause much of an expansion. During this time it may be considered to be in a state of consolidation. While looking at this example, you may also notice the color switch from red to green to red. The color of the VWAP is related to the movement of the Basis line (Orange middle line). When the current basis is > the basis of the previous bar the color of the VWAP is green, and when the current basis is < the basis of the previous bar, the color of the VWAP is red. The color may help you gauge the current directional movement the price is facing within the VWAP.
You may have noticed there are signals within this Indicator. These signals are composed of Green and Red Triangles which represent potential Bullish and Bearish momentum changes. The Momentum changes happen when the Signal Type:
The High/Low or Close (You pick in settings)
Crosses one of the locations within the VWAP.
Bullish Momentum change signals occur when :
Signal Type crosses OVER the Basis
Signal Type crosses OVER the lower level
Bearish Momentum change signals occur when:
Signal Type crosses UNDER the Basis
Signal Type Crosses UNDER the upper level
These signals may represent locations where momentum may occur in the direction of these signals. For these reasons there are also alerts available to be set up for them.
If you refer to the two circles within the example above, you may see that when the close goes above the basis line, how it mat represents bullish momentum. Likewise if it corrects back to the basis and the basis acts as a support, it may continue its bullish momentum back to the upper levels again. However, if you refer to the red circle, you’ll see if the basis fails to act as a support, it may then start to correct all the way to the lower levels, or depending on how expanded the VWAP is, it may just reset its anchor due to such drastic movement.
You also have the ability to disable Machine Learning by setting ‘Machine Learning Type’ to ‘None’. If this is done, it will go off whether you have it set to:
Bullish
Bearish
Neutral
For the type of VWAP you want to see. In this example above we have it set to ‘Bullish’. Non Machine Learning VWAP are still calculated using the same logic of if low < lowest low over length of X and if high > highest high over length of X.
Non Machine Learning VWAP’s change much quicker but may also allow the price to correct from one side to the other without changing VWAP Anchor. They may be useful for breaking up a trend into smaller pieces after momentum may have changed.
Above is an example of how the Non Machine Learning VWAP looks like when in Bearish. As you can see based on if it is Bullish or Bearish is how it favors the trend to be and may likewise dictate when it changes the Anchor.
When set to neutral however, the Anchor may change quite quickly. This results in a still useful VWAP to help dictate possible zones that the price may move within, but they’re also much tighter zones that may not expand the same way.
We will conclude this Tutorial here, hopefully this gives you some insight as to why and how Machine Learning VWAPs may be useful; as well as how to use them.
Settings:
VWAP:
VWAP Type: Type of VWAP. You can favor specific direction changes or let it be Neutral where there is even weight to both. Please note, these do not apply to the Machine Learning VWAP.
Source: VWAP Source. By default VWAP usually uses HLC3; however OHLC4 may help by providing more data.
Lookback Length: The Length of this VWAP when it comes to seeing if the current High > Highest of this length; or if the current Low is < Lowest of this length.
Standard VWAP Multiplier: This multiplier is applied only to the Standard VWMA. This is when 'Machine Learning Type' is set to 'None'.
Machine Learning:
Use Rational Quadratics: Rationalizing our source may be beneficial for usage within ML calculations.
Signal Type: Bullish and Bearish Signals are when the price crosses over/under the basis, as well as the Upper and Lower levels. These may act as indicators to where price movement may occur.
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: Optimal RSI [YinYangAlgorithms]This Indicator, will rate multiple different lengths of RSIs to determine which RSI to RSI MA cross produced the highest profit within the lookback span. This ‘Optimal RSI’ is then passed back, and if toggled will then be thrown into a Machine Learning calculation. You have the option to Filter RSI and RSI MA’s within the Machine Learning calculation. What this does is, only other Optimal RSI’s which are in the same bullish or bearish direction (is the RSI above or below the RSI MA) will be added to the calculation.
You can either (by default) use a Simple Average; which is essentially just a Mean of all the Optimal RSI’s with a length of Machine Learning. Or, you can opt to use a k-Nearest Neighbour (KNN) calculation which takes a Fast and Slow Speed. We essentially turn the Optimal RSI into a MA with different lengths and then compare the distance between the two within our KNN Function.
RSI may very well be one of the most used Indicators for identifying crucial Overbought and Oversold locations. Not only that but when it crosses its Moving Average (MA) line it may also indicate good locations to Buy and Sell. Many traders simply use the RSI with the standard length (14), however, does that mean this is the best length?
By using the length of the top performing RSI and then applying some Machine Learning logic to it, we hope to create what may be a more accurate, smooth, optimal, RSI.
Tutorial:
This is a pretty zoomed out Perspective of what the Indicator looks like with its default settings (except with Bollinger Bands and Signals disabled). If you look at the Tables above, you’ll notice, currently the Top Performing RSI Length is 13 with an Optimal Profit % of: 1.00054973. On its default settings, what it does is Scan X amount of RSI Lengths and checks for when the RSI and RSI MA cross each other. It then records the profitability of each cross to identify which length produced the overall highest crossing profitability. Whichever length produces the highest profit is then the RSI length that is used in the plots, until another length takes its place. This may result in what we deem to be the ‘Optimal RSI’ as it is an adaptive RSI which changes based on performance.
In our next example, we changed the ‘Optimal RSI Type’ from ‘All Crossings’ to ‘Extremity Crossings’. If you compare the last two examples to each other, you’ll notice some similarities, but overall they’re quite different. The reason why is, the Optimal RSI is calculated differently. When using ‘All Crossings’ everytime the RSI and RSI MA cross, we evaluate it for profit (short and long). However, with ‘Extremity Crossings’, we only evaluate it when the RSI crosses over the RSI MA and RSI <= 40 or RSI crosses under the RSI MA and RSI >= 60. We conclude the crossing when it crosses back on its opposite of the extremity, and that is how it finds its Optimal RSI.
The way we determine the Optimal RSI is crucial to calculating which length is currently optimal.
In this next example we have zoomed in a bit, and have the full default settings on. Now we have signals (which you can set alerts for), for when the RSI and RSI MA cross (green is bullish and red is bearish). We also have our Optimal RSI Bollinger Bands enabled here too. These bands allow you to see where there may be Support and Resistance within the RSI at levels that aren’t static; such as 30 and 70. The length the RSI Bollinger Bands use is the Optimal RSI Length, allowing it to likewise change in correlation to the Optimal RSI.
In the example above, we’ve zoomed out as far as the Optimal RSI Bollinger Bands go. You’ll notice, the Bollinger Bands may act as Support and Resistance locations within and outside of the RSI Mid zone (30-70). In the next example we will highlight these areas so they may be easier to see.
Circled above, you may see how many times the Optimal RSI faced Support and Resistance locations on the Bollinger Bands. These Bollinger Bands may give a second location for Support and Resistance. The key Support and Resistance may still be the 30/50/70, however the Bollinger Bands allows us to have a more adaptive, moving form of Support and Resistance. This helps to show where it may ‘bounce’ if it surpasses any of the static levels (30/50/70).
Due to the fact that this Indicator may take a long time to execute and it can throw errors for such, we have added a Setting called: Adjust Optimal RSI Lookback and RSI Count. This settings will automatically modify the Optimal RSI Lookback Length and the RSI Count based on the Time Frame you are on and the Bar Indexes that are within. For instance, if we switch to the 1 Hour Time Frame, it will adjust the length from 200->90 and RSI Count from 30->20. If this wasn’t adjusted, the Indicator would Timeout.
You may however, change the Setting ‘Adjust Optimal RSI Lookback and RSI Count’ to ‘Manual’ from ‘Auto’. This will give you control over the ‘Optimal RSI Lookback Length’ and ‘RSI Count’ within the Settings. Please note, it will likely take some “fine tuning” to find working settings without the Indicator timing out, but there are definitely times you can find better settings than our ‘Auto’ will create; especially on higher Time Frames. The Minimum our ‘Auto’ will create is:
Optimal RSI Lookback Length: 90
RSI Count: 20
The Maximum it will create is:
Optimal RSI Lookback Length: 200
RSI Count: 30
If there isn’t much bar index history, for instance, if you’re on the 1 Day and the pair is BTC/USDT you’ll get < 4000 Bar Indexes worth of data. For this reason it is possible to manually increase the settings to say:
Optimal RSI Lookback Length: 500
RSI Count: 50
But, please note, if you make it too high, it may also lead to inaccuracies.
We will conclude our Tutorial here, hopefully this has given you some insight as to how calculating our Optimal RSI and then using it within Machine Learning may create a more adaptive RSI.
Settings:
Optimal RSI:
Show Crossing Signals: Display signals where the RSI and RSI Cross.
Show Tables: Display Information Tables to show information like, Optimal RSI Length, Best Profit, New Optimal RSI Lookback Length and New RSI Count.
Show Bollinger Bands: Show RSI Bollinger Bands. These bands work like the TDI Indicator, except its length changes as it uses the current RSI Optimal Length.
Optimal RSI Type: This is how we calculate our Optimal RSI. Do we use all RSI and RSI MA Crossings or just when it crosses within the Extremities.
Adjust Optimal RSI Lookback and RSI Count: Auto means the script will automatically adjust the Optimal RSI Lookback Length and RSI Count based on the current Time Frame and Bar Index's on chart. This will attempt to stop the script from 'Taking too long to Execute'. Manual means you have full control of the Optimal RSI Lookback Length and RSI Count.
Optimal RSI Lookback Length: How far back are we looking to see which RSI length is optimal? Please note the more bars the lower this needs to be. For instance with BTC/USDT you can use 500 here on 1D but only 200 for 15 Minutes; otherwise it will timeout.
RSI Count: How many lengths are we checking? For instance, if our 'RSI Minimum Length' is 4 and this is 30, the valid RSI lengths we check is 4-34.
RSI Minimum Length: What is the RSI length we start our scans at? We are capped with RSI Count otherwise it will cause the Indicator to timeout, so we don't want to waste any processing power on irrelevant lengths.
RSI MA Length: What length are we using to calculate the optimal RSI cross' and likewise plot our RSI MA with?
Extremity Crossings RSI Backup Length: When there is no Optimal RSI (if using Extremity Crossings), which RSI should we use instead?
Machine Learning:
Use Rational Quadratics: Rationalizing our Close may be beneficial for usage within ML calculations.
Filter RSI and RSI MA: Should we filter the RSI's before usage in ML calculations? Essentially should we only use RSI data that are of the same type as our Optimal RSI? For instance if our Optimal RSI is Bullish (RSI > RSI MA), should we only use ML RSI's that are likewise bullish?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: SuperTrend Strategy TP/SL [YinYangAlgorithms]The SuperTrend is a very useful Indicator to display when trends have shifted based on the Average True Range (ATR). Its underlying ideology is to calculate the ATR using a fixed length and then multiply it by a factor to calculate the SuperTrend +/-. When the close crosses the SuperTrend it changes direction.
This Strategy features the Traditional SuperTrend Calculations with Machine Learning (ML) and Take Profit / Stop Loss applied to it. Using ML on the SuperTrend allows for the ability to sort data from previous SuperTrend calculations. We can filter the data so only previous SuperTrends that follow the same direction and are within the distance bounds of our k-Nearest Neighbour (KNN) will be added and then averaged. This average can either be achieved using a Mean or with an Exponential calculation which puts added weight on the initial source. Take Profits and Stop Losses are then added to the ML SuperTrend so it may capitalize on Momentum changes meanwhile remaining in the Trend during consolidation.
By applying Machine Learning logic and adding a Take Profit and Stop Loss to the Traditional SuperTrend, we may enhance its underlying calculations with potential to withhold the trend better. The main purpose of this Strategy is to minimize losses and false trend changes while maximizing gains. This may be achieved by quick reversals of trends where strategic small losses are taken before a large trend occurs with hopes of potentially occurring large gain. Due to this logic, the Win/Loss ratio of this Strategy may be quite poor as it may take many small marginal losses where there is consolidation. However, it may also take large gains and capitalize on strong momentum movements.
Tutorial:
In this example above, we can get an idea of what the default settings may achieve when there is momentum. It focuses on attempting to hit the Trailing Take Profit which moves in accord with the SuperTrend just with a multiplier added. When momentum occurs it helps push the SuperTrend within it, which on its own may act as a smaller Trailing Take Profit of its own accord.
We’ve highlighted some key points from the last example to better emphasize how it works. As you can see, the White Circle is where profit was taken from the ML SuperTrend simply from it attempting to switch to a Bullish (Buy) Trend. However, that was rejected almost immediately and we went back to our Bearish (Sell) Trend that ended up resulting in our Take Profit being hit (Yellow Circle). This Strategy aims to not only capitalize on the small profits from SuperTrend to SuperTrend but to also capitalize when the Momentum is so strong that the price moves X% away from the SuperTrend and is able to hit the Take Profit location. This Take Profit addition to this Strategy is crucial as momentum may change state shortly after such drastic price movements; and if we were to simply wait for it to come back to the SuperTrend, we may lose out on lots of potential profit.
If you refer to the Yellow Circle in this example, you’ll notice what was talked about in the Summary/Overview above. During periods of consolidation when there is little momentum and price movement and we don’t have any Stop Loss activated, you may see ‘Signal Flashing’. Signal Flashing is when there are Buy and Sell signals that keep switching back and forth. During this time you may be taking small losses. This is a normal part of this Strategy. When a signal has finally been confirmed by Momentum, is when this Strategy shines and may produce the profit you desire.
You may be wondering, what causes these jagged like patterns in the SuperTrend? It's due to the ML logic, and it may be a little confusing, but essentially what is happening is the Fast Moving SuperTrend and the Slow Moving SuperTrend are creating KNN Min and Max distances that are extreme due to (usually) parabolic movement. This causes fewer values to be added to and averaged within the ML and causes less smooth and more exponential drastic movements. This is completely normal, and one of the perks of using k-Nearest Neighbor for ML calculations. If you don’t know, the Min and Max Distance allowed is derived from the most recent(0 index of data array) to KNN Length. So only SuperTrend values that exhibit distances within these Min/Max will be allowed into the average.
Since the KNN ML logic can cause these exponential movements in the SuperTrend, they likewise affect its Take Profit. The Take Profit may benefit from this movement like displayed in the example above which helped it claim profit before then exhibiting upwards movement.
By default our Stop Loss Multiplier is kept quite low at 0.0000025. Keeping it low may help to reduce some Signal Flashing while not taking extra losses more so than not using it at all. However, if we increase it even more to say 0.005 like is shown in the example above. It can really help the trend keep momentum. Please note, although previous results don’t imply future results, at 0.0000025 Stop Loss we are currently exhibiting 69.27% profit while at 0.005 Stop Loss we are exhibiting 33.54% profit. This just goes to show that although there may be less Signal Flashing, it may not result in more profit.
We will conclude our Tutorial here. Hopefully this has given you some insight as to how Machine Learning, combined with Trailing Take Profit and Stop Loss may have positive effects on the SuperTrend when turned into a Strategy.
Settings:
SuperTrend:
ATR Length: ATR Length used to create the Original Supertrend.
Factor: Multiplier used to create the Original Supertrend.
Stop Loss Multiplier: 0 = Don't use Stop Loss. Stop loss can be useful for helping to prevent false signals but also may result in more loss when hit and less profit when switching trends.
Take Profit Multiplier: Take Profits can be useful within the Supertrend Strategy to stop the price reverting all the way to the Stop Loss once it's been profitable.
Machine Learning:
Only Factor Same Trend Direction: Very useful for ensuring that data used in KNN is not manipulated by different SuperTrend Directional data. Please note, it doesn't affect KNN Exponential.
Rationalized Source Type: Should we Rationalize only a specific source, All or None?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
Machine Learning Smoothing Type: How should we smooth our Fast and Slow ML Datas to be used in our KNN Distance calculation? SMA, EMA or VWMA?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length?? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length?? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: Donchian DCA Grid Strategy [YinYangAlgorithms]This strategy uses a Machine Learning approach on the Donchian Channels with a DCA and Grid purchase/sell Strategy. Not only that, but it uses a custom Bollinger calculation to determine its Basis which is used as a mild sell location. This strategy is a pure DCA strategy in the sense that no shorts are used and theoretically it can be used in webhooks on most exchanges as it’s only using Spot Orders. The idea behind this strategy is we utilize both the Highest Highs and Lowest Lows within a Machine Learning standpoint to create Buy and Sell zones. We then fraction these zones off into pieces to create Grids. This allows us to ‘micro’ purchase as it enters these zones and likewise ‘micro’ sell as it goes up into the upper (sell) zones.
You have the option to set how many grids are used, by default we use 100 with max 1000. These grids can be ‘stacked’ together if a single bar is to go through multiple at the same time. For instance, if a bar goes through 30 grids in one bar, it will have a buy/sell power of 30x. Stacking Grid Buy and (sometimes) Sells is a very crucial part of this strategy that allows it to purchase multitudes during crashes and capitalize on sales during massive pumps.
With the grids, you’ll notice there is a middle line within the upper and lower part that makes the grid. As a Purchase Type within our Settings this is identified as ‘Middle of Zone Purchase Amount In USDT’. The middle of the grid may act as the strongest grid location (aside from maybe the bottom). Therefore there is a specific purchase amount for this Grid location.
This DCA Strategy also features two other purchase methods. Most importantly is its ‘Purchase More’ type. Essentially it will attempt to purchase when the Highest High or Lowest Low moves outside of the Outer band. For instance, the Lowest Low becomes Lower or the Higher High becomes Higher. When this happens may be a good time to buy as it is featuring a new High or Low over an extended period.
The last but not least Purchase type within this Strategy is what we call a ‘Strong Buy’. The reason for this is its verified by the following:
The outer bounds have been pushed (what causes a ‘Purchase More’)
The Price has crossed over the EMA 21
It has been verified through MACD, RSI or MACD Historical (Delta) using Regular and Hidden Divergence (Note, only 1 of these verifications is required and it can be any).
By default we don’t have Purchase Amount for ‘Strong Buy’ set, but that doesn’t mean it can’t be viable, it simply means we have only seen a few pairs where it actually proved more profitable allocating money there rather than just increasing the purchase amount for ‘Purchase More’ or ‘Grids’.
Now that you understand where we BUY, we should discuss when we SELL.
This Strategy features 3 crucial sell locations, and we will discuss each individually as they are very important.
1. ‘Sell Some At’: Here there are 4 different options, by default its set to ‘Both’ but you can change it around if you want. Your options are:
‘Both’ - You will sell some at both locations. The amount sold is the % used at ‘Sell Some %’.
‘Basis Line’ - You will sell some when the price crosses over the Basis Line. The amount sold is the % used at ‘Sell Some %’.
‘Percent’ - You will sell some when the Close is >= X% between the Lower Inner and Upper Inner Zone.
‘None’ - This simply means don’t ever Sell Some.
2. Sell Grids. Sell Grids are exactly like purchase grids and feature the same amount of grids. You also have the ability to ‘Stack Grid Sells’, which basically means if a bar moves multiple grids, it will stack the amount % wise you will sell, rather than just selling the default amount. Sell Grids use a DCA logic but for selling, which we deem may help adjust risk/reward ratio for selling, especially if there is slow but consistent bullish movement. It causes these grids to constantly push up and therefore when the close is greater than them, accrue more profit.
3. Take Profit. Take profit occurs when the close first goes above the Take Profit location (Teal Line) and then Closes below it. When Take Profit occurs, ALL POSITIONS WILL BE SOLD. What may happen is the price enters the Sell Grid, doesn’t go all the way to the top ‘Exiting it’ and then crashes back down and closes below the Take Profit. Take Profit is a strong location which generally represents a strong profit location, and that a strong momentum has changed which may cause the price to revert back to the buy grid zone.
Keep in mind, if you have (by default) ‘Only Sell If Profit’ toggled, all sell locations will only create sell orders when it is profitable to do so. Just cause it may be a good time to sell, doesn’t mean based on your DCA it is. In our opinion, only selling when it is profitable to do so is a key part of the DCA purchase strategy.
You likewise have the ability to ‘Only Buy If Lower than DCA’, which is likewise by default. These two help keep the Yin and Yang by balancing each other out where you’re only purchasing and selling when it makes logical sense too, even if that involves ignoring a signal and waiting for a better opportunity.
Tutorial:
Like most of our Strategies, we try to capitalize on lower Time Frames, generally the 15 minutes so we may find optimal entry and exit locations while still maintaining a strong correlation to trend patterns.
First off, let’s discuss examples of how this Strategy works prior to applying Machine Learning (enabled by default).
In this example above we have disabled the showing of ‘Potential Buy and Sell Signals’ so as to declutter the example. In here you can see where actual trades had gone through for both buying and selling and get an idea of how the strategy works. We also have disabled Machine Learning for this example so you can see the hard lines created by the Donchian Channel. You can also see how the Basis line ‘white line’ may act as a good location to ‘Sell Some’ and that it moves quite irregularly compared to the Donchian Channel. This is due to the fact that it is based on two custom Bollinger Bands to create the basis line.
Here we zoomed out even further and moved back a bit to where there were dense clusters of buy and sell orders. Sometimes when the price is rather volatile you’ll see it ‘Ping Pong’ back and forth between the buy and sell zones quite quickly. This may be very good for your trades and profit as a whole, especially if ‘Only Buy If Lower Than DCA’ and ‘Only Sell If Profit’ are both enabled; as these toggles will ensure you are:
Always lowering your Average when buying
Always making profit when selling
By default 8% commission is added to the Strategy as well, to simulate the cost effects of if these trades were taking place on an actual exchange.
In this example we also turned on the visuals for our ‘Purchase More’ (orange line) and ‘Take Profit’ (teal line) locations. These are crucial locations. The Purchase More makes purchases when the bottom of the grid has been moved (may dictate strong price movement has occurred and may be potential for correction). Our Take Profit may help secure profit when a momentum change is happening and all of the Sell Grids weren’t able to be used.
In the example above we’ve enabled Buy and Sell Signals so that you can see where the Take Profit and Purchase More signals have occurred. The white circle demonstrates that not all of the Position Size was sold within the Sell Grids, and therefore it was ALL CLOSED when the price closed below the Take Profit Line (Teal).
Then, when the bottom of the Donchian Channel was pushed further down due to the close (within the yellow circle), a Purchase More Signal was triggered.
When the close keeps pushing the bottom of the Buy Grid lower, it can cause multiple Purchase More Signals to occur. This is normal and also a crucial part of this strategy to help lower your DCA. Please note, the Purchase More won’t trigger a Buy if the Close is greater than the DCA and you have ‘Only Purchase If Lower Than DCA’ activated.
By turning on Machine Learning (default settings) the Buy and Sell Grid Zones are smoothed out more. It may cause it to look quite a bit different. Machine Learning although it looks much worse, may help increase the profit this Strategy can produce. Previous results DO NOT mean future results, but in this example, prior to turning on Machine Learning it had produced 37% Profit in ~5 months and with Machine Learning activated it is now up to 57% Profit in ~5 months.
Machine Learning causes the Strategy to focus less on Grids and more on Purchase More when it comes to getting its entries. However, if you likewise attempt to focus on Purchase More within non Machine Learning, the locations are different and therefore the results may not be as profitable.
PLEASE NOTE:
By default this strategy uses 1,000,000 as its initial capital. The amount it purchases in its Settings is relevant to this Initial capital. Considering this is a DCA Strategy, we only want to ‘Micro’ Buy and ‘Micro’ Sell whenever conditions are met.
Therefore, if you increase the Initial Capital, you’ll likewise want to increase the Purchase Amounts within the Settings and Vice Versa. For instance, if you wish to set the Initial Capital to 10,000, you should likewise can the amounts in the Settings to 1% of what they are to account for this.
We may change the Purchase Amounts to be based on %’s in a later update if it is requested.
We will conclude this Tutorial here, hopefully you can see how a DCA Grid Purchase Model applied to Machine Learning Donchian Channels may be useful for making strategic purchases in low and high zones.
Settings:
Display Data:
Show Potential Buy Locations: These locations are where 'Potentially' orders can be placed. Placement of orders is dependant on if you have 'Only Buy If Lower Than DCA' toggled and the Price is lower than DCA. It also is effected by if you actually have any money left to purchase with; you can't buy if you have no money left!
Show Potential Sell Locations: These locations are where 'Potentially' orders will be sold. If 'Only Sell If Profit' is toggled, the sell will only happen if you'll make profit from it!
Show Grid Locations: Displaying won't affect your trades but it can be useful to see where trades will be placed, as well as which have gone through and which are left to be purchased. Max 100 Grids, but visuals will only be shown if its 20 or less.
Purchase Settings:
Only Buy if its lower than DCA: Generally speaking, we want to lower our Average, and therefore it makes sense to only buy when the close is lower than our current DCA and a Purchase Condition is met.
Compound Purchases: Compounding Purchases means reinvesting profit back into your trades right away. It drastically increases profits, but it also increases risk too. It will adjust your Purchase Amounts for the Purchase Type you have set at the same % rate of strategy initial_capital to the amounts you have set.
Adjust Purchase Amount Ratio to Maintain Risk level: By adjusting purchase levels we generally help maintain a safe risk level. Basically we generally want to reserve X amount of % for each purchase type being used and relocate money when there is too much in one type. This helps balance out purchase amounts and ensure the types selected have a correct ratio to ensure they can place the right amount of orders.
Stack Grid Buys: Stacking Buy Grids is when the Close crosses multiple Buy Grids within the same bar. Should we still only purchase the value of 1 Buy Grid OR stack the grid buys based on how many buy grids it went through.
Purchase Type: Where do you want to make Purchases? We recommend lowering your risk by combining All purchase types, but you may also customize your trading strategy however you wish.
Strong Buy Purchase Amount In USDT: How much do you want to purchase when the 'Strong Buy' signal appears? This signal only occurs after it has at least entered the Buy Zone and there have been other verifications saying it's now a good time to buy. Our Strong Buy Signal is a very strong indicator that a large price movement towards the Sell Zone will likely occur. It almost always results in it leaving the Buy Zone and usually will go to at least the White Basis line where you can 'Sell Some'.
Buy More Purchase Amount In USDT: How much should you purchase when the 'Purchase More' signal appears? This 'Purchase More' signal occurs when the lowest level of the Buy Zone moves lower. This is a great time to buy as you're buying the dip and generally there is a correction that will allow you to 'Sell Some' for some profit.
Amount of Grid Buy and Sells: How many Grid Purchases do you want to make? We recommend having it at the max of 10, as it will essentially get you a better Average Purchase Price, but you may adjust it to whatever you wish. This amount also only matters if your Purchase Type above incorporates Grid Purchases. Max 100 Grids, but visuals will only be shown if it's 20 or less.
Each Grid Purchase Amount In USDT: How much should you purchase after closing under a grid location? Keep in mind, if you have 10 grids and it goes through each, it will be this amount * 10. Grid purchasing is a great way to get a good entry, lower risk and also lower your average.
Middle Of Zone Purchase Amount In USDT: The Middle Of Zone is the strongest grid location within the Buy Zone. This is why we have a unique Purchase Amount for this Grid specifically. Please note you need to have 'Middle of Zone is a Grid' enabled for this Purchase Amount to be used.
Sell:
Only Sell if its Profit: There is a chance that during a dump, all your grid buys when through, and a few Purchase More Signals have appeared. You likely got a good entry. A Strong Buy may also appear before it starts to pump to the Sell Zone. The issue that may occur is your Average Purchase Price is greater than the 'Sell Some' price and/or the Grids in the Sell Zone and/or the Strong Sell Signal. When this happens, you can either take a loss and sell it, or you can hold on to it and wait for more purchase signals to therefore lower your average more so you can take profit at the next sell location. Please backtest this yourself within our YinYang Purchase Strategy on the pair and timeframe you are wanting to trade on. Please also note, that previous results will not always reflect future results. Please assess the risk yourself. Don't trade what you can't afford to lose. Sometimes it is better to strategically take a loss and continue on making profit than to stay in a bad trade for a long period of time.
Stack Grid Sells: Stacking Sell Grids is when the Close crosses multiple Sell Grids within the same bar. Should we still only sell the value of 1 Sell Grid OR stack the grid sells based on how many sell grids it went through.
Stop Loss Type: This is when the Close has pushed the Bottom of the Buy Grid More. Do we Stop Loss or Purchase More?? By default we recommend you stay true to the DCA part of this strategy by Purchasing More, but this is up to you.
Sell Some At: Where if selected should we 'Sell Some', this may be an important way to sell a little bit at a good time before the price may correct. Also, we don't want to sell too much incase it doesn't correct though, so its a 'Sell Some' location. Basis Line refers to our Moving Basis Line created from 2 Bollinger Bands and Percent refers to a Percent difference between the Lower Inner and Upper Inner bands.
Sell Some At Percent Amount: This refers to how much % between the Lower Inner and Upper Inner bands we should well at if we chose to 'Sell Some'.
Sell Some Min %: This refers to the Minimum amount between the Lower Inner band and Close that qualifies a 'Sell Some'. This acts as a failsafe so we don't 'Sell Some' for too little.
Sell % At Strong Sell Signal: How much do we sell at the 'Strong Sell' Signal? It may act as a strong location to sell, but likewise Grid Sells could be better.
Grid and Donchian Settings:
Donchian Channel Length: How far back are we looking back to determine our Donchian Channel.
Extra Outer Buy Width %: How much extra should we push the Outer Buy (Low) Width by?
Extra Inner Buy Width %: How much extra should we push the Inner Buy (Low) Width by?
Extra Inner Sell Width %: How much extra should we push the Inner Sell (High) Width by?
Extra Outer Sell Width %: How much extra should we push the Outer Sell (High) Width by?
Machine Learning:
Rationalized Source Type: Donchians usually use High/Low. What Source is our Rationalized Source using?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length?? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length?? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: Trend Lines [YinYangAlgorithms]Trend lines have always been a key indicator that may help predict many different types of price movements. They have been well known to create different types of formations such as: Pennants, Channels, Flags and Wedges. The type of formation they create is based on how the formation was created and the angle it was created. For instance, if there was a strong price increase and then there is a Wedge where both end points meet, this is considered a Bull Pennant. The formations Trend Lines create may be powerful tools that can help predict current Support and Resistance and also Future Momentum changes. However, not all Trend Lines will create formations, and alone they may stand as strong Support and Resistance locations on the Vertical.
The purpose of this Indicator is to apply Machine Learning logic to a Traditional Trend Line Calculation, and therefore allowing a new approach to a modern indicator of high usage. The results of such are quite interesting and goes to show the impacts a simple KNN Machine Learning model can have on Traditional Indicators.
Tutorial:
There are a few different settings within this Indicator. Many will greatly impact the results and if any are changed, lots will need ‘Fine Tuning’. So let's discuss the main toggles that have great effects and what they do before discussing the lengths. Currently in this example above we have the Indicator at its Default Settings. In this example, you can see how the Trend Lines act as key Support and Resistance locations. Due note, Support and Resistance are a relative term, as is their color. What starts off as Support or Resistance may change when the price crosses over / under them.
In the example above we have zoomed in and circled locations that exhibited markers of Support and Resistance along the Trend Lines. These Trend Lines are all created using the Default Settings. As you can see from the example above; just because it is a Green Upwards Trend Line, doesn’t mean it’s a Support Line. Support and Resistance is always shifting on Trend Lines based on the prices location relative to them.
We won’t go through all the Formations Trend Lines make, but the example above, we can see the Trend Lines formed a Downward Channel. Channels are when there are two parallel downwards Trend Lines that are at a relatively similar angle. This means that they won’t ever meet. What may happen when the price is within these channels, is it may bounce between the upper and lower bounds. These Channels may drive the price upwards or downwards, depending on if it is in an Upwards or Downwards Channel.
If you refer to the example above, you’ll notice that the Trend Lines are formed like traditional Trend Lines. They don’t stem from current Highs and Lows but rather Machine Learning Highs and Lows. More often than not, the Machine Learning approach to Trend Lines cause their start point and angle to be quite different than a Traditional Trend Line. Due to this, it may help predict Support and Resistance locations at are more uncommon and therefore can be quite useful.
In the example above we have turned off the toggle in Settings ‘Use Exponential Data Average’. This Settings uses a custom Exponential Data Average of the KNN rather than simply averaging the KNN. By Default it is enabled, but as you can see when it is disabled it may create some pretty strong lasting Trend Lines. This is why we advise you ZOOM OUT AS FAR AS YOU CAN. Trend Lines are only displayed when you’ve zoomed out far enough that their Start Point is visible.
As you can see in this example above, there were 3 major Upward Trend Lines created in 2020 that have had a major impact on Support and Resistance Locations within the last year. Lets zoom in and get a closer look.
We have zoomed in for this example above, and circled some of the major Support and Resistance locations that these Upward Trend Lines may have had a major impact on.
Please note, these Machine Learning Trend Lines aren’t a ‘One Size Fits All’ kind of thing. They are completely customizable within the Settings, so that you can get a tailored experience based on what Pair and Time Frame you are trading on.
When any values are changed within the Settings, you’ll likely need to ‘Fine Tune’ the rest of the settings until your desired result is met. By default the modifiable lengths within the Settings are:
Machine Learning Length: 50
KNN Length:5
Fast ML Data Length: 5
Slow ML Data Length: 30
For example, let's toggle ‘Use Exponential Data Averages’ back on and change ‘Fast ML Data Length’ from 5 to 20 and ‘Slow ML Data Length’ from 30 to 50.
As you can in the example above, all of the lines have changed. Although there are still some strong Support Locations created by the Upwards Trend Lines.
We will conclude our Tutorial here. Hopefully you’ve learned how to use Machine Learning Trend Lines and will be able to now see some more unorthodox Support and Resistance locations on the Vertical.
Settings:
Use Machine Learning Sources: If disabled Traditional Trend line sources (High and Low) will be used rather than Rational Quadratics.
Use KNN Distance Sorting: You can disable this if you wish to not have the Machine Learning Data sorted using KNN. If disabled trend line logic will be Traditional.
Use Exponential Data Average: This Settings uses a custom Exponential Data Average of the KNN rather than simply averaging the KNN.
Machine Learning Length: How strong is our Machine Learning Memory? Please note, when this value is too high the data is almost 'too' much and can lead to poor results.
K-Nearest Neighbour (KNN) Length: How many K-Nearest Neighbours are allowed with our Distance Clustering? Please note, too high or too low may lead to poor results.
Fast ML Data Length: Fast and Slow speed needs to be adjusted properly to see results. 3/5/7 all seem to work well for Fast.
Slow ML Data Length: Fast and Slow speed needs to be adjusted properly to see results. 20 - 50 all seem to work well for Slow.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: MFI Heat Map [YinYangAlgorithms]Overview:
MFI Heat Maps are a visually appealing way to display the values of 29 different MFIs at the same time while being able to make sense of it. Each plot within the Indicator represents a different MFI value. The higher you get up, the longer the length that was used for this MFI. This Indicator also features the use of Machine Learning to help balance the MFI levels. It doesn’t solely rely upon Machine Learning but instead incorporates a growing length MFI averaged with the Machine Learning MFI at any given index.
For instance, say we are calculating the 10th plot from the bottom, the MFI would be an average of:
MFI(source, 11)
Machine Learning MFI at Index of 10
We do it this way as they both help smooth each other out without relying solely on just one calculation method.
Due to plot limitations, you are capped at 28 Plot Amounts within this indicator, but that is still quite a bit of information you can glean from a Heat Map.
The Machine Learning used in this indicator is of the K-Nearest Neighbor (KNN). It uses a Fast and Slow MFI calculation then sorts through them over Machine Learning Length and calculates the differences between them. It then slices off KNN length to create our Max/Min Distances allotted. It adds the average between Fast and Slow MFIs to a Viable Distances array if their distances are within the KNN Min/Max distance. It then averages all distances in the Viable Distances array and returns the result.
The result of the KNN Function is saved to another ML Data array whose length is that of Plot Amount (Heat Map Size). This way each Index of the ML Data array can be indexed according to the Heat Map Size.
The Average of the ML Data array is the MFI line (white) that you’ll see plotted on the Indicator. There is also the SMA of the MFI Average (orange) which is likewise plotted. These plots allow you to visualize where the ML MFI is sitting and can potentially be useful for seeing when the MFI Average and SMA cross over and under each other.
We’ve heard many people talk highly of RSI, but sadly not too many even refer to MFI. MFI oftentimes may be overlooked, especially with new traders who may not even know what it is. Essentially MFI is an RSI but it also incorporates Volume into its calculations, which in our opinion leads to a more accurate reading; afterall, what is price movement without Volume.
Tutorial:
You may be thinking, this Indicator looks appealing to the eye, but how do I benefit from it trading wise?
Before we get into our visual examples, let's talk briefly about what makes Heat Maps in general a useful tool for trading. Heat Maps give us the ability to visualize and understand lots of data while removing the clutter. We can understand the data of 29 different MFIs without having to look at and decipher 29 different MFI plots. When you overlay too many MFI lines on top of each other, they can be very difficult to read and oftentimes end up actually hindering your Technical Analysis. For this reason, we have a simple solution to this problem; Heat Maps. This MFI Heat Map allows you to easily know (in a relative %) what the MFI level is for varying lengths. For Instance, the First (bottom) plot indexes an MFI of (K(0) (loop of Plot Amount) + Smoothing Length (default 1)) = 1. Since this is indexing (usually) a very low length, it will change much quicker. Whereas the Last (top) plot indexes an MFI of (K(27) (loop of Plot Amount) + Smoothing Length (default 1)) = 28. This is indexing a much higher length of MFI which results in the MFI the higher you go up in the Heat Map to move much slower.
Heat Maps give us the ability to see changes happening over multiple MFIs at the same time, which can be very useful for seeing shifts in MFI / Momentum. Remember, MFI incorporates Volume, so even if the price goes up a lot, if there was low volume, the MFI won’t move as much as an RSI would. However, likewise, if there is high volume but low price movement, the MFI will move slightly more than the RSI.
Heat Maps change color based on their MFI level. If the MFI is >= 90 it is HOT (red), if the MFI <= 9 it is COLD (teal, think of ICE). Green represents an MFI of 50-59 and Dark Blue represents an MFI of 40-49. Green and Dark blue are the most common colors as all the others are more ‘Extreme’ MFI levels.
Okay, time to get to the Examples :
Since there is so much going on in Heat Maps, we’ve decided to focus this tutorial to this specific area and talk about individual locations before talking about it as a whole.
If you refer to the example above where there are 2 white circles; these white circles are highlighting a key location you’ll be wanting to identify within your Heat Maps, many things are happening here:
The MFI crossed over the SMA (bullish).
The Heat Map started changing from mid/dark Blue (30-50 MFI) to Green (50-59 MFI) around the midline (the 50% dashed like).
The Lower levels of the Heat Map are turning Yellow/Orange/Red (60-100 MFI).
The Upper Levels of the Heat Map are still Light Blue - Green (10-50 MFI).
The 4 Key points above, all point towards potential Bullish Momentum changes. You’re likely wondering, but why? Let's discuss about each one in more specific detail:
1. The MFI crossed over the SMA (bullish): What this tells us is that the current MFI Average is now greater than its average over the last (default) 16 bars. This means there's been a large amount of Money Flow (Price and Volume) recently (subjectively based on the last (default) 16 average). This is one of the leading Bullish / Bearish signals you will see within this Indicator. You can enable Signals within the Settings and/or even add Alerts for when these crossings occur.
2. The Heat Map started changing from mid/dark Blue (30-50 MFI) to Green (50-59 MFI) around the midline (the 50% dashed like): This shows us that the index’s in the mid (if using all 28 heat map plots it would be at 14) has already received some of this momentum change. If you look at the second white circle (right), you’ll also notice the higher MFI plot indexes are also green. This is because since their length is long they still have some momentum and strength from the first white circle (left). Just because the first white circle failed in its bullish push, doesn’t mean it didn’t achieve momentum that would later on help to push the price up.
3. The Lower levels of the Heat Map are turning Yellow/Orange/Red (60-100 MFI): It occurred somewhat in the left white circle, but mainly in the right white circle. This shows us the MFI is very high on the lower lengths, this may lead to the current, middle and higher length MFIs following suit soon. Remember it has to work its way up, the higher levels can’t go red unless the lower levels go red first and the higher levels can also lag quite a bit behind and take awhile to catch up, this is normal, expected and meant to happen. Vice versa is also true with getting higher levels to go cold (light teal (think of ICE)).
4. The Upper Levels of the Heat Map are still Light Blue - Green (10-50 MFI): You might think at first that this is a bad thing, but it's not! Remember you want to be Fearful when others are Greedy and Greedy when others are Fearful! You don’t want to buy when the higher levels have a high MFI, you want to buy when you see the momentum pushing up in the lower MFI levels (getting yellow/orange/red in the low levels) while it is still Cold in the higher levels (BLUE OR GREEN, nothing higher than green as it is already slightly too high). There will be many times that it is Yellow or possibly Orange in the high levels and the bullish push still happens, but this is much more risky! The key to trading is to minimize risks while maximizing potential.
Hopefully now you’re getting an idea of how to spot potential bullish momentum changes, but what about bearish momentum changes? Technically they are the exact opposite, so we don’t need to go into as much detail, but lets still take a look at a few examples:
In the example above we marked the 3 times where it was displaying overly bullish characteristics. We marked the bullish momentum occurring with arrows. If you look closely at the start of the arrow to where it finishes, you’ll notice how the heat (HOT)(RED) works its way up from the lower levels to the higher levels. We then see the MFI to SMA cross under. In all 3 of these examples the heat made it all the way to the top of the chart. These are all very bearish signals that represent a bearish momentum movement that may occur soon.
Also, please note, the level the MFI is at DOES matter! That line isn’t there simply for you to see when there are crosses over and under. The MFI is considered to be Overbought when it is greater than 70 (the upper white dashed line, it is just formatted to be on a different scale cause there are 28 plots, but it represents 70). The MFI is considered to be Oversold when it is less than 30 (the lower white dashed line).
If we look to the left a little here where a big drop in price occurred shortly after our MFI and SMA crossed, would we have been able to identify it using the Heat Maps? Likely, No. There was some color change in the lower levels a few bars prior that went yellow/orange/red but before this cross happened they all went back to Dark Blue. In the middle section when the cross happened it was only Green and Yellow and in the upper section we are Blue. This would be a very risky trade to go on as the only real Bearish Indication was the MFI to SMA cross under. Remember, you want to reduce risk, you don’t want to simply trade on everytime the MFI and SMA cross each other or you’ll be getting yourself into many risky trades based on false signals.
Based on what you’ve learned above, can you see the signs that are indicating where this white circle may have potential for a bullish momentum change?
Now that we are more zoomed in, you may also be noticing there are colors to the price bars. This can be disabled in the settings, but just so you know what they mean, let’s zoom in a little more and talk about it.
We’ve condensed the Indicator a bit so you can see the bars better here. The colors that are displayed on these bars are the Heat Map value for your MFI (the white line in the Indicator). This way you can better see when the Price is Hot and Cold. As you may see while looking, the colors generally go from cold to hot when bullish momentum is happening and hot to cold when bearish momentum is happening. We don’t recommend solely looking at the bars as indicators to MFI momentum change, as seeing the Heat Map will give you much more data; however it can be nice to see the Heat Map projected on the bars rather than trying to eyeball it yourself or hover over each bar specifically to see their levels.
We will conclude our Tutorial here. Hopefully this has given you some insight to how useful Heat Maps can be and why it works well with a Machine Learning (KNN) Model applied to the MFI.
PLEASE NOTE: You can adjust the line width for the Heat Map within the settings. If you condense the Indicator a lot or have a small screen, likely use a length of 1-2. If you have it stretched out or a large screen, a length of 2-3 will work nice. You just don’t want to have the lines overlapping or it defeats the purpose of a Heat Map. Also, the bigger the linewidth, generally you’ll want to increase the Transparency within the Settings also as it can get quite bright and hurt your eyes over time.
Settings:
MFI:
Show MFI and SMA Crossing Signals: MFI and SMA Crossing is one of the leading Bullish and Bearish Signals in this Indicator. You can also add alerts for these signals.
Plot Amount: How many plots are used in this Heat Map. (2 - 28).
Source: The Source to use in all MFI calculations.
Smooth Initial MFI Length: How much to smooth the Fast and Slow MFI calculation by. 1 = No smoothing.
MFI SMA Length: What length we smooth the MFI Average over to get our MFI SMA.
Machine Learning:
Average MFI data by adding a lookback to the Source: While populating our Heat Map with the MFI's, should use use the Source each MFI Length increase or should we also lookback a Source each MFI Length Increase.
KNN Distance Requirement: To be a valid KNN, it needs to abide by a Distance calculation. Generally only Max is used, but you can change it if it suits your trading style better.
Machine Learning Length: How much ML data should we store? The longer the length generally the smoother the result; which may not be as accurate for something like a Heat Map, so keeping this relatively low may lead to more accurate results.
KNN Length: How many KNN are used in the slice to calculate max/min distance allowed.
Fast Length: Fast MFI length used in KNN to calculate distances by comparing its distance with the Slow MFI Length.
Slow Length: Slow MFI length used in KNN to calculate distances by comparing its distance with the Fast MFI Length.
Smoothing Length: When populating our Heat Map, at what length do we start our MFI calculations with (A Higher value with result in a slower and more smoothed MFI / Heat Map).
Colors:
Change Bar Color: Change bar colors to MFI Avg Color.
Heat Map Transparency: If there isn't any transparency it can be a little hard on the eyes. The Greater the Line Width, generally the more transparency you'll want for your eyes.
Line Width: Set how wide the Heat Map lines are
MFI 90-100 Color: Color when the MFI is between these levels.
MFI 80-89 Color: Color when the MFI is between these levels.
MFI 70-79 Color: Color when the MFI is between these levels.
MFI 60-69 Color: Color when the MFI is between these levels.
MFI 50-59 Color: Color when the MFI is between these levels.
MFI 40-49 Color: Color when the MFI is between these levels.
MFI 30-39 Color: Color when the MFI is between these levels.
MFI 20-29 Color: Color when the MFI is between these levels.
MFI 10-19 Color: Color when the MFI is between these levels.
MFI 0-100 Color: Color when the MFI is between these levels.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Machine Learning: Support and Resistance [YinYangAlgorithms]Overview:
Support and Resistance is normally based upon Pivot Points and Highest Highs and Lowest Lows. Many times coders even incorporate Volume, RSI and other factors into the equation. However there may be a downside to doing a pure technical approach based on historical levels. We live in a time where Machine Learning is becoming more and more used; thus we have decided to create a Machine Learning Support and Resistance Projection based Indicator. Rather than using traditional Support and Resistance calculations using historical data, we have taken a rather different approach. This Indicator instead attempts to Predict and Project where Support and Resistance locations will be based on a Machine Learning Model using a form of KNN (k-Nearest Neighbors).
Since this indicator creates a Projection of where it deems Support and Resistance will be, it has the ability to move its Support and Resistance before the price even gets to it if it believes it will surpass its projections. This may create a more accurate placement of Support and Resistance as they’re not based on historical levels.
This Indicator does not Repaint.
How it works:
This Indicator makes its projections based on the source you provide (by default close) of the previous bar and submits the source, RSI and EMA to our Projection Function to get its projection of the current bar.
The Projection function essentially calculates potential movement after finding the differences between the source the MA from the current bar, previous bar and average over the span of Machine Learning Length.
Potential movement is defined as:
Average Difference + Average(Machine Learning Average, Average Last Distance)
Average Difference: (Absolute value of Current Source - Current MA) - (Absolute value of Machine Learning Average - Machine Learning MA)
Average Last Distance: Average(Current Source - Current MA, Previous Source - Previous MA)
It then predicts the next bars directional movement (bullish or bearish bar) using several factors:
Previous Source > Previous MA
Current Source - Current MA > Average Source - Average MA
Current RSI > Previous RSI
Current RSI > 30 and Previous RSI <= 30
Current RSI < 70 and Previous RSI >= 70
This helps us to predict the direction the next bar may move.
We then calculate a multiplier that we apply to our Potential Movement value to get our final result which is our Current Bars Close Projection.
Our multiplier is calculated using:
(Current RSI > 30 and Previous RSI <= 30) OR (Current RSI < 70 and Previous RSI >= 70)
Current Source - Current MA > Previous Source - Previous MA
We then create an array and fill it with the previous X projections (Machine Learning Length) and send it to another function. This function, if told to, will sort the data accordingly and then output the KNN average of the length given.
We calculate and plot various KNN lengths to create different Zones:
Strong Support: Length of 2 but sort the data Ascending (low to high)
Strong Resistance: Length of 2 but sort the data Descending (high to low)
Support: Length of Machine Length Length / 10 or Min of 2 sorted by Ascending
Resistance: Length of Machine Length Length / 10 or Min of 2 sorted by Descending
There are also 4 other plots you may be wondering what they are, there is your AVG, VWMA, Long Term Memory and Current Projection.
By default your Current Projection is disabled in settings but you can enable it if you are curious to see how the projections for each close are calculated. It is, however, not a crucial point of interest (white line).
The average is simply the average value of the Machine Learning Data (purple line).
The VWMA is a VWMA calculation applied to our Data over a length specified in settings (by default 1)(blue line). The VWMA is crucial when combined with the Avg as they can cross over and under each other. These crosses represent potential Bullish and Bearish zones.
Lastly, but certainly not least, we have the Long Term Memory (maroon line). The Long Term Memory can be displayed either as an ‘Average’, ‘Hard Line’ or ‘None’. The Long Term Average is only updated every Machine Learning Length Bar Index’s and is populated with the average of the Machine Learning Data. For Instance, if Machine Learning Length is set to 100, the Long Term Memory is only updated every 100 bars, and since its length is the same as the Machine Learning Length, that means its data is composed of 10,000 bars worth of data. The Long Term Memory may be very beneficial for determining where Support and Resistance lie over the Long Term within a Machine Learning Algorithm. When set to ‘Average’ it plots the connection lines diagonally, and although they may be more visually appealing, they’re less useful when it comes to actually seeing support and resistance as generally speaking, support and resistance lie on the horizontal. When set to ‘Hard Line’ the Long Term Memory is connected with hard lines and holds the price value until the next time it is updated. This makes it much more useful for potentially identifying Support and Resistance.
Tutorial:
Here is an overview of what the Indicator looks like, now let's start to dissect it.
In the example above we can see how all of the lines between the Major Support and Resistance zones may act as BOTH Support and Resistance depending on which side the price is currently on. In the circle on the left, we can see how it can fluctuate between the two. If you look at the circle on the right, we can see how the Average line acts as a strong support before it fails to maintain it. Generally speaking, most Support and Resistance locations may potentially fail to hold after 3 tests, as the Average did in this example.
As you can see, the Support and Resistance doesn’t wait to be tested before adjusting, which is why there are 2 lines which create their zones. The inner line is the Support/Resistance and the outer line is the Strong Support/Resistance. The Yellow Circle shows the inner line was able to calculate the moving resistance correctly and then adjusted accordingly as it was projecting the price to keep increasing. However, if you look at the White Circle, you can see that since there was first a crash, and then parabolic movement, that the inner zone could not move and predict the resistance as well as the outer zone could.
We consider the price to be ‘Overvalued’ when it is above the VWMA (blue line) and ‘Undervalued’ when it is below the VWMA. It is considered ‘fair’ price when it is within the VWMA to Average zone (between the blue and purple lines). If you look at the example above, you’ll notice where the two yellow circles are, it is not only considered ‘Overvalued’, but it then proceeds to ride the inner resistance line upwards. This is common when the market is overly bullish and vice versa when it is bearish. Please keep in mind, although it is common, it doesn’t mean a correction can’t happen.
In this example above we look at the last bull run that may have started due to the halving. This bull run was very bullish as you can see in the example above. The price was constantly sitting within the Resistance Zone and the VWMA that was very close to it was constantly acting as a Support. Naturally, due to the Algorithm used in this Indicator, as the momentum starts to slow down, the VWMA (blue line) will start to space out more and more from the Resistance Zone. This doesn’t mean the momentum is gone, it just means it may be slowing down.
Unfortunately we have to study the Bear Market with a different perspective than the Bull Market. However, there are still some similarities within the two. If you refer to the example above and the previous example, you can clearly see that the Bull Market loves to stay with the Resistance Zone and use the VWMA as a Support. However, the Bear Market does not. This is a normal occurrence, however we can see from the example above you may see a correction / horizontal movement when the Outer Support Line is touched. If you look at all 3 yellow circles, the Outer Support Line was touched, then either a small correction or horizontal consolidation occurred.
We will conclude our Tutorial here, hopefully you’ll be able to benefit from a moving Support and Resistance calculated with Machine Learning that projects its locations, rather than using traditional calculations.
Settings:
Source: This source is the base for all our calculations
Machine Learning Length: How much projection data are we storing and using to make calculations.
Smoothing Length: We need to smooth calculations such as RSI, EMA and VWMA. What length are we smoothing it with?
VWMA ML Projection Length: How far into our Machine Learning data should we average for our VWMA. Please note the 'Smoothing Length' is still applied here after getting the Projection Average.
Long Term Memory: Long term memory has the same storage length but is only updated once per Machine Learning Length. For instance, if Machine Learning Length is 100, it will save the Average of our data once every 100 bars. This means its memory is an average of 10,000 bars of Machine Learning. 'Average' connects its values diagonally whereas 'Hard Line' holds its value until it changes.
Use Average Last Distance In Potential Movement: This can help accuracy but generally also displaces the Support and Resistance by projecting it further.
Show Current Projection: Projections occur for each bar, and our Machine Learning utilizes these projections by storing and evaluating them. This toggle will display the Current Projection Line which is used to create all our Projections.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
AI Momentum [YinYang]Overview:
AI Momentum is a kernel function based momentum Indicator. It uses Rational Quadratics to help smooth out the Moving Averages, this may give them a more accurate result. This Indicator has 2 main uses, first it displays ‘Zones’ that help you visualize the potential movement areas and when the price is out of bounds (Overvalued or Undervalued). Secondly it creates signals that display the momentum of the current trend.
The Zones are composed of the Highest Highs and Lowest lows turned into a Rational Quadratic over varying lengths. These create our Rational High and Low zones. There is however a second zone. The second zone is composed of the avg of the Inner High and Inner Low zones (yellow line) and the Rational Quadratic of the current Close. This helps to create a second zone that is within the High and Low bounds that may represent momentum changes within these zones. When the Rationalized Close crosses above the High and Low Zone Average it may signify a bullish momentum change and vice versa when it crosses below.
There are 3 different signals created to display momentum:
Bullish and Bearish Momentum. These signals display when there is current bullish or bearish momentum happening within the trend. When the momentum changes there will likely be a lull where there are neither Bullish or Bearish momentum signals. These signals may be useful to help visualize when the momentum has started and stopped for both the bulls and the bears. Bullish Momentum is calculated by checking if the Rational Quadratic Close > Rational Quadratic of the Highest OHLC4 smoothed over a VWMA. The Bearish Momentum is calculated by checking the opposite.
Overly Bullish and Bearish Momentum. These signals occur when the bar has Bullish or Bearish Momentum and also has an Rationalized RSI greater or less than a certain level. Bullish is >= 57 and Bearish is <= 43. There is also the option to ‘Factor Volume’ into these signals. This means, the Overly Bullish and Bearish Signals will only occur when the Rationalized Volume > VWMA Rationalized Volume as well as the previously mentioned factors above. This can be useful for removing ‘clutter’ as volume may dictate when these momentum changes will occur, but it can also remove some of the useful signals and you may miss the swing too if the volume just was low. Overly Bullish and Bearish Momentum may dictate when a momentum change will occur. Remember, they are OVERLY Bullish and Bearish, meaning there is a chance a correction may occur around these signals.
Bull and Bear Crosses. These signals occur when the Rationalized Close crosses the Gaussian Close that is 2 bars back. These signals may show when there is a strong change in momentum, but be careful as more often than not they’re predicting that the momentum may change in the opposite direction.
Tutorial:
As we can see in the example above, generally what happens is we get the regular Bullish or Bearish momentum, followed by the Rationalized Close crossing the Zone average and finally the Overly Bullish or Bearish signals. This is normally the order of operations but isn’t always how it happens as sometimes momentum changes don’t make it that far; also the Rationalized Close and Zone Average don’t follow any of the same math as the Signals which can result in differing appearances. The Bull and Bear Crosses are also quite sporadic in appearance and don’t generally follow any sort of order of operations. However, they may occur as a Predictor between Bullish and Bearish momentum, signifying the beginning of the momentum change.
The Bull and Bear crosses may be a Predictor of momentum change. They generally happen when there is no Bullish or Bearish momentum happening; and this helps to add strength to their prediction. When they occur during momentum (orange circle) there is a less likely chance that it will happen, and may instead signify the exact opposite; it may help predict a large spike in momentum in the direction of the Bullish or Bearish momentum. In the case of the orange circle, there is currently Bearish Momentum and therefore the Bull Cross may help predict a large momentum movement is about to occur in favor of the Bears.
We have disabled signals here to properly display and talk about the zones. As you can see, Rationalizing the Highest Highs and Lowest Lows over 2 different lengths creates inner and outer bounds that help to predict where parabolic movement and momentum may move to. Our Inner and Outer zones are great for seeing potential Support and Resistance locations.
The secondary zone, which can cross over and change from Green to Red is also a very important zone. Let's zoom in and talk about it specifically.
The Middle Zone Crosses may help deduce where parabolic movement and strong momentum changes may occur. Generally what may happen is when the cross occurs, you will see parabolic movement to the High / Low zones. This may be the Inner zone but can sometimes be the outer zone too. The hard part is sometimes it can be a Fakeout, like displayed with the Blue Circle. The Cross doesn’t mean it may move to the opposing side, sometimes it may just be predicting Parabolic movement in a general sense.
When we turn the Momentum Signals back on, we can see where the Fakeout occurred that it not only almost hit the Inner Low Zone but it also exhibited 2 Overly Bearish Signals. Remember, Overly bearish signals mean a momentum change in favor of the Bulls may occur soon and overly Bullish signals mean a momentum change in favor of the Bears may occur soon.
You may be wondering, well what does “may occur soon” mean and how do we tell?
The purpose of the momentum signals is not only to let you know when Momentum has occurred and when it is still prevalent. It also matters A LOT when it has STOPPED!
In this example above, we look at when the Overly Bullish and Bearish Momentum has STOPPED. As you can see, when the Overly Bullish or Bearish Momentum stopped may be a strong predictor of potential momentum change in the opposing direction.
We will conclude our Tutorial here, hopefully this Indicator has been helpful for showing you where momentum is occurring and help predict how far it may move. We have been dabbling with and are planning on releasing a Strategy based on this Indicator shortly.
Settings:
1. Momentum:
Show Signals: Sometimes it can be difficult to visualize the zones with signals enabled.
Factor Volume: Factor Volume only applies to Overly Bullish and Bearish Signals. It's when the Volume is > VWMA Volume over the Smoothing Length.
Zone Inside Length: The Zone Inside is the Inner zone of the High and Low. This is the length used to create it.
Zone Outside Length: The Zone Outside is the Outer zone of the High and Low. This is the length used to create it.
Smoothing length: Smoothing length is the length used to smooth out our Bullish and Bearish signals, along with our Overly Bullish and Overly Bearish Signals.
2. Kernel Settings:
Lookback Window: The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars. Recommended range: 3-50.
Relative Weighting: Relative weighting of time frames. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel. Recommended range: 0.25-25.
Start Regression at Bar: Bar index on which to start regression. The first bars of a chart are often highly volatile, and omission of these initial bars often leads to a better overall fit. Recommended range: 5-25.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Relational Quadratic Kernel Channel [Vin]The Relational Quadratic Kernel Channel (RQK-Channel-V) is designed to provide more valuable potential price extremes or continuation points in the price trend.
Example:
Usage:
Lookback Window: Adjust the "Lookback Window" parameter to control the number of previous bars considered when calculating the Rational Quadratic Estimate. Longer windows capture longer-term trends, while shorter windows respond more quickly to price changes.
Relative Weight: The "Relative Weight" parameter allows you to control the importance of each data point in the calculation. Higher values emphasize recent data, while lower values give more weight to historical data.
Source: Choose the data source (e.g., close price) that you want to use for the kernel estimate.
ATR Length: Set the length of the Average True Range (ATR) used for channel width calculation. A longer ATR length results in wider channels, while a shorter length leads to narrower channels.
Channel Multipliers: Adjust the "Channel Multiplier" parameters to control the width of the channels. Higher multipliers result in wider channels, while lower multipliers produce narrower channels. The indicator provides three sets of channels, each with its own multiplier for flexibility.
Details:
Rational Quadratic Kernel Function:
The Rational Quadratic Kernel Function is a type of smoothing function used to estimate a continuous curve or line from discrete data points. It is often used in time series analysis to reduce noise and emphasize trends or patterns in the data.
The formula for the Rational Quadratic Kernel Function is generally defined as:
K(x) = (1 + (x^2) / (2 * α * β))^(-α)
Where:
x represents the distance or difference between data points.
α and β are parameters that control the shape of the kernel. These parameters can be adjusted to control the smoothness or flexibility of the kernel function.
In the context of this indicator, the Rational Quadratic Kernel Function is applied to a specified source (e.g., close prices) over a defined lookback window. It calculates a smoothed estimate of the source data, which is then used to determine the central value of the channels. The kernel function allows the indicator to adapt to different market conditions and reduce noise in the data.
The specific parameters (length and relativeWeight) in your indicator allows to fine-tune how the Rational Quadratic Kernel Function is applied, providing flexibility in capturing both short-term and long-term trends in the data.
To know more about unsupervised ML implementations, I highly recommend to follow the users, @jdehorty and @LuxAlgo
Optimizing the parameters:
Lookback Window (length): The lookback window determines how many previous bars are considered when calculating the kernel estimate.
For shorter-term trading strategies, you may want to use a shorter lookback window (e.g., 5-10).
For longer-term trading or investing, consider a longer lookback window (e.g., 20-50).
Relative Weight (relativeWeight): This parameter controls the importance of each data point in the calculation.
A higher relative weight (e.g., 2 or 3) emphasizes recent data, which can be suitable for trend-following strategies.
A lower relative weight (e.g., 1) gives more equal importance to historical and recent data, which may be useful for strategies that aim to capture both short-term and long-term trends.
ATR Length (atrLength): The length of the Average True Range (ATR) affects the width of the channels.
Longer ATR lengths result in wider channels, which may be suitable for capturing broader price movements.
Shorter ATR lengths result in narrower channels, which can be helpful for identifying smaller price swings.
Channel Multipliers (channelMultiplier1, channelMultiplier2, channelMultiplier3): These parameters determine the width of the channels relative to the ATR.
Adjust these multipliers based on your risk tolerance and desired channel width.
Higher multipliers result in wider channels, which may lead to fewer signals but potentially larger price movements.
Lower multipliers create narrower channels, which can result in more frequent signals but potentially smaller price movements.
Machine Learning Momentum Oscillator [ChartPrime]The Machine Learning Momentum Oscillator brings together the K-Nearest Neighbors (KNN) algorithm and the predictive strength of the Tactical Sector Indicator (TSI) Momentum. This unique oscillator not only uses the insights from TSI Momentum but also taps into the power of machine learning therefore being designed to give traders a more comprehensive view of market momentum.
At its core, the Machine Learning Momentum Oscillator blends TSI Momentum with the capabilities of the KNN algorithm. Introducing KNN logic allows for better handling of noise in the data set. The TSI Momentum is known for understanding how strong trends are and which direction they're headed, and now, with the added layer of machine learning, we're able to offer a deeper perspective on market trends. This is a fairly classical when it comes to visuals and trading.
Green bars show the trader when the asset is in an uptrend. On the flip side, red bars mean things are heading down, signaling a bearish movement driven by selling pressure. These color cues make it easier to catch the sentiment and direction of the market in a glance.
Yellow boxes are also displayed by the oscillator. These boxes highlight potential turning points or peaks. When the market comes close to these points, they can provide a heads-up about the possibility of changes in momentum or even a trend reversal, helping a trader make informed choices quickly. These can be looked at as possible reversal areas simply put.
Settings:
Users can adjust the number of neighbours in the KNN algorithm and choose the periods they prefer for analysis. This way, the tool becomes a part of a trader's strategy, adapting to different market conditions as they see fit. Users can also adjust the smoothing used by the oscillator via the smoothing input.
Machine Learning: Trend Pulse⚠️❗ Important Limitations: Due to the way this script is designed, it operates specifically under certain conditions:
Stocks & Forex : Only compatible with timeframes of 8 hours and above ⏰
Crypto : Only works with timeframes starting from 4 hours and higher ⏰
❗Please note that the script will not work on lower timeframes.❗
Feature Extraction : It begins by identifying a window of past price changes. Think of this as capturing the "mood" of the market over a certain period.
Distance Calculation : For each historical data point, it computes a distance to the current window. This distance measures how similar past and present market conditions are. The smaller the distance, the more similar they are.
Neighbor Selection : From these, it selects 'k' closest neighbors. The variable 'k' is a user-defined parameter indicating how many of the closest historical points to consider.
Price Estimation : It then takes the average price of these 'k' neighbors to generate a forecast for the next stock price.
Z-Score Scaling: Lastly, this forecast is normalized using the Z-score to make it more robust and comparable over time.
Inputs:
histCap (Historical Cap) : histCap limits the number of past bars the script will consider. Think of it as setting the "memory" of model—how far back in time it should look.
sampleSpeed (Sampling Rate) : sampleSpeed is like a time-saving shortcut, allowing the script to skip bars and only sample data points at certain intervals. This makes the process faster but could potentially miss some nuances in the data.
winSpan (Window Size) : This is the size of the "snapshot" of market data the script will look at each time. The window size sets how many bars the algorithm will include when it's measuring how "similar" the current market conditions are to past conditions.
All these variables help to simplify and streamline the k-NN model, making it workable within limitations. You could see them as tuning knobs, letting you balance between computational efficiency and predictive accuracy.
Hybrid EMA AlgoLearner⭕️Innovative trading indicator that utilizes a k-NN-inspired algorithmic approach alongside traditional Exponential Moving Averages (EMAs) for more nuanced analysis. While the algorithm doesn't actually employ machine learning techniques, it mimics the logic of the k-Nearest Neighbors (k-NN) methodology. The script takes into account the closest 'k' distances between a short-term and long-term EMA to create a weighted short-term EMA. This combination of rule-based logic and EMA technicals offers traders a more sophisticated tool for market analysis.
⭕️Foundational EMAs: The script kicks off by generating a 50-period short-term EMA and a 200-period long-term EMA. These EMAs serve a dual purpose: they provide the basic trend-following capability familiar to most traders, akin to the classic EMA 50 and EMA 200, and set the stage for more intricate calculations to follow.
⭕️k-NN Integration: The indicator distinguishes itself by introducing k-NN (k-Nearest Neighbors) logic into the mix. This machine learning technique scans prior market data to find the closest 'neighbors' or distances between the two EMAs. The 'k' closest distances are then picked for further analysis, thus imbuing the indicator with an added layer of data-driven context.
⭕️Algorithmic Weighting: After the k closest distances are identified, they are utilized to compute a weighted EMA. Each of the k closest short-term EMA values is weighted by its associated distance. These weighted values are summed up and normalized by the sum of all chosen distances. The result is a weighted short-term EMA that packs more nuanced information than a simple EMA would.
RSI-MFI Machine Learning [ Manhattan distance ]The RSI-MFI Machine Learning Indicator is a technical analysis tool that combines the Relative Strength Index (RSI) and Money Flow Index (MFI) indicators with the Manhattan distance metric.
It aims to provide insights into potential trade setups by leveraging machine learning principles and calculating distances between current and historical data points.
The indicator starts by calculating the RSI and MFI values based on the specified periods for each indicator.
The RSI measures the strength and speed of price movements, while the MFI evaluates the inflow and outflow of money in the market.
By combining these two indicators, the indicator captures both price momentum and money flow dynamics.
To apply machine learning principles , the indicator utilizes the Manhattan distance metric to quantify the similarity or dissimilarity between different data points.
The Manhattan distance is calculated by taking the absolute differences between corresponding RSI and MFI values of the current point and historical points.
Next, the indicator determines the nearest neighbors based on the calculated Manhattan distances.
The number of nearest neighbors is determined by the square root of the specified count of neighbors.
By identifying similar patterns and behaviors in the historical data, the indicator aims to uncover potential trade opportunities.
Trade signals are generated based on the calculated distances. The indicator compares each distance with the maximum distance encountered so far.
If a new maximum distance is found, it updates the value and considers the corresponding direction as a potential trade signal. The trade signals are stored in an array for further analysis.
Furthermore, the indicator considers the price action and a calculated regression line to differentiate between long and short trade signals.
Long trade signals are identified when the closing price is above the regression line, indicating a potentially bullish setup.
Short trade signals are identified when the closing price is below the regression line, indicating a potentially bearish setup.
The RSI-MFI Machine Learning Indicator visualizes the regression line on the price chart and labels the bars accordingly. It highlights the regression line with different colors based on the trade signals, making it easier for traders to identify potential entry or exit points.
Traders can use the RSI-MFI Machine Learning Indicator as a tool to analyze price movements, evaluate market conditions based on RSI and MFI, leverage machine learning concepts to find similar patterns, and make informed trading decisions.
Machine Learning : Cosine Similarity & Euclidean DistanceIntroduction:
This script implements a comprehensive trading strategy that adheres to the established rules and guidelines of housing trading. It leverages advanced machine learning techniques and incorporates customised moving averages, including the Conceptive Price Moving Average (CPMA), to provide accurate signals for informed trading decisions in the housing market. Additionally, signal processing techniques such as Lorentzian, Euclidean distance, Cosine similarity, Know sure thing, Rational Quadratic, and sigmoid transformation are utilised to enhance the signal quality and improve trading accuracy.
Features:
Market Analysis: The script utilizes advanced machine learning methods such as Lorentzian, Euclidean distance, and Cosine similarity to analyse market conditions. These techniques measure the similarity and distance between data points, enabling more precise signal identification and enhancing trading decisions.
Cosine similarity:
Cosine similarity is a measure used to determine the similarity between two vectors, typically in a high-dimensional space. It calculates the cosine of the angle between the vectors, indicating the degree of similarity or dissimilarity.
In the context of trading or signal processing, cosine similarity can be employed to compare the similarity between different data points or signals. The vectors in this case represent the numerical representations of the data points or signals.
Cosine similarity ranges from -1 to 1, with 1 indicating perfect similarity, 0 indicating no similarity, and -1 indicating perfect dissimilarity. A higher cosine similarity value suggests a closer match between the vectors, implying that the signals or data points share similar characteristics.
Lorentzian Classification:
Lorentzian classification is a machine learning algorithm used for classification tasks. It is based on the Lorentzian distance metric, which measures the similarity or dissimilarity between two data points. The Lorentzian distance takes into account the shape of the data distribution and can handle outliers better than other distance metrics.
Euclidean Distance:
Euclidean distance is a distance metric widely used in mathematics and machine learning. It calculates the straight-line distance between two points in Euclidean space. In two-dimensional space, the Euclidean distance between two points (x1, y1) and (x2, y2) is calculated using the formula sqrt((x2 - x1)^2 + (y2 - y1)^2).
Dynamic Time Windows: The script incorporates a dynamic time window function that allows users to define specific time ranges for trading. It checks if the current time falls within the specified window to execute the relevant trading signals.
Custom Moving Averages: The script includes the CPMA, a powerful moving average calculation. Unlike traditional moving averages, the CPMA provides improved support and resistance levels by considering multiple price types and employing a combination of Exponential Moving Averages (EMAs) and Simple Moving Averages (SMAs). Its adaptive nature ensures responsiveness to changes in price trends.
Signal Processing Techniques: The script applies signal processing techniques such as Know sure thing, Rational Quadratic, and sigmoid transformation to enhance the quality of the generated signals. These techniques improve the accuracy and reliability of the trading signals, aiding in making well-informed trading decisions.
Trade Statistics and Metrics: The script provides comprehensive trade statistics and metrics, including total wins, losses, win rate, win-loss ratio, and early signal flips. These metrics offer valuable insights into the performance and effectiveness of the trading strategy.
Usage:
Configuring Time Windows: Users can customize the time windows by specifying the start and finish time ranges according to their trading preferences and local market conditions.
Signal Interpretation: The script generates long and short signals based on the analysis, custom moving averages, and signal processing techniques. Users should pay attention to these signals and take appropriate action, such as entering or exiting trades, depending on their trading strategies.
Trade Statistics: The script continuously tracks and updates trade statistics, providing users with a clear overview of their trading performance. These statistics help users assess the effectiveness of the strategy and make informed decisions.
Conclusion:
With its adherence to housing trading rules, advanced machine learning methods, customized moving averages like the CPMA, and signal processing techniques such as Lorentzian, Euclidean distance, Cosine similarity, Know sure thing, Rational Quadratic, and sigmoid transformation, this script offers users a powerful tool for housing market analysis and trading. By leveraging the provided signals, time windows, and trade statistics, users can enhance their trading strategies and improve their overall trading performance.
Disclaimer:
Please note that while this script incorporates established tradingview housing rules, advanced machine learning techniques, customized moving averages, and signal processing techniques, it should be used for informational purposes only. Users are advised to conduct their own analysis and exercise caution when making trading decisions. The script's performance may vary based on market conditions, user settings, and the accuracy of the machine learning methods and signal processing techniques. The trading platform and developers are not responsible for any financial losses incurred while using this script.
By publishing this script on the platform, traders can benefit from its professional presentation, clear instructions, and the utilisation of advanced machine learning techniques, customised moving averages, and signal processing techniques for enhanced trading signals and accuracy.
I extend my gratitude to TradingView, LUX ALGO, and JDEHORTY for their invaluable contributions to the trading community. Their innovative scripts, meticulous coding patterns, and insightful ideas have profoundly enriched traders' strategies, including my own.
Gamma Bands v. 7.0Gamma Bands are based on previous day data of base intrument, Volatility , Options flow (imported from external source Quandl via TradingView API as TV is not supporting Options as instruments) and few other additional factors to calculate intraday levels. Those levels in correlation with even pure Price Action works like a charm what is confirmed by big orders often placed exactly on those levels on Futures Contracts. We have levels +/- 0.25, 0.5 and 1.0 that are calculated from Pivot Point and are working like Support and Resistance. Higher the number of Gamma, stronger the level. Passing Gamma +1/-1 would be good entry point for trades as almost everytime it is equal to Trend Day. Levels are calculated by Machine Learning algorithm written in Python which downloads data from Options and Darkpool markets, process and calculate levels, export to Quandl and then in PineScript I import the data to indicator. Levels are refreshed each day and are valid for particular trading day.
There's possibility also to enable display of Initial Balance range (High and Low range of bars/candles from 1st hour of regular cash session). Breaking one of extremes of Initial Balance is very often driving sentiment for rest of the session.
Volatility Reversal Levels
They're calculated taking into account Options flow imported to TV (Strikes, Call/Put types & Expiration dates) in combination with Volatility, Volume flow. Based on that we calculate on daily basis Significant Close level and "Stop and Reversal level".
Very often reaching area close to those levels either trigger immediate reversal of previous trend or at least push price into consolidation range.
[UPRIGHT Trading] Volatility Trend Filter (VTF) AlgoHello Traders,
As some of you know, I have had this in Beta for a long while now and it's finally time for a full release.
I originally designed this to be an Unreal Algo add-on to track & stay in the trade a little better, but the VTF Algo has become a full Algorithm and can be used standalone with supreme accuracy.
It's for beginners and advanced traders alike. I've made the settings very customizable, but also easy to just jump right in.
How it works:
It uses volatility , deviations, and tons of statistical calculations, confirmations, moving averages, and filters to bring you the most accurate Supply & Demand predictive algorithm possible. The VTF Algo will automatically normalize different volatility in any type of market to help avoid getting Chopped up and give a forward-looking approach to accurate Price Action and confirmation. It will automatically show support and resistance in real-time. The channel that The VTF Algo creates will help traders confirm whether they should stay in the trade or get out fast. As the green top grows it naturally acts as Supply and as the red bottom grows it acts as Demand, when one of them far exceeds the other the direction price will proceed to is clear to see.
Features:
-Easy-to-read Price Action & Trend channel.
-Exceptional Chop Filter (grayed center).
-Accurate Buy/Sell and Topline Continuation Signals.
-Rejection Signals.
-Multiple-Timeframe Customizable Trend Table. Showing Directional Arrows (see bottom right of picture).
-Bullish / Bearish Growing Blocks.
-Fully Customizable with Clean and Cleaner Mode.
The VTF Algo was made with all different types of traders in mind.
Some like things Ultra Crispy Clean:
Others like things a little more clean but can move their focus to where it's needed:
Lastly, there are those who don't mind things looking a little busy:
Topline Continuation Signals, Auto-Supply/Demand, and a Real-Time Multiple Timeframe Trend Table (in the bottom-right) corner:
Meshes perfectly as an Algo Add-on for Unreal Algo © (as originally designed) to enhance "The Simple Strat" © :
I tried to make everything as customizable as possible. So adding or removing or color-changing is super easy.
Happy Trading.
Cheers,
Mike
Machine Learning: Lorentzian Classification█ OVERVIEW
A Lorentzian Distance Classifier (LDC) is a Machine Learning classification algorithm capable of categorizing historical data from a multi-dimensional feature space. This indicator demonstrates how Lorentzian Classification can also be used to predict the direction of future price movements when used as the distance metric for a novel implementation of an Approximate Nearest Neighbors (ANN) algorithm.
█ BACKGROUND
In physics, Lorentzian space is perhaps best known for its role in describing the curvature of space-time in Einstein's theory of General Relativity (2). Interestingly, however, this abstract concept from theoretical physics also has tangible real-world applications in trading.
Recently, it was hypothesized that Lorentzian space was also well-suited for analyzing time-series data (4), (5). This hypothesis has been supported by several empirical studies that demonstrate that Lorentzian distance is more robust to outliers and noise than the more commonly used Euclidean distance (1), (3), (6). Furthermore, Lorentzian distance was also shown to outperform dozens of other highly regarded distance metrics, including Manhattan distance, Bhattacharyya similarity, and Cosine similarity (1), (3). Outside of Dynamic Time Warping based approaches, which are unfortunately too computationally intensive for PineScript at this time, the Lorentzian Distance metric consistently scores the highest mean accuracy over a wide variety of time series data sets (1).
Euclidean distance is commonly used as the default distance metric for NN-based search algorithms, but it may not always be the best choice when dealing with financial market data. This is because financial market data can be significantly impacted by proximity to major world events such as FOMC Meetings and Black Swan events. This event-based distortion of market data can be framed as similar to the gravitational warping caused by a massive object on the space-time continuum. For financial markets, the analogous continuum that experiences warping can be referred to as "price-time".
Below is a side-by-side comparison of how neighborhoods of similar historical points appear in three-dimensional Euclidean Space and Lorentzian Space:
This figure demonstrates how Lorentzian space can better accommodate the warping of price-time since the Lorentzian distance function compresses the Euclidean neighborhood in such a way that the new neighborhood distribution in Lorentzian space tends to cluster around each of the major feature axes in addition to the origin itself. This means that, even though some nearest neighbors will be the same regardless of the distance metric used, Lorentzian space will also allow for the consideration of historical points that would otherwise never be considered with a Euclidean distance metric.
Intuitively, the advantage inherent in the Lorentzian distance metric makes sense. For example, it is logical that the price action that occurs in the hours after Chairman Powell finishes delivering a speech would resemble at least some of the previous times when he finished delivering a speech. This may be true regardless of other factors, such as whether or not the market was overbought or oversold at the time or if the macro conditions were more bullish or bearish overall. These historical reference points are extremely valuable for predictive models, yet the Euclidean distance metric would miss these neighbors entirely, often in favor of irrelevant data points from the day before the event. By using Lorentzian distance as a metric, the ML model is instead able to consider the warping of price-time caused by the event and, ultimately, transcend the temporal bias imposed on it by the time series.
For more information on the implementation details of the Approximate Nearest Neighbors (ANN) algorithm used in this indicator, please refer to the detailed comments in the source code.
█ HOW TO USE
Below is an explanatory breakdown of the different parts of this indicator as it appears in the interface:
Below is an explanation of the different settings for this indicator:
General Settings:
Source - This has a default value of "hlc3" and is used to control the input data source.
Neighbors Count - This has a default value of 8, a minimum value of 1, a maximum value of 100, and a step of 1. It is used to control the number of neighbors to consider.
Max Bars Back - This has a default value of 2000.
Feature Count - This has a default value of 5, a minimum value of 2, and a maximum value of 5. It controls the number of features to use for ML predictions.
Color Compression - This has a default value of 1, a minimum value of 1, and a maximum value of 10. It is used to control the compression factor for adjusting the intensity of the color scale.
Show Exits - This has a default value of false. It controls whether to show the exit threshold on the chart.
Use Dynamic Exits - This has a default value of false. It is used to control whether to attempt to let profits ride by dynamically adjusting the exit threshold based on kernel regression.
Feature Engineering Settings:
Note: The Feature Engineering section is for fine-tuning the features used for ML predictions. The default values are optimized for the 4H to 12H timeframes for most charts, but they should also work reasonably well for other timeframes. By default, the model can support features that accept two parameters (Parameter A and Parameter B, respectively). Even though there are only 4 features provided by default, the same feature with different settings counts as two separate features. If the feature only accepts one parameter, then the second parameter will default to EMA-based smoothing with a default value of 1. These features represent the most effective combination I have encountered in my testing, but additional features may be added as additional options in the future.
Feature 1 - This has a default value of "RSI" and options are: "RSI", "WT", "CCI", "ADX".
Feature 2 - This has a default value of "WT" and options are: "RSI", "WT", "CCI", "ADX".
Feature 3 - This has a default value of "CCI" and options are: "RSI", "WT", "CCI", "ADX".
Feature 4 - This has a default value of "ADX" and options are: "RSI", "WT", "CCI", "ADX".
Feature 5 - This has a default value of "RSI" and options are: "RSI", "WT", "CCI", "ADX".
Filters Settings:
Use Volatility Filter - This has a default value of true. It is used to control whether to use the volatility filter.
Use Regime Filter - This has a default value of true. It is used to control whether to use the trend detection filter.
Use ADX Filter - This has a default value of false. It is used to control whether to use the ADX filter.
Regime Threshold - This has a default value of -0.1, a minimum value of -10, a maximum value of 10, and a step of 0.1. It is used to control the Regime Detection filter for detecting Trending/Ranging markets.
ADX Threshold - This has a default value of 20, a minimum value of 0, a maximum value of 100, and a step of 1. It is used to control the threshold for detecting Trending/Ranging markets.
Kernel Regression Settings:
Trade with Kernel - This has a default value of true. It is used to control whether to trade with the kernel.
Show Kernel Estimate - This has a default value of true. It is used to control whether to show the kernel estimate.
Lookback Window - This has a default value of 8 and a minimum value of 3. It is used to control the number of bars used for the estimation. Recommended range: 3-50
Relative Weighting - This has a default value of 8 and a step size of 0.25. It is used to control the relative weighting of time frames. Recommended range: 0.25-25
Start Regression at Bar - This has a default value of 25. It is used to control the bar index on which to start regression. Recommended range: 0-25
Display Settings:
Show Bar Colors - This has a default value of true. It is used to control whether to show the bar colors.
Show Bar Prediction Values - This has a default value of true. It controls whether to show the ML model's evaluation of each bar as an integer.
Use ATR Offset - This has a default value of false. It controls whether to use the ATR offset instead of the bar prediction offset.
Bar Prediction Offset - This has a default value of 0 and a minimum value of 0. It is used to control the offset of the bar predictions as a percentage from the bar high or close.
Backtesting Settings:
Show Backtest Results - This has a default value of true. It is used to control whether to display the win rate of the given configuration.
█ WORKS CITED
(1) R. Giusti and G. E. A. P. A. Batista, "An Empirical Comparison of Dissimilarity Measures for Time Series Classification," 2013 Brazilian Conference on Intelligent Systems, Oct. 2013, DOI: 10.1109/bracis.2013.22.
(2) Y. Kerimbekov, H. Ş. Bilge, and H. H. Uğurlu, "The use of Lorentzian distance metric in classification problems," Pattern Recognition Letters, vol. 84, 170–176, Dec. 2016, DOI: 10.1016/j.patrec.2016.09.006.
(3) A. Bagnall, A. Bostrom, J. Large, and J. Lines, "The Great Time Series Classification Bake Off: An Experimental Evaluation of Recently Proposed Algorithms." ResearchGate, Feb. 04, 2016.
(4) H. Ş. Bilge, Yerzhan Kerimbekov, and Hasan Hüseyin Uğurlu, "A new classification method by using Lorentzian distance metric," ResearchGate, Sep. 02, 2015.
(5) Y. Kerimbekov and H. Şakir Bilge, "Lorentzian Distance Classifier for Multiple Features," Proceedings of the 6th International Conference on Pattern Recognition Applications and Methods, 2017, DOI: 10.5220/0006197004930501.
(6) V. Surya Prasath et al., "Effects of Distance Measure Choice on KNN Classifier Performance - A Review." .
█ ACKNOWLEDGEMENTS
@veryfid - For many invaluable insights, discussions, and advice that helped to shape this project.
@capissimo - For open sourcing his interesting ideas regarding various KNN implementations in PineScript, several of which helped inspire my original undertaking of this project.
@RikkiTavi - For many invaluable physics-related conversations and for his helping me develop a mechanism for visualizing various distance algorithms in 3D using JavaScript
@jlaurel - For invaluable literature recommendations that helped me to understand the underlying subject matter of this project.
@annutara - For help in beta-testing this indicator and for sharing many helpful ideas and insights early on in its development.
@jasontaylor7 - For helping to beta-test this indicator and for many helpful conversations that helped to shape my backtesting workflow
@meddymarkusvanhala - For helping to beta-test this indicator
@dlbnext - For incredibly detailed backtesting testing of this indicator and for sharing numerous ideas on how the user experience could be improved.
MLExtensionsLibrary "MLExtensions"
normalizeDeriv(src, quadraticMeanLength)
Returns the smoothed hyperbolic tangent of the input series.
Parameters:
src : The input series (i.e., the first-order derivative for price).
quadraticMeanLength : The length of the quadratic mean (RMS).
Returns: nDeriv The normalized derivative of the input series.
normalize(src, min, max)
Rescales a source value with an unbounded range to a target range.
Parameters:
src : The input series
min : The minimum value of the unbounded range
max : The maximum value of the unbounded range
Returns: The normalized series
rescale(src, oldMin, oldMax, newMin, newMax)
Rescales a source value with a bounded range to anther bounded range
Parameters:
src : The input series
oldMin : The minimum value of the range to rescale from
oldMax : The maximum value of the range to rescale from
newMin : The minimum value of the range to rescale to
newMax : The maximum value of the range to rescale to
Returns: The rescaled series
color_green(prediction)
Assigns varying shades of the color green based on the KNN classification
Parameters:
prediction : Value (int|float) of the prediction
Returns: color
color_red(prediction)
Assigns varying shades of the color red based on the KNN classification
Parameters:
prediction : Value of the prediction
Returns: color
tanh(src)
Returns the the hyperbolic tangent of the input series. The sigmoid-like hyperbolic tangent function is used to compress the input to a value between -1 and 1.
Parameters:
src : The input series (i.e., the normalized derivative).
Returns: tanh The hyperbolic tangent of the input series.
dualPoleFilter(src, lookback)
Returns the smoothed hyperbolic tangent of the input series.
Parameters:
src : The input series (i.e., the hyperbolic tangent).
lookback : The lookback window for the smoothing.
Returns: filter The smoothed hyperbolic tangent of the input series.
tanhTransform(src, smoothingFrequency, quadraticMeanLength)
Returns the tanh transform of the input series.
Parameters:
src : The input series (i.e., the result of the tanh calculation).
smoothingFrequency
quadraticMeanLength
Returns: signal The smoothed hyperbolic tangent transform of the input series.
n_rsi(src, n1, n2)
Returns the normalized RSI ideal for use in ML algorithms.
Parameters:
src : The input series (i.e., the result of the RSI calculation).
n1 : The length of the RSI.
n2 : The smoothing length of the RSI.
Returns: signal The normalized RSI.
n_cci(src, n1, n2)
Returns the normalized CCI ideal for use in ML algorithms.
Parameters:
src : The input series (i.e., the result of the CCI calculation).
n1 : The length of the CCI.
n2 : The smoothing length of the CCI.
Returns: signal The normalized CCI.
n_wt(src, n1, n2)
Returns the normalized WaveTrend Classic series ideal for use in ML algorithms.
Parameters:
src : The input series (i.e., the result of the WaveTrend Classic calculation).
n1
n2
Returns: signal The normalized WaveTrend Classic series.
n_adx(highSrc, lowSrc, closeSrc, n1)
Returns the normalized ADX ideal for use in ML algorithms.
Parameters:
highSrc : The input series for the high price.
lowSrc : The input series for the low price.
closeSrc : The input series for the close price.
n1 : The length of the ADX.
regime_filter(src, threshold, useRegimeFilter)
Parameters:
src
threshold
useRegimeFilter
filter_adx(src, length, adxThreshold, useAdxFilter)
filter_adx
Parameters:
src : The source series.
length : The length of the ADX.
adxThreshold : The ADX threshold.
useAdxFilter : Whether to use the ADX filter.
Returns: The ADX.
filter_volatility(minLength, maxLength, useVolatilityFilter)
filter_volatility
Parameters:
minLength : The minimum length of the ATR.
maxLength : The maximum length of the ATR.
useVolatilityFilter : Whether to use the volatility filter.
Returns: Boolean indicating whether or not to let the signal pass through the filter.
backtest(high, low, open, startLongTrade, endLongTrade, startShortTrade, endShortTrade, isStopLossHit, maxBarsBackIndex, thisBarIndex)
Performs a basic backtest using the specified parameters and conditions.
Parameters:
high : The input series for the high price.
low : The input series for the low price.
open : The input series for the open price.
startLongTrade : The series of conditions that indicate the start of a long trade.`
endLongTrade : The series of conditions that indicate the end of a long trade.
startShortTrade : The series of conditions that indicate the start of a short trade.
endShortTrade : The series of conditions that indicate the end of a short trade.
isStopLossHit : The stop loss hit indicator.
maxBarsBackIndex : The maximum number of bars to go back in the backtest.
thisBarIndex : The current bar index.
Returns: A tuple containing backtest values
init_table()
init_table()
Returns: tbl The backtest results.
update_table(tbl, tradeStatsHeader, totalTrades, totalWins, totalLosses, winLossRatio, winrate, stopLosses)
update_table(tbl, tradeStats)
Parameters:
tbl : The backtest results table.
tradeStatsHeader : The trade stats header.
totalTrades : The total number of trades.
totalWins : The total number of wins.
totalLosses : The total number of losses.
winLossRatio : The win loss ratio.
winrate : The winrate.
stopLosses : The total number of stop losses.
Returns: Updated backtest results table.
Neon Juliet - PreviewThere is no TLDR, but there is a summary at the end. I strongly encourage to read full description before trying it out. Enjoy!
Background
=========
Having successful and adamant trading systems typically consists of two (oversimplified) elements: signals and risk management system. In most zero-sum games, such as trading, signals must offer an advantage against the market, and risk management system provides a safety mechanism to allow the system to exist in the future. Let me explain.
Say, I have a solid risk management system: it is diversified, with take profit and stop loss thresholds set for low risk, on average I trade less than 3% of my assets, and there’s a loss recovery mechanism, etc. Hypothetically, it’s pristine. Now, let’s trade this portfolio against a flip of a coin, essentially a signal that provides 50% probability of things turning out in my favour. How profitable is such system? My answer: it isn’t. I might be able to sustain this system for some time, but eventually this system is going to have to loosen risk restrictions to stay ahead of the commissions and borrowing costs, resulting in overtime detrimental trend.
Conversely, if the signals provide greater than 50% confidence of things turning out in my favour, but risk management is poor, I’d expect such system to end up in a disaster soon, perhaps after a few euphoric gains. (I’d isolate a top-notch signals, say >90% confidence, in another bucket, but this idealistic system is non-achievable in my practice, so I’ll leave it be)
Neon Juliet was developed to offer an advantage against given markets. Probabilities generated by this model are statistical historical outcomes. This model developed using only price action and is unable to consume any other data or price data across instruments. In other words, it doesn’t know anything you don’t see already on a chart.
Neon J performs best on complex instruments where there’s great diversity of actors and considerable daily volume .
Methodology
==========
In principle, Neon J is based on Bayes’ Theorem. Simply put, prior knowledge of price action ( aka patterns) provides basis for probability of future price action development (ex. long or short trend).
The training process is implemented outside of this script mainly due to Pine Script limitations. This script, however, contains inference portion of the model.
As input for training, daily candle data is used. From this data, feature engineering step of the training develops features, like price average divergence/convergence (think MACD ), price strength (think RSI , ADX ); multiple periods used to diversify long and short patterns. This is done to develop a “state” that is reflective of recent price development. Ex. what we’d call a trend is just a strong and consistent upward price action, but we’d need to look at most recent N candles and their pattern to know that.
Once features are developed, I train a model using Reinforcement Learning technique. Simply put, this technique allows an agent to interact with a trading simulator and take actions (ex. go long, go short, etc.). After many iterations, the agent learns conditions (patterns) that lead to positive outcomes and those that lead to negative outcomes. This learning is quantitative, which means there’s a way to tell which probabilities are strong and which are weak. These probabilities are indicated by this script.
Trained Neon J models are instruments-specific. Meaning, that model for DJI is not compatible with SP500 or any other instrument. Experimentally, I proved that such approach over-performs generalizable models (those that are trained on data from multiple instruments)
Neon J currently only support daily time frame. The limitation is purely practical to reduce the development load and model size.
Results
======
Tests show 60%-70% success rate (on average, some instruments are worse than that, some better) of individual signal when threshold is set to 0.3 (roughly equivalent to 65% probability). This is calculated with Pine Script Strategy with the following entry/exit rules:
Entry when individual signal (a dot) is above 0.3 (long) or below -0.3 (short)
Exit when 14-period smooth signal (a column) is above 0.0 (short exit) or below 0.0 (long exit)
No stop loss or take profit levels.
Pyramiding is set to 100 (to allow unrestricted action of all signals)
All trades are closed on last tested bar (to conclude all signals in-flight)
Percent Profitable is what we take as success rate in the context of this assessment. This number represents how many signals were profitable vs all signals actioned.
It is also worth noting that this assessment was performed on a time period previously unseen by the model. Simply put, we only train a model with data up until date X, then we test starting from date X onward. This ensures that the assessment is unbiased by the model already “knowing” the future. In practice, this gives confidence that future (unknown) market dynamics is going to be representative of our test results.
Be aware, the above “strategy” is not my recommended usage of this signal, it is simply an assessment technique that is meant to be as simple and unconstrained as possible.
How to use this script
================
The script calculates a probability. A term probability here is used in a loose form and means “a numeric value in roughly -1 to 1 space that represents the likelyhood of bullish or bearish price action”. Keep in mind that probability values can go over 1.0 or below -1.0. This is due to the fact that these value are normalized to -1/1 space using 95-percentile (this detail is largely unimportant for usability’s sake).
Indications
--------------
Dots (circles) indicate individual probability value on any given bar. Indicated value on a given bar indicates the probability of future price action. High (positive) values indicate high probability of long action in the future. Low (negative) values indicate high probability of short action in the future. You should interpret future as a gradient (a trend developing slowly over time) instead of being isolated to what’s immediately follows (ex. next bar)
Columns (histogram) provided as convenient view of smoothed probabilities of last N bars. This is controlled by the Smoothing parameter and defaults to 14.
Parameters
---------------
Model parameter is the backbone of this script. It is a required parameter and it is unique for each instrument. Example models provided at the end (see below). This parameter is a long 10000+ character representation of a model.
The script has two additional parameters for configuring interpretation: Threshold and Smoothing.
Threshold controls the level at which values change color (ex. above 0.3, turn neon blue, and below -0.3 turn neon purple).
Smoothing parameter provides a way to smooth out individual probabilities into a exponential moving average with the periods provided. This average is indicated using columns on the indicator.
Model expiration
----------------------
Models are valid for 1 month after training. This is done by design to prevent model deterioration. A month is proven to be a maximum period of time to hold model performance steady. After that, deterioration is likely to occur. Optimal time for model lifetime is 10 days (this is what I use for live trading), and of course most optimal (but unpractical for now) is to re-train daily.
Validity indicated with blue-tinted indicator background, while red-tinted background indicates expired period.
Preview
======
This script is released as a public script for anyone to try. My motives for this release are two-fold:
To subject the model to a variety of conditions, including traders with different experiences trading different instruments (subject to specific models offered of course). Essentially, my own testing is not enough to grasp a full breadths of scenarios. I’d like to harden it and understand where it is strong and where it might fall short (pun intended).
Get an idea on how Neon J might be useful when making trading decision. I tried to make the representation of the signals unconstrained and unopinionated, so there’s room to explore and experiment. I found that Neon J can be packaged in a number of different ways.
At this moment the script is closed-source. I might consider open-sourcing this script in future depending on how much feedback I get from this submission and whether it’d be deemed useful to others.
Summary
=======
Neon J is a set of probabilistic models for predicting future price action with ~65% accuracy. It indicates individual signals (circles) for probability of price action in a foreseeable future, while smoothed signals (columns) are provided for a more dynamic view of probable price action. Blue circle - strong long probability; Purple circle - strong short probability. Blue column - strong long trend ahead or in-progress; Purple column - strong short trend ahead or in-progress.
To use it, copy models below and provide them an input to “model” parameter when applying to a chart. Models are instrument-specific. Only daily (D) charts should be used.
The script is provided for evaluation purposes.
Models!
======
At last, here are the models (a piece of text you need to input in script parameters for each instrument)
TVC:DJI :
DJI|20121220|20221220|0.597,-0.032,0.0,-0.121,0.0,0.866,-0.046,0.0,-0.091,0.0|1.492,0.1,0.0,-0.162,0.0,-0.669,-0.037,0.0,-0.042,0.0|0.07,0.374,0.0,0.305,0.0,0.085,0.488,0.0,0.26,0.0|0.249,-0.257,0.0,0.529,0.0,-0.018,-0.233,0.0,0.502,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,30,30,10,10,10,10,60,10,10,10,20,10,40,10,10,10,80,10,10,60,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,20,10,10,10,20,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,20,50,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,30,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,10,40,10,10,10,10,10,20,30,10,10,10,10,60,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,50,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,20,20,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,30,10,10,10,10,10,30,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,20,40,10,10,10,70,10,10,10,10,60,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,70,10,10,10|-645,-188,-7,-97,-4,29,-18,90,60,-7,-30,117,-226,-82,-49,77,-245,53,78,221,-72,280,245,400,683,268,-74,-15,-106,-102,-3,251,302,536,47,3,-6,-179,-56,101,-62,172,176,98,-15,-71,-18,200,61,-249,-30,-38,1,94,-2,-9,47,79,-35,-15,34,-30,76,120,39,96,-47,-11,-61,-21,124,-704,0,-248,112,-193,143,-27,-14,133,170,-20,-17,-2,-120,61,-98,-32,-2,79,-2,109,-35,-16,132,-44,-63,-168,205,-28,919,235,-34,-53,-23,-243,-68,-26,-35,-54,60,-37,28,-91,-3,-21,-47,79,-127,229,61,59,-49,-139,-63,-43,91,201,-19,-80,-27,120,-122,-141,-100,-32,-25,-98,-27,50,-2,-65,-138,-7,-36,-9,53,-36,-36,-64,-11,216,-5,-664,-19,74,82,-83,-3,-66,21,386,-454,-1002,-282,-7,-52,-30,-9,-16,-148,-131,112,-484,-96,97,93,-13,-162,-49,38,31,-5,-199,-22,205,153,-29,14,-41,-222,-225,-145,107,70,-3,-8,-7,-20,-247,37,96,268,362,-95,706,-69,60,70,120,-34,-65,-152,-69,-7,69,-76,71,-5,384,109,-102,-484,-3,34,60,-20,380,244,678,292,-48,-2,-154,-17,-62,105,486,597,212,-26,-21,-310,-29,-22,-90,285,-204,-92,-290,-6,-516,-42,-16,127,-47,-7,-72,-247,76,-47,-13,43,-26,43,89,-38,30,-21,-106,-78,113,-19,-13,-8,-12,-12,362,247,-4,50,76,64,-14,-52,-16,-93,-172,53,-1,32,99,22,-75,-4,-9,31,70,116,-54,-61,-3,-55,-19,-15,176,143,-11,134,144,-11,-28,-47,-29,-136,-75,99,64,-9,-2,-24,-43,30,-161,-179,82,175,129,115,-71,-396,-202,101,-9,139,-6,-31,-312,-111,2,0,-234,-21,-52,-31,-12,-26,-37,-144,-23,68,23,-16,149,60,-64,10,-7,-8,46,210,393,-5,96,-56,89,48,475,176,20,-10,-31,-29,34,76,41,178,38,-32,-94,-33,76,-5,91,-15,123,72,-46,-13,-11,0,-37,-244,-161,155,-8,-3,165,23,77,16,-117,35,-74,-5,-107,-286,-24,-263,-14,-37,-5,-196,-290,-576,-188,41,-20,-98,-34,-45,-45,-242,40,60,-7,-10,-17,-43,73,48,-25,-8,-40,-27,-2,-5,42,73,-6,-23,8,-16,63,167,21,-99,-47,-119,-36,-59,192,158,115,123,54,-28,-1,-90,-169,-71,-72,114,156,-141,155,64,42,-88,69,-75,76,94,-4,65,102,152,-9,10,-17,-192,67,-10,-343,-90,-43,-106,12,-9,-79,-10,-73,-461,-509,-75,99,-57,0,-27,80,-156,-198,-642,-363,33,47,-28,-40,-43,-8,9,-27,-67,41,26,0,6,-49,-29,-60,32,70,34,-2,-9,-40,-240,-152,21,189,49,67,12,-12,-2,16,31,200,193,211,-150,-84,-45,58,75,44,260,128,105,-9,-11,-1,82,-94,184,-53,266,326,-55,-209,-9,54,85,308,-14,60,420,160,-39,-81,-17,-10,77,108,-28,257,-104,-53,-59,-128,-5,-13,8,119,-20,-130,-49,-9,-3,-23,-46,150,194,263,-214,-12,72,-6,-22,25,-10,290,-41,-21,-18,-1,-17,-42,-14,-21,0,-4,-23,-1,-1,-13,172,-9,224,86,-9,-2,-22,176,-6,33,186,-61,-187,-46,-33,94,172,0,16,-12,-37,59,103,118,194,1000,44,40,49,81,82,89,142,-34,-26,-2,-15,-19,0,271,-56,-45,-21,-96,-146,-5,-54,141,-11,-320,58,-23,-43,-14,-49,142,127,120,-285,-187,-102,-72,-11,-55,-25,44,52,-43,-13,20,-41,-23,-88,-25,-4,-23,11,-179,-9,96,-84,215,93,-5,-49,148,-2,-58,-14,24,-6,-33,-6,103,9,0,-61,-1,29,113,98,-97,-19,-52,87,-39,-146,-70,-72,-119,-844,-184,-45,-27,-96,-155,93,-56,-41,-20,-43,-63,-142,-89,263,66,21,-21,-32,-70,-70,-263,20,-99,-11,-32,-50,-122,-186,-159,-137,136,-77,-14,-814,-23,-22,-170,-137,-42,-36,-64,75,-123,-100,-53,68,133,124,-77,211,217,522|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,30,20,10,10,10,10,10,60,10,10,10,20,10,40,10,10,10,30,50,10,10,50,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,20,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,20,10,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,10,40,10,10,10,10,10,20,10,20,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,50,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,40,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,60,10,10,10,10,60,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,70,10,10,10|-73,-90,70,38,76,12,-269,-89,-47,-77,-43,-161,114,-83,-48,36,-18,-11,-2,-39,-239,-140,-40,-341,-106,-78,83,92,62,-34,-231,-381,-311,-15,-178,-49,-29,-29,-73,-44,-271,-2,-49,-102,-126,-65,-45,-51,-71,-75,-21,52,-19,-29,-24,-131,38,-79,-53,-8,271,43,-24,-60,-8,-8,-5,-15,8,21,-127,72,-16,-40,-43,-70,64,232,-28,172,-22,-27,-8,-100,-134,99,133,61,67,-37,-1,-7,-55,-75,108,-112,7,-70,469,-62,-12,116,-54,-259,-49,-150,-146,-58,-3,-5,-66,-45,-102,-17,-22,-71,-96,-27,0,-46,30,-22,-130,-233,-89,-189,-14,111,0,-9,12,-235,-178,-6,-9,27,-31,-70,-7,-7,-13,-71,27,-1,-14,-24,-101,-38,18,50,-79,-3,-191,-47,-2,-12,-12,112,24,-5,-93,-295,-80,0,-8,-1,115,112,200,235,114,67,-13,-37,-130,-96,85,71,232,141,-265,-137,-57,-8,81,391,-37,-68,-76,57,119,-240,-45,-102,53,40,-23,61,-71,-156,-26,-19,81,-123,-83,-59,104,0,-96,-7,-17,-34,-18,-11,0,-98,-52,-84,-8,-53,-11,48,-4,-34,-16,-143,-7,-31,-77,-44,-34,-15,-64,-65,-21,-152,-240,-26,-172,-50,-170,-32,-33,-1,-25,-15,-15,-91,-87,-231,-19,-34,-70,-59,55,17,-24,10,-29,-41,-2,-56,27,-134,-54,-41,-30,46,-3,-363,-20,-55,65,16,38,9,-79,-9,51,83,-97,-36,62,-5,-28,-73,-12,0,62,-198,-4,-20,-4,-17,-128,-34,68,-31,-247,-239,-21,-41,-93,-24,14,-81,-238,-165,-44,-40,-102,2,-99,661,-188,0,0,-9,-27,-20,27,33,639,-2,-20,-55,-99,-45,-31,-423,-152,-66,-30,-3,-86,-36,104,-45,-34,104,-227,-191,-80,-65,-56,-86,143,-26,-21,-80,-47,-23,73,165,-93,-7,-43,-9,70,123,-50,-5,-1,57,63,-36,-17,-62,-39,-14,-34,-5,-77,-37,-98,-45,-59,-49,4,-159,-74,-29,-16,-244,-486,-245,8,-13,-1,-34,-58,-182,-62,-695,372,44,-46,-5,-11,-156,-178,-64,-2,-67,-37,-24,-61,-57,-30,69,-27,-153,7,-19,-19,-78,-52,-31,231,-54,-18,-28,-40,51,117,117,-14,-84,-23,-38,134,197,-10,-51,-2,-71,-49,26,268,-15,-83,-49,-35,-29,-94,29,-39,-140,-167,-68,-1,-31,-120,0,74,-59,-116,-134,-37,-136,-154,-136,-303,6,44,-29,-32,-48,-7,-115,-667,-500,-242,0,-1,-30,-3,-21,119,-115,-565,-211,115,-9,-67,-84,-13,-68,-93,-80,-106,65,-8,-89,-417,-29,-27,-61,-27,-18,64,66,115,22,-57,-55,-1,-10,-18,-80,112,85,47,-28,-3,-75,-20,-69,-54,252,90,-63,-35,-12,-4,-15,-1,11,68,-23,-16,-95,-3,-3,-25,31,7,-101,-104,-63,-45,-91,-6,81,-6,-110,-70,49,-13,-85,-57,-179,-66,-92,-284,-152,-249,-80,45,-75,-158,-50,-115,-9,-22,-322,-124,-57,-64,-1,-100,-58,-104,-67,-106,-224,-45,287,-21,-314,-18,-50,-60,-19,-50,-74,-32,339,-8,-114,-164,-31,-16,-6,-37,-26,82,40,40,-13,-30,-75,-54,-124,-2,-37,-10,19,-67,-62,-307,-130,-153,44,-18,-15,-2,-5,-31,10,-11,-78,50,74,-1,-15,-35,-9,-29,-31,91,58,-45,-48,-14,-8,-123,-205,-7,-3,-15,-63,-17,-26,-48,-106,-153,-166,-7,-23,-116,-53,-50,-23,-6,-10,-22,3,-142,-251,-196,-80,-30,-21,75,-36,-6,-188,-28,-2,8,-6,-72,-40,-5,-49,-28,-4,-101,-12,49,33,-19,-96,-169,-58,-293,-201,-69,-25,-82,-17,0,-10,-149,-134,-41,-87,-12,-29,-10,-34,-30,35,59,-122,-5,9,24,0,-13,47,81,-47,104,-7,-17,-76,-34,-17,-49,-69,-47,-20,-26,-46,-49,-248,-35,51,-29,-15,-14,-9,-285,-46,-1,-51,-56,-45,-139,-17,-45,-22,-16,-35,-75,-5,-13,0,-5,-18,-13,2,-7,-10,89,-1,-3,-148,-16,-51,-5,-9,-10,33,37,-44,-125,-1,-7,-48,-20,-10,-1,61,65,100,43,-15,-6,-68,-9,-92,-47,-38,-47,-17,215,500,1000,45,-41,-45,-26,-91,73,24,-28,-27,-65,-102,-27,-96,-142,-34
VANTAGE:SP500 :
SP500|20121220|20221220|0.573,-0.033,0.0,-0.041,0.0,0.846,-0.045,0.0,-0.026,0.0|1.45,0.109,0.0,-0.119,0.0,-0.626,-0.007,0.0,-0.08,0.0|-0.06,0.475,0.0,0.142,0.0,0.089,0.612,0.0,0.13,0.0|0.214,-0.127,0.0,0.619,0.0,-0.057,-0.084,0.0,0.556,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,10,10,10,70,10,10,10,10,60,10,10,10,20,50,10,10,10,70,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,30,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,40,10,10,10,20,20,20,10,10,10,10,20,30,10,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,60,10,10,10,10,50,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,50,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,20,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,60,10,10,10,10,10,10,30,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,70,20,10,10|-94,-209,311,137,89,-128,-228,-15,79,-81,-631,743,252,116,128,-196,-100,-101,-6,207,237,724,345,190,118,-290,-17,-163,-33,-37,140,425,736,-17,-22,-61,-5,-20,85,150,-15,102,274,179,4,-58,-30,-161,-71,-17,-31,-44,-107,53,-3,-19,7,93,-153,-32,-3,-46,-16,-9,71,-131,396,-13,34,-83,-15,-11,-17,72,-457,-143,-67,63,-207,-155,-223,-48,-762,266,-66,339,503,-54,-303,-173,-45,-58,-5,-52,624,1000,496,85,-173,-51,-58,-71,46,92,127,-32,-70,-1,-45,-63,-84,-102,-79,-117,-1,-114,-39,52,-12,-18,-13,-2,192,153,190,-120,-147,-13,-75,-9,-54,-31,-7,-128,-39,-97,60,-29,-24,-23,-173,-133,-241,-118,22,-2,1,-2,-48,-12,-23,-89,-23,-37,-33,-10,-5,-60,-28,-80,-113,-128,184,-170,-93,-50,-7,-43,-52,-87,-143,37,-100,-39,-239,-24,-154,82,-27,100,766,-51,-23,168,-29,138,-35,-50,42,71,-23,38,-23,57,131,-16,-35,-12,-54,-15,181,128,127,131,-19,-47,-108,-43,84,-152,-5,-7,-10,-8,-20,59,53,-269,-44,-7,-67,-26,-13,-10,-116,-21,-49,87,-19,-8,-31,-35,-38,-13,170,185,-54,-4,-56,-85,-108,-147,-19,-15,76,-9,-59,-100,-36,-39,-31,-18,141,66,-85,-27,44,123,123,-13,-8,36,-13,-39,-13,8,189,82,-17,-33,-5,146,-100,-29,64,-20,-53,-23,-97,-2,-77,-89,-5,-21,-132,-31,-15,-47,-1,-8,32,-13,-39,-42,-27,-43,12,-97,-35,-29,-18,-32,152,41,-13,-39,-14,-13,-36,-10,-37,-25,49,109,97,118,85,-56,-59,-74,-21,-167,-145,-12,-5,-29,-63,-107,202,-15,-33,-46,-63,-89,-97,-56,17,-25,-74,-2,-101,-210,-127,-96,-15,-59,-105,-24,-106,-37,-52,-2,-25,-27,-47,-5,14,-8,51,-6,-32,-5,23,-57,-32,-17,39,-4,-20,-28,-42,-23,101,-8,-11,-30,-25,-165,-113,-53,-82,-4,-52,-3,-5,21,-22,-333,-3,94,25,-33,-14,-83,26,-26,-41,-43,-36,63,9,-343,-304,-231,-15,-54,44,-127,-182,139,-83,25,-30,-14,-36,-32,-84,-138,23,-49,-13,-17,-139,-168,-146,-2,-46,-54,-34,-17,-40,-132,-149,-79,-40,-116,-65,-50,-124,-69,37,-21,-29,-6,-48,-232,-84,-59,-3,-6,-13,-11,1,-6,-133,-252,-12,-44,-114,-25,-120,-24,128,-27,-166,-36,-47,-65,-43,-15,-3,-88,-170,-209,-58,-185,-101,-120,-106,65,-21,-40,-12,87,-104,-31,-333,-272,-177,43,-75,-89,-41,-65,-52,-29,3,-10,-44,-18,-11,-7,-46,-37,-7,-5,27,-19,-8,-55,85,54,-6,-141,19,-19,-19,-6,-55,1,-36,-148,-22,-66,-107,-13,-197,-36,39,117,94,31,-20,94,238,48,-18,-41,-9,-1,-24,-30,9,-6,232,-16,-16,79,-27,13,-15,-15,194,223,344,212,-33,13,49,136,-5,-7,227,-82,-42,155,65,86,-24,71,-38,-38,-10,-209,17,0,-41,-19,-87,-36,-18,-108,69,-38,-11,-25,-31,70,-10,135,62,-133,85,-1,-10,-14,-97,82,-5,-16,-81,-390,-83,-1,-35,-27,-115,-92,-4,130,145,-337,0,-1,-59,-32,-120,169,14,-34,25,-14,-30,7,-24,59,-5,35,-8,-11,-11,155,179,100,80,17,-6,-5,-46,-1,566,396,41,-13,-63,-10,53,60,253,820,325,202,-120,-23,18,-136,-42,6,-85,-26,-54,-60,0,14,-26,144,-24,-84,-12,-37,-37,25,134,157,-3,181,-23,-64,34,-10,53,-122,126,173,277,-323,-76,11,-8,-31,0,-5,156,-40,202,47,-33,22,-88,-127,-89,-171,-4,186,213,-24,-1,0,-17,-34,80,155,-53,-51,-113,-57,-36,-2,73,24,65,36,-21,191,-12,-42,-13,-16,-18,-13,90,541,125,-39,-1,-398,-43,-65,-496,-1,-11,-35,-21,-4,-68,-56,-78,66,-19,-51,51,39,330,-34,-173,11,18,-7,-24,-51,400,-19,173,-54,-208,-48,-29,-184,-34,-234,-26,178,178,-2,-63,-54,-71,-58,-91,-154,69,-40,-59,-136,-55,-122,-3,-18,-27,-203,-33,15,84,-10,-13,82,-93,317,0,215,80,37|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,50,10,10,10,10,10,60,10,10,10,10,60,10,10,10,20,50,10,10,10,70,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,20,10,30,10,10,10,10,30,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,30,10,10,10,20,50,10,10,10,20,10,30,10,10,10,10,10,10,10,30,10,10,10,10,20,10,10,20,10,10,10,30,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,10,50,10,10,10,10,60,10,10,10,10,60,10,10,10,10,50,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,40,10,10,10,10,20,30,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,50,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,50,10,10,10,10,10,10,40,10,10,10,10,10,60,10,10,10,10,10,10,30,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,60,20,10,10|-506,-65,-264,-239,-206,-1,45,-58,-192,-202,-134,-214,-304,-117,-129,-70,-148,-46,-2,-77,-253,-532,-138,-73,-6,-23,-6,-50,-94,-286,-213,-271,-190,107,150,-25,-46,-49,-121,-52,-166,-98,-54,-58,-100,-18,206,265,-58,-6,-137,163,-26,-152,-24,-52,3,-80,-71,-4,-20,-51,-42,-74,-111,93,-81,70,47,-51,-5,-93,-74,-139,-119,-11,-51,-17,438,252,-95,-52,-194,-175,-78,-285,-129,-310,-82,-75,-199,-36,-142,-186,-328,-371,-157,-57,175,0,-4,-142,-150,-36,-175,-22,-101,66,69,298,-39,-18,-37,100,-38,226,-50,-74,0,-58,-86,-80,-1,-104,153,62,-67,0,81,212,4,134,74,-121,-100,83,-2,94,-43,-36,-8,-27,2,-56,-8,-85,-35,-2,23,108,-15,452,-28,-15,-15,-60,-64,180,-98,64,-26,719,19,-91,-67,-149,-14,206,131,-201,276,319,185,-46,-176,-259,-57,-213,-149,-57,-96,-79,133,123,-13,-79,-164,-38,-68,69,-10,-19,-17,93,-20,-9,-61,-2,-19,-63,-164,-182,-16,-35,-115,-52,-4,-6,-28,-19,-162,-58,140,-30,26,49,-47,-78,-2,343,274,62,-61,-190,-1,-105,-98,-112,246,-98,-103,-165,-282,-5,-2,-142,-133,-41,-48,-23,-84,-250,-22,114,286,-22,-217,-149,-47,-135,-255,-26,-42,246,267,-130,-1,-32,-14,-50,-322,-62,-20,-135,-38,-51,-46,86,-23,-110,-155,-49,-9,14,-22,-23,135,-96,-51,-132,87,175,139,-14,-51,-53,-38,132,149,47,-97,-86,-65,-26,-70,-48,-11,-76,35,-149,-343,-163,-101,35,-4,-32,-3,-229,-102,-353,-94,-59,-157,-86,-22,-129,190,137,-79,-41,-136,-26,-10,-97,107,1,-56,-37,-35,-23,84,78,0,-9,75,-40,-41,-53,-23,80,88,-75,-114,-10,80,-21,-151,-67,-29,-87,-71,-42,-12,-67,-93,-47,-165,-98,-8,219,216,109,-9,-48,-161,-55,-83,9,-15,220,142,119,-24,-76,-97,-3,-57,-6,39,-7,-118,-186,-60,-10,-82,-50,-204,-47,-185,40,20,-83,-54,-9,55,-177,-18,289,568,228,15,-119,-172,-90,-35,-70,16,-51,-116,-43,-109,-32,-20,-14,-13,-142,-26,-36,-43,-81,-91,98,-27,155,130,-6,-26,-52,147,128,0,-74,-20,-149,-41,303,508,-21,-45,66,-130,-53,-69,657,105,104,-85,-95,-27,-8,-125,-268,312,-72,223,-78,-11,-79,-208,-147,-61,-505,-5,-4,-1,-10,-175,-259,-142,-178,-11,-102,72,83,306,-1,-5,-9,-72,-57,-5,-13,-119,239,776,567,46,-5,-53,-79,-25,-71,-24,93,-35,-10,-29,-160,-36,13,195,-34,80,-41,-2,-86,-116,-49,-1,-98,-52,-18,-36,-82,92,25,-3,158,-47,-56,-16,-61,118,450,-44,-132,-21,-28,-212,-202,-66,-25,-116,-228,-2,-140,-394,-10,-230,-120,32,-134,-140,-199,-99,-29,-437,-68,-32,-89,-134,-3,-28,-38,-3,-3,-521,-50,-66,-66,-24,-63,-74,-110,-80,-23,-4,-7,-21,-7,-73,-138,-29,-240,-109,-69,-77,-91,-10,-6,-26,-134,-82,-79,-92,-52,-112,69,-74,-89,-40,-8,-164,-271,-192,-45,110,246,-33,-83,-2,-59,-75,-9,-157,671,-43,-2,-9,39,-164,-85,-59,-84,-72,-83,-195,-180,36,-42,-37,-73,-58,-214,-78,-93,146,-27,-49,-5,-97,-31,-5,109,-111,-28,-36,-41,-90,-45,-123,-279,-338,-11,-150,-5,-72,-44,-7,-99,12,-279,-61,70,-173,-12,-45,-30,-19,-168,14,-231,-149,-58,-36,-84,-250,-160,-111,-28,-38,-129,-27,-116,-26,-409,-240,-89,-135,-64,-87,-95,-9,-65,-3,-7,-97,-203,-165,-52,-59,-41,-18,-7,-56,254,-44,-71,-40,207,-9,-41,-7,-85,-243,-18,-13,-67,-17,-41,-57,-1,-20,-20,-105,-120,-51,-29,-117,-72,-30,-44,-52,-33,-29,-172,-5,-28,-114,176,-14,-24,-137,-3,-157,18,-4,-194,-55,-159,-100,-195,-148,-60,-221,-46,-65,-5,-96,-10,-23,-17,-264,-79,-72,-70,-9,-45,-19,-15,196,262,-6,-207,17,-29,210,209,816,1000,84,-169,-112,-34,-3,-207,-92,-29,-61,0,209,-223,-91,-13,-5,-154,-124,-200,-64,22,-59,-58,-37
BINANCE:BTCUSD
BTCUSD|20121220|20221220|0.475,0.011,0.0,-0.003,0.0,0.881,0.013,0.0,-0.001,0.0|1.25,0.06,0.0,-0.022,0.0,-0.475,0.024,0.0,0.01,0.0|-0.077,0.46,0.0,0.231,0.0,0.015,0.566,0.0,0.169,0.0|0.034,-0.184,0.0,0.618,0.0,-0.004,-0.174,0.0,0.73,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,90,50,120,20,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,40,20,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,40,10,10,10,10,10,10,20,20,10,10,20,10,10,10,10,10,50,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,20,10,60,10,10,10,10,10,10,10,30,10,10,20,30,10,10,20,30,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,50,10,10,10,10,10,50,10,20,10,10,60,10,10,10,10,20,10,20,10,10,10,10,10,20,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,50,10,10,30,60,10,20,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,20,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10|48,-117,85,77,-23,-43,-130,-18,-95,-108,-79,-29,-6,-14,-71,-12,-20,-101,-109,-202,-33,39,-52,-66,-249,-74,-47,-266,-10,-27,-9,-1,-15,-17,-4,-63,-115,-37,36,-4,-10,-32,-29,-15,-62,-219,-132,-6,-9,-76,-35,-47,-82,-36,-82,-117,-33,-1,-6,23,108,-52,-84,-3,-285,18,186,378,124,-135,79,-172,21,299,-34,-16,-3,-53,-209,-10,-14,85,-4,-105,-14,-101,-159,-319,-67,69,45,-18,-63,-202,-30,-142,-504,-125,14,74,-2,-6,-13,1,-8,-187,-8,-9,-5,-66,-102,12,-49,77,-58,-238,-41,-7,0,-117,-6,-53,-60,-32,-81,-414,-426,-139,-11,-139,-48,38,-7,170,-515,-442,-24,89,134,-21,-11,-155,102,-121,13,70,-10,-138,-62,-148,-323,-72,-4,-67,384,-183,-75,-18,51,52,0,11,97,1000,184,-6,18,-93,69,-25,42,267,-76,-45,-226,-81,57,20,22,-50,8,-113,-11,-6,79,-11,28,27,87,-14,5,23,-2,3,-2,145,84,66,-32,-42,52,-60,36,-18,-34,-107,63,-198,-551,-189,-3,227,28,-127,-4,-41,127,-176,-1,-95,35,27,152,42,42,43,41,-73,13,-108,-140,-24,60,40,-5,-20,-79,-230,-245,-5,-26,-6,36,33,-1,15,-23,-31,-193,21,-15,24,30,43,-14,26,-11,121,139,199,-53,-31,14,74,77,112,268,-63,2,156,308,76,17,0,14,4,0,11,343,-36,14,-87,-171,-2,41,-75,-33,-646,-1298,-725,32,37,-232,-119,-353,-25,-9,-401,-4,12,45,111,53,-83,-118,-81,-52,-5,-18,-16,21,43,50,105,-26,0,-19,-67,-9,47,-2,0,-3,10,-3,-2,-21,-19,-1,12,-8,8,33,54,64,19,-33,-27,-86,-85,44,46,-11,59,75,0,12,-2,-1,5,-2,186,69,-21,-8,-22,73,5,7,0,128,-6,-90,44,-28,34,-388,-235,89,40,-138,-378,-147,-76,51,65,222,-5,53,51,68,-53,58,-63,-5,-11,-5,-7,10,4,63,137,40,234,141,-18,-9,-5,-73,-46,36,44,21,23,-4,-33,-9,0,-27,-1,-4,5,-140,-7,-2,-4,0,-8,92,-1,-48,-26,-70,-78,-78,11,-63,0,-4,0,48,48,-1,72,281,-4,-1,-1,76,143,18,167,57,40,-8,-11,-7,-5,69,63,84,415,64,45,-109,-40,-27,-16,65,63,-49,66,53,56,56,-6,3,-7,-6,-8,35,44,56,-2,54,65,180,0,61,42,43,-24,-18,81,43,-12,10,32,-3,6,39,37,-35,-164,-68,-25,97,96,69,-6,-99,-7,-3,-6,-158,66,37,74,-70,32,59,-94,-136,-65,-60,-11,-2,58,63,53,-16,-3,-86,-43,-75,-4,52,64,70,68,-15,35,-28,-37,0,-3,10,-14,63,-5,21,-20,-74,-67,-86,-7,35,-13,-8,41,31,65,154,62,-11,-19,33,39,37,29,21,42,39,467,6,58,55,41,23,10,50,61,-29,7,7,-53,-78,21,11,56,-50,-56,-18,14,29,49,23,59,45,41,-31,-16,-2,32,-118,-27,51,15,-19,47,-1,94,-1,-155,-77,-26,-11,-20,39,51,-12,114,-10,-201,-164,-97,-36,-4,0,-35,45,-2,-27,-21,-34,-234,0,29,-8,-5,71,62,-41,-4,-30,-21,-10,-2,56,-23,14,-11,49,-25,6,60,71,71,22,-7,-4,-8,14,14,-317,-7,228,55,99,-92,-14,-8,-65,-368,-134,-76,33,55,-4,-12,-20,80,-46,2,104,57,185,140,-3,25,-22,-51,-18,-21,68,-53,22,140,125,-30,-1,81,-22,-20,-75,-42,-19,0,18,-1,-1,56,21,-22,-18,-41,48,0,29,-11,-6,-55,-18,-21,-41,-194,-99,56,129,-2,15,-1,-17,-47,-10,131,49,-30,-105,-116,-1,57,0,-3,-20,-17,62,68,-20,30,-5,-28,-91,-171,-74,-69,22,36,-19,61,-8,-110,-33,-77,-18,-205,-106,27,-25,62,-121,-150,-65,-6,72,72,57,5,36,0,-31,-17,145,-4,88,-30,75,85,39,38,-5,33,-5,-9,-2,-188,-48,29,32,-25,36,-2,-59,2,-9,11,-33,49,-15,-14,-31,-211,-122,-20,-12,-67,-32,-1,42,-8,-75,-43,-2,0,78,-14,17,-136,253,-31,-101,-380,-105,-1,42,23,-4,-46,-46,64,-7,-38,-22,37,44,37,-32,-43,-58,37,27,-7,-11,14,109,56,-13,-5|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,20,10,10,10,90,20,30,140,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,30,20,10,10,10,10,10,10,10,10,50,20,20,10,20,20,10,10,10,10,10,10,10,10,10,10,10,30,20,10,10,10,10,10,40,10,10,10,10,10,10,20,20,10,10,20,10,10,20,10,20,30,10,20,10,10,40,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,40,10,10,10,10,10,10,20,20,10,10,10,10,10,10,20,10,30,10,20,30,10,10,50,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,50,10,10,10,10,10,20,10,20,10,10,10,10,10,20,10,10,20,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,50,10,10,20,10,60,10,20,10,10,10,30,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,30,10,10,10,20,10,10,10,20,10,10,10,10,10,10,10,10,20,20,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,20,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,30,10,10,10,10,10,10,30,10,10,10,10,10,10,10,20,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,40,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,20,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10|-97,-25,-103,-109,-104,-28,-6,167,37,-29,-123,-107,-11,-10,-21,-17,21,34,28,-2,-33,-7,44,95,83,109,64,-123,-118,-1,-13,55,2,-17,50,8,-34,-26,-24,-89,-17,-16,-24,55,38,29,-22,-14,-32,-12,-1,77,-3,44,47,-25,-29,-2,26,71,27,21,52,-108,-82,-86,-30,104,46,-39,-99,-64,-12,-179,63,47,-20,-49,-6,-28,-6,-3,-5,-4,17,59,-16,-16,-1,33,91,47,-10,25,96,59,-92,-62,-25,-6,44,-2,-6,-95,-18,-56,-12,-36,-42,-11,-12,36,40,-39,-44,0,173,58,-20,-4,22,49,62,77,-46,-14,-24,108,-10,-127,-8,66,-13,-42,-139,-82,-17,52,-125,0,-20,-23,76,97,57,44,50,50,65,51,78,11,-160,43,120,-50,-57,-10,17,50,-11,-124,-139,-42,-21,-53,29,30,-10,-97,-49,-3,-15,-7,79,1000,-5,-17,0,-9,-40,-24,40,-8,-14,-9,0,-21,-11,-12,173,105,-12,63,-10,52,-6,294,338,-14,-94,-65,-19,-50,-64,-6,-1,-97,329,30,-36,-25,-22,-112,-65,-65,-9,250,110,0,57,16,-56,-51,-9,25,185,-26,33,66,1,212,-44,-7,-20,67,50,-68,46,-23,36,34,5,-30,-84,81,-27,-31,-60,-4,-8,58,-23,-15,4,-34,-12,70,27,-58,10,-3,-5,-44,-2,28,-5,-2,-22,-6,-6,-3,42,-3,57,-3,3,66,351,16,187,48,-190,-104,-261,-132,-5,123,141,17,32,87,25,64,-51,-273,-135,57,-32,324,150,115,-4,-15,-168,-195,-63,-2,20,4,-65,4,-25,-170,-28,-30,15,-13,51,11,18,32,-14,-35,-144,-1,-60,-18,-79,-7,-76,19,-9,25,-52,0,-42,-10,-2,32,69,-16,-11,16,-8,-8,-1,-15,46,49,65,-1,-5,-9,-6,-16,41,43,-1,32,-22,-73,-3,0,-1,-63,-21,91,-59,-32,-37,-8,15,-9,-49,-209,-58,-47,-66,-60,-33,-12,-104,-1,-81,-31,-156,-2,-40,-6,-13,92,-3,-2,31,-118,-331,-166,-25,-32,44,120,-3,16,38,2,-48,-3,10,-7,36,-60,-25,-20,-19,68,39,39,24,-1,49,22,-20,33,-73,-98,5,-5,14,2,-12,-357,-40,-19,-3,0,-19,-6,20,-19,-138,-24,-158,-92,0,0,-28,-23,-13,-56,19,-21,-14,-43,22,-212,-104,-137,-74,-12,8,-13,-9,-109,-166,-293,-170,-54,-210,-99,-37,-98,-339,-215,-42,-3,-317,-450,-125,-77,-76,29,-4,-7,-45,-45,-95,63,106,-8,-51,-113,-107,-7,107,110,66,-168,101,-84,-21,-58,36,-34,-4,2,119,123,22,-2,-627,-75,-33,-14,79,28,0,-17,-111,-350,-234,-40,13,0,-6,-7,-373,-73,-99,-40,0,0,51,31,11,-29,-11,-11,-141,-40,31,-47,-12,-76,-22,-17,-58,-58,-196,-110,-186,-43,-30,-117,-17,12,-315,-148,-165,-11,-165,-287,-154,-20,0,-23,83,-90,-6,50,-190,-9,0,-3,-133,-101,-155,-71,-57,-57,-19,-4,143,-148,-226,-125,-22,-67,-52,-6,-109,16,-64,53,22,-72,-161,-116,-429,-126,-1,-20,-76,-5,41,22,-3,24,-111,-32,-86,31,-29,24,25,-7,-180,-142,-80,-294,-24,23,-2,-52,-34,-95,-29,-30,12,-6,71,-25,-5,-13,-11,-37,-14,-26,27,8,109,-1,127,38,-91,35,0,-24,-3,-3,-36,-21,0,124,-50,-183,0,-96,-7,-7,-10,-141,-256,-356,-322,-103,-2,-89,12,129,70,0,31,-45,-114,-48,-19,-88,-75,-2,-54,-1,8,69,38,-13,-61,-4,-63,55,34,-5,-11,0,-1,-14,6,-27,-76,-62,53,43,67,-4,48,-9,117,-36,-56,-17,-19,44,17,0,-19,-4,-6,-33,-6,63,278,-10,30,61,-1,-42,-5,-14,-3,-5,-1,-11,63,-2,-37,-128,-7,91,370,51,-12,-21,52,-2,-89,13,-21,129,26,52,55,-7,14,-62,-277,-196,-83,0,26,14,23,-11,-5,-64,-33,-20,-35,-1,-10,-13,-19,-9,-68,-17,-1,53,-9,45,-15,-11,-77,42,46,-6,-43,-28,-25,-21,-7,-14,31,41,33,-9,-20,338,594,182,-7,-2,12,27,2,90,-1,66,19,65,0,-44,40,8,77,67,-20,-13,23,42,8,-56,-25,-15,26,-79,-73,-201,-86,-8,-88,-113,-34,-32,64,-45,-9,-151,-7,17
OANDA:USDCAD :
USDCAD|20121220|20221220|0.503,-0.128,0.0,-0.383,0.0,1.0,-0.149,0.0,-0.22,0.0|1.151,0.499,0.0,-0.351,0.0,-0.492,0.163,0.0,-0.233,0.0|-0.723,0.493,0.0,-0.209,0.0,0.369,0.723,0.0,-0.206,0.0|0.373,0.141,0.0,0.498,0.0,0.214,0.334,0.0,0.23,0.0|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20|53,-18,-312,-155,-60,-19,-11,-17,-6,-66,-2,-12,-35,22,49,-61,-15,235,-24,-79,-44,62,136,41,16,310,123,148,104,-47,114,159,300,229,82,58,-10,0,-5,-13,-37,-103,891,1000,-3,-47,-123,-19,86,155,-4,-71,-54,-22,-13,-16,-134,-29,71,87,35,-113,-20,-7,-21,-13,-7,279,28,57,8,-32,-54,56,-63,-34,3,-3,69,29,13,18,45,-86,-124,-8,8,-7,-54,-3,42,0,-17,31,-10,-4,-37,-40,-49,-4,-88,69,-42,-6,54,-49,11,-5,-9,116,26,19,33,28,-123,-159,-20,19,24,67,30,132,206,41,33,-100,35,71,5,15,102,136,115,49,-43,59,95,51,51,349,282,88,70,-29,-11,113,51,-7,-12,-28,96,-10,-44,-35,4,104,75,-7,-6,-16,-48,-52,-23,-25,-1,154,-25,25,-116,-18,-34,-43,-55,-3,36,134,68,0,-11,40,-5,-105,-62,-39,-7,47,65,63,39,14,48,-33,-28,-27,16,-132,3,103,-6,196,35,90,23,-8,-35,-29,-2,67,-12,631,142,75,-17,-5,-53,-42,-236,-85,249,150,40,33,71,-15,56,-14,84,-35,41,19,9,0,-54,-14,-16,78,-4,93,86,95,-50,97,-142,19,116,-68,-2,-73,325,0,-53,-29,-291,-65,36,-12,-62,-183,-34,39,62,-16,-22,-5,-13,103,-35,-60,-18,8,-6,41,40,-3,105,-36,-3,0,-16,-65,102,-31,-36,-32,-30,72,-62,63,-22,-11,38,37,-8,-76,-120,-66,87,62,-6,-45,68,-16,-32,-28,-195,63,-3,65,74,-2,-87,-1,-156,-473,-97,-59,156,-53,67,174,-86,30,-13,-25,-77,-1,67,46,59,-33,121,-2,-59,48,-95,-198,-99,19,-8,-101,75,31,5,-29,-236,-198,-223,-25,-95,-111,-42,-13,-5,36,-3,-17,-324,-153,-156,-25,-27,-13,14,92,-6,-8,-16,-5,-26,79,72,-31,4,140,-31,-27,-7,-40,-16,-7,34,-6,-20,90,-47,-12,-11,98,-15,-13,-92,-24,15,-33,-52,-117,-7,123,-24,-3,-57,19,17,-42,-86,-23,63,-34,51,-11,-40,-2,20,-51,-98,-210,31,-83,-102,-15,51,-29,0,-3,-297,-7,36,-32,-35,83,-35,-134,-141,-157,-151,-56,73,-22,-25,-4,75,-84,-152,-1,-150,-28,-80,15,2,-135,-27,-7,-6,0,-17,-12,-3,-3,-13,-10,-2,-1,-3,16,-70,-11,-9,71,-147,36,136,-45,-38,77,-5,55,-44,-5,-5,-19,51,-4,-12,-46,-9,-33,14,-43,-14,-57,-9,-15,-113,46,31,33,84,-63,-51,10,-202,-23,25,-3,122,170,-81,-104,-32,64,-78,-8,-38,95,-19,-64,-197,-77,-133,-29,-10,-32,-43,-55,115,24,-89,-89,-31,-24,-17,-73,-171,-22,49,12,-7,63,92,52,-50,-45,-58,-6,-16,-45,-18,21,-37,-42,-24,-93,-219,-17,-7,37,-9,-24,-30,0,-46,-102,-173,-16,65,-1,-34,1,-4,-8,-77,-66,-216,-14,54,-30,-11,-39,-2,-44,-119,8,-56,-106,64,-12,-16,0,-148,-53,79,-20,-56,-34,50,-23,-37,-136,-28,-14,-20,68,153,60,-7,-50,-6,-80,-46,47,-17,-116,135,113,-8,-162,-276,-107,-75,12,-114,-29,291,25,-9,61,-239,-33,-28,-30,-33,-10,57,49,-11,-1,-18,-26,-14,-31,-160,62,-55,44,38,36,-1,-13,-54,-129,-107,-6,-21,-104,-3,-22,-15,50,-19,-10,-97,-37,-8,-2,-47,-2,-55,-127,-85,-45,-44,-16,-61,-25,-44,-4,-16,-63,-4,-26,-66,-57,-9,46,28,-8,-11,-3,27,-75,-102,-51,-53,-19,22,41,-41,-6,-1,-18,-96,-4,-4,-22,-50,-1,-138,-16,53,-122,-349,-70,-20,-51,-46,-197,-14,-87,-21,-35,-243,95,61,-28,-5,-92,-53,-2,-43,-34,-35,-135,12,-12,-19,-63,-124,0,-40,-10,-32,10,-35,-29,-2,-60,-364,-19,71,-7,0,39,-131,-8,-59,-18,-16,-136,-17,-7,-4,-65,-37,-4,-26,48,11,-23,-201,-61,-12,-109,-10,3,-2,-5,558,12,-216,-21,44,-148,-1,-2,-61,54,185,-9,-1,14,-48,-86,-73,-17,-173,-96,148,110,-18,-66,-249,-46,-152,-41,-12,-71,-255,-28,-20,-29,-517,-25,0,-9,-1,-4,-16,-198,-39,-3,-29,-16,80,-8,-21,-16,-24,-331,-123,-45,-52,35,50,-18,-41,-3,9,48,131,-23,-21,-8,-14,-65,-21,-105,-15,-59,63,-2,-30,-23,-79,-5,0,-5,-149,-50,-51,26,-44,-24,-58,-19,-54,0,-109,-39,-149,-66,-40,-80,-110,-4,-5,-30,107,-11,-228,-13,17,-11,-33,47,-1,-5,151,-2,-26,-3,39,-72,-181,-5,-33,9,73,74,-26,-72,-3,-4,-19,-2,-37,64,-16,-36,-20,-5,-20,-96,-120,-80,25,-24,-4,-29,-31,87,-55,-28,-15,-60,-9,-116,-271,-307,-147,-23,-14,-8,44,-15,-15,-17,-9,-18,-141,-64,-59,-133,11,-126,-42,65,-33,72,38,-70,-24,-79,49,25,-151,-2,-48,-38,41,-27,-3,-2,-19,-3,-108,-9,-84,-150,-118,-65,-286,-111,-8,165,-45,110,137,-6,-19,-55,-52,60,5,48,270,89,105|0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,30,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,20,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10|-161,-70,111,67,-162,-38,-90,-134,18,-63,-66,-87,-33,-3,-13,-54,-58,-233,-88,-17,-144,-177,-76,-79,-8,-59,-151,-318,-62,-381,-113,0,-845,-93,-218,-81,-74,-190,-100,-41,10,-193,-1207,-87,-32,130,93,-349,-449,-205,-43,129,-269,-147,171,-7,125,-31,-392,-476,-200,58,144,-10,-37,-505,-28,-20,117,-20,266,-7,-46,-173,79,-206,-22,-361,-110,-158,-2,-108,-532,-90,-81,66,65,-7,-115,-85,-8,-11,-66,-68,20,-36,-72,-68,-4,-65,-40,-232,77,127,-116,87,-27,-23,-150,-47,-8,35,-54,-223,26,-251,-1,-364,-188,-109,-187,-137,-111,-228,-262,26,-193,-258,-8,-55,-252,0,-43,-807,-691,-642,-4,-25,-50,-2,-103,-613,-211,-357,-2,-11,-40,-175,-278,-110,34,-7,-556,-21,-29,-43,0,-245,-363,-4,-73,61,-9,-275,-329,-190,-58,-199,374,-15,-11,-43,-35,-187,-49,-212,-167,-495,-327,-48,102,-13,-184,-28,-185,-75,-416,-389,-204,-270,-172,-98,-33,-11,-637,-78,-142,-159,-32,-15,-10,104,-49,100,-252,-103,-58,-63,-245,-21,140,157,149,-46,-160,-203,100,29,-297,-220,58,160,-315,-51,-149,-22,23,-83,-282,47,-118,-143,-56,544,-40,-139,-582,-175,-272,-145,-54,-102,-301,-158,-26,-206,-466,-149,-304,-22,-16,-289,-8,247,112,197,-412,-33,91,100,129,113,-153,-223,0,-263,-34,-26,-274,293,-91,-739,-945,-260,-22,-9,-208,-205,-13,-198,-207,-220,-686,-126,-208,121,-496,-353,-686,-96,-413,-8,0,-411,-34,-126,181,52,-404,-416,-398,1,-237,-815,-38,117,77,-19,-22,71,119,-158,-2,-27,-56,182,-50,-87,-167,-751,-282,-416,-302,-11,-174,-153,-83,-57,-104,-24,-236,-568,-224,-60,-95,-97,-98,-175,-83,-343,-128,-166,-115,-75,-64,-28,-55,-216,232,-21,-153,-280,112,219,-29,-8,-40,-176,-60,192,108,-118,-531,-528,263,9,-60,-251,-115,-2,-177,-228,-903,-597,-168,-83,-284,-43,27,-134,-15,-146,-1055,-307,-5,-151,-146,-256,-4,-44,-164,-29,-75,-38,126,-38,-68,-423,-178,-231,-10,86,-56,-134,-14,-4,154,-149,-136,141,39,95,-16,-102,90,-14,-118,-92,-228,-253,-165,-269,53,-200,-248,-271,318,-405,-292,-131,-56,-236,-498,-487,-119,-230,154,134,-272,-59,152,-230,-228,-330,205,-85,-177,-95,-16,-74,-101,-271,-3,-143,-237,-326,-55,118,140,-56,-356,-292,-101,108,-15,-374,134,-84,426,-51,-216,-474,-667,-42,-70,-177,-16,-38,-154,-37,-91,-472,-450,-302,23,386,-216,-143,-112,-96,-51,-399,-13,-14,-9,-17,-711,-460,-572,-249,-228,-115,-38,-35,57,-71,-90,-864,-215,132,90,93,-29,-5,-20,282,-162,-293,-6,40,136,-116,-17,68,-165,18,-175,-107,-368,200,-4,-285,-743,-361,-234,79,-149,-313,-71,144,-780,-406,-839,-77,-121,90,-48,-5,-87,-57,-137,-321,-597,-258,-64,222,-148,96,-279,-369,-10,-62,-112,-32,-106,98,-15,-39,-483,-47,-2,-47,51,81,-32,147,-11,-249,-319,-277,-189,-45,289,155,-5,-7,-200,-43,-863,-25,-64,454,143,-131,-48,-637,-257,-21,36,813,371,64,0,46,-162,-805,-550,-5,83,198,0,-234,-523,-299,-484,-424,-200,-96,101,182,-6,-101,-84,-101,-63,-130,-130,-143,-192,-276,-394,-64,-265,-42,-19,-283,-77,-94,-300,-205,-164,-408,93,381,-65,-59,-527,-362,-109,-70,-62,401,700,-246,-63,-153,-203,-112,162,-32,-31,-93,-38,-100,-203,-73,-8,-90,-241,-80,-99,45,188,-64,-282,-33,-187,-58,-151,-11,-11,155,-28,-20,-102,-5,-65,-241,96,-117,223,155,-14,-90,105,-148,318,-91,66,-85,105,-9,111,-263,-56,113,156,197,-32,-263,-424,-314,-113,-205,-342,-33,-29,240,-27,-14,-268,-37,-203,-1085,-66,-267,-650,-525,-20,-16,-96,140,-52,-22,-51,-305,-40,-141,-44,-5,90,-65,-72,-28,-160,-147,-198,-1,82,-32,304,-55,-129,-23,-213,-2,-17,-14,-14,50,999,-132,-58,-97,-54,-145,59,-120,-130,375,368,484,-60,-149,-404,-27,-61,-165,210,106,-74,-161,240,-231,-74,-103,-23,-6,128,-10,-180,-439,187,328,153,280,-13,-75,236,-5,-28,-42,139,109,-9,-38,-19,141,-62,-83,-279,-163,-825,-10,69,-63,56,-73,141,188,139,-1774,-2845,-281,-2,-58,-14,-81,-36,196,89,-118,-319,-31,53,-45,-4,-82,-361,-25,-149,-263,-23,-49,-128,60,-82,-79,-97,-93,395,-1,-42,21,-22,-55,-247,0,164,258,912,-182,183,-78,-4,170,-51,-45,345,565,190,331,176,-380,-7,84,-46,-186,-200,112,-7,-72,66,-128,-82,-21,-34,-185,-1,-150,-93,-3,116,-5,-64,-18,-105,-87,-131,-77,-73,-57,137,-46,-8,-164,-101,-62,-108,-142,18,-35,-83,-5,77,-13,133,-1,83,-16,-72,-127,-87,-52,-26,-29,0,-50,87,103,-9,-206,27,-191,-54,-285,-255,-261,-197,-1,170,-64,-87,-42,-12,-133,-328,-293,-419,-110,-109,-39,115,56,-183,-3,-367,-159,-162,92,-17,-25,-91,-18,-19,-61,282,-28,-108,338,-107,110,-125,-163,-66,-242,-294,-667,-416,-435,-2,-43,-43,-295,-10,-105,-203,-133,-149
For more models, see a link on bio (description length limitation in this description restricts me to publish more).
Unimportant details
===============
“Neon” is the project code name, “J” is the iteration (versions “A” to “I” all led to a solid “J”)
Formatting options here make formatting very difficult, so forgive me poor readability.