ANN Trend PredictionThis trend indicator utilizes an artificial neural network (ANN) to predict the next market reversal within a certain range of previous candles. The larger the range of previous candles you set, the fewer reversals will be predicted, and trends will tend to last longer.
The ANN is trained on the BTCUSD 4-hour chart, so using it on other assets or timeframes may yield suboptimal results. It takes three input values: the closing price, the Stochastic RSI, and a Choppiness Indicator. Based on these inputs, the ANN categorizes the current candle as part of an uptrend, downtrend, or as undefined.
Compared to an EMA-based trend indicator, this ANN identifies reversals several candles earlier. It achieves this by detecting subtle patterns in the input values that typically appear before a market turnaround. These patterns are somewhat specific to that chosen asset and timeframe.
The results are displayed using rows of triangles that indicate the predicted price direction. The price levels of the triangles correspond to the closing price at the last reversal. The area between the triangle row and the price is colored green if the ANN correctly predicted the move, and red if it did not.
This indicator is designed to showcase the capabilities and potential of ANNs, and is not intended for actual trading use. The ANN can be trained on any other input values, assets and timeframes for several predictions tasks.
You can use the Predicted_Trend_Signal of this Indicator in any backtest indicator. In the Backtester just grap the Predicted_Trend_Signal. downtrend = 1, uptrend = -1, undefined = 0
Feel free to write me a comment.
Ann
Machine Learning: Perceptron-based strategyPerceptron-based strategy
Description:
The Learning Perceptron is the simplest possible artificial neural network (ANN), consisting of just a single neuron and capable of learning a certain class of binary classification problems. The idea behind ANNs is that by selecting good values for the weight parameters (and the bias), the ANN can model the relationships between the inputs and some target.
Generally, ANN neurons receive a number of inputs, weight each of those inputs, sum the weights, and then transform that sum using a special function called an activation function. The output of that activation function is then either used as the prediction (in a single neuron model) or is combined with the outputs of other neurons for further use in more complex models.
The purpose of the activation function is to take the input signal (that’s the weighted sum of the inputs and the bias) and turn it into an output signal. Think of this activation function as firing (activating) the neuron when it returns 1, and doing nothing when it returns 0. This sort of computation is accomplished with a function called step function: f(z) = {1 if z > 0 else 0}. This function then transforms any weighted sum of the inputs and converts it into a binary output (either 1 or 0). The trick to making this useful is finding (learning) a set of weights that lead to good predictions using this activation function.
Training our perceptron is simply a matter of initializing the weights to zero (or random value) and then implementing the perceptron learning rule, which just updates the weights based on the error of each observation with the current weights. This has the effect of moving the classifier’s decision boundary in the direction that would have helped it classify the last observation correctly. This is achieved via a for loop which iterates over each observation, making a prediction of each observation, calculating the error of that prediction and then updating the weights accordingly. In this way, weights are gradually updated until they converge. Each sweep through the training data is called an epoch.
In this script the perceptron is retrained on each new bar trying to classify this bar by drawing the moving average curve above or below the bar.
This script was tested with BTCUSD, USDJPY, and EURUSD.
Note: TradingViews's playback feature helps to see this strategy in action.
Warning: Signals ARE repainting.
Style tags: Trend Following, Trend Analysis
Asset class: Equities, Futures, ETFs, Currencies and Commodities
Dataset: FX Minutes/Hours+/Days
Free Lunch : ANN EOS Arbitrage ToolHello, this system is an arbitrage tool created with ANN (Artificial Neural Networks).
The main feature that makes it useful is:
You don't need to sell in another market!
According to these differences, you can sell it in your market.
Since volume is also used in ANN formulation, it does not work on charts without volume data.
It gives the most accurate results in these markets because the system has been prepared according to the data of these markets :
COINBASE
BITFINEX
BITTREX
OKCOIN
BINANCE
POLONIEX
OKEX
BITTREX
HUOBI
HITBTC
BINANCE
POLONIEX
Important note: Most of the differences here occur during live trading.
There are very few opportunities to hang around after the closure.
These differences will close in a few seconds, a few minutes, a few hours.
Differences usually close in a few seconds.
For this reason, it is necessary to be very fast!
Since it is a very small but guaranteed strategy, this strategy benefits in large capitals.
These system is valid only on EOS .
Respects.
Free Lunch : ANN BCH Arbitrage ToolHello, this system is an arbitrage tool created with ANN (Artificial Neural Networks).
The main feature that makes it useful is:
You don't need to sell in another market!
According to these differences, you can sell it in your market.
Since volume is also used in ANN formulation, it does not work on charts without volume data.
It gives the most accurate results in these markets because the system has been prepared according to the data of these markets :
COINBASE
BITSTAMP
BITTREX
CEXIO
OKCOIN
BINANCE
OKEX
BITTREX
HUOBI
HITBTC
BINANCE
Important note: Most of the differences here occur during live trading.
There are very few opportunities to hang around after the closure.
These differences will close in a few seconds, a few minutes, a few hours.
Differences usually close in a few seconds.
For this reason, it is necessary to be very fast!
Since it is a very small but guaranteed strategy, this strategy benefits in large capitals.
These system is valid only on Bitcoin Cash .
Respects.
Free Lunch : ANN LTC Arbitrage Tool Hello, this system is an arbitrage tool created with ANN (Artificial Neural Networks).
The main feature that makes it useful is:
You don't need to sell in another market!
According to these differences, you can sell it in your market.
Since volume is also used in ANN formulation, it does not work on charts without volume data.
It gives the most accurate results in these markets because the system has been prepared according to the data of these markets :
COINBASE
BITSTAMP
BITFINEX
BITTREX
OKCOIN
BINANCE
POLONIEX
OKEX
BITTREX
HUOBI
HITBTC
BINANCE
POLONIEX
Important note: Most of the differences here occur during live operation.
There are very few opportunities to hang around after the closure.
These differences will close in a few seconds, a few minutes, a few hours.
Differences usually close in a few seconds.
For this reason, it is necessary to be very fast!
Since it is a very small but guaranteed strategy, this strategy benefits in large capitals.
These system is valid only on Litecoin .
Respects.
Free Lunch : ANN XRP Arbitrage ToolHello, this system is an arbitrage tool created with ANN (Artificial Neural Networks).
The main feature that makes it useful is:
You don't need to sell in another market!
According to these differences, you can sell it in your market.
Since volume is also used in ANN formulation, it does not work on charts without volume data.
It gives the most accurate results in these markets because the system has been prepared according to the data of these markets.
COINBASE
BITSTAMP
BITFINEX
BITTREX
OKCOIN
BINANCE
POLONIEX
OKEX
BITTREX
HUOBI
HITBTC
BINANCE
POLONIEX
Important note: Most of the differences here occur during live operation.
There are very few opportunities to hang around after the closure.
These differences will close in a few seconds, a few minutes, a few hours.
Differences usually close in a few seconds.
For this reason, it is necessary to be very fast!
Since it is a very small but guaranteed strategy, this strategy benefits in large capitals.
These system is valid only on Ripple .
Respects.
Free Lunch : ANN Ethereum Arbitrage ToolHello, this system is an arbitrage tool created with ANN (Artificial Neural Networks).
The main feature that makes it useful is:
You don't need to sell in another market!
According to these differences, you can sell it in your market.
Since volume is also used in ANN formulation, it does not work on charts without volume data.
It gives the most accurate results in these markets because the system has been prepared according to the data of these markets.
COINBASE
BITSTAMP
BITFINEX
BITTREX
CEXIO
OKCOIN
BINANCE
POLONIEX
OKEX
BITTREX
HUOBI
HITBTC
BINANCE
COINBASE
POLONIEX
HITBTC
Important note: Most of the differences here occur during live operation.
There are very few opportunities to hang around after the closure.
These differences will close in a few seconds, a few minutes, a few hours.
Differences usually close in a few seconds.
For this reason, it is necessary to be very fast!
Since it is a very small but guaranteed strategy, this strategy benefits in large capitals.
These system is valid only on Ethereum .
Respects.
Free Lunch : ANN BTC ArbitrageHello, this system is an arbitrage tool created with ANN (Artificial Neural Networks).
The main feature that makes it useful is:
You don't need to sell in another market!
According to these differences, you can sell it in your market.
Since volume is also used in ANN formulation, it does not work on charts without volume data.
It gives the most accurate results in these markets because the system has been prepared according to the data of these markets.
COINBASE
BITSTAMP
BITFINEX
BITTREX
CEXIO
OKCOIN
BINANCE
POLONIEX
OKEX
BITTREX
HUOBI
HITBTC
BINANCE
COINBASE
POLONIEX
HITBTC
Important note: Most of the differences here occur during live operation.
There are very few opportunities to hang around after the closure.
These differences will close in a few seconds, a few minutes, a few hours.
It usually closes in a few seconds.
For this reason, it is necessary to be very fast.
Since it is a very small but guaranteed strategy, this strategy benefits in large capitals.
These system is valid only on Bitcoin.
Respects.
Autonomouscript
Hello friends, in this script, hand drawing and loyalty to terminals are minimized.
***FEATURES
1 - Rational Auto Support and Resistance Levels
NOTE : For 1W TF , you can take 0.000 - 1.000 for 1 area , i didn't find to necessary to autoplot this condition because of between levels are so large and for long term.
Multi time-frame
In small time frames, unreasonable support eliminates resistance levels.
Suitable for every pair.
If the prices change by region, automatic drawing is made in the new region and given to the screen.
Automatic Plotting Feature
Rational Levels
2 - Auto Risk/Reward Ratio Calculator
Calculations are made according to support and resistance in less than 4 hours TF.
The opposite is true for Short.
2 methods in 4 hours and larger time frames and two zones specified:
1. Price < 0.618 Level :
Long Position Calculation : From Current Support to 0.618 Level
Short Position Calculation: From Current Resistance to 0.000 Level
2. Price > 0.618 Level
Long Position Calculation :Support and 1.000 Level .
Short Position Calculation : Resistance and 0.000 Level
Risk/Reward Ratio Calculation Examples (TF = Timeframe) :
1 - TF < 4H and Long - Short Risk/Reward Ratio Calculation :
For Long Position :
For Short Position :
2 - TF > 4H and Long-Short Risk/Reward Ratio Calculation :
For Long Position :
For Short Position :
NOTE :
Some algorithms have been added to make this formulation accurate and safe.
Therefore, Stop-Loss can be flexed slightly under the support or on the resistance in short position.
The target does not change.
Staying on the safe side calculates the risk / reward ratio for the worst possible odds.
*** Since stop-loss levels are chosen close to support and resistance and determine financial leverage, there is absolutely no need for stop-loss, the investor can determine himself according to the risk / reward ratio.
Generally, the support is slightly lower for long and the resistance slightly reasonable for short.
3 - Moving Averages and Cloud
a-) Slow Moving Average (Fuchsia)
Uses Autonomous LSTM moving average for external timeframes of 1W, Relativity moving average for timeframes 1W and above.
NOTE : They are built on price instead of Stochastic Money Flow Index.
And because they are price based
The High-Low Selection Algorithm has been removed.
For more information :
Autonomous LSTM =>
Relativity =>
b-) Signal Moving Average (Blue)
I just added this average after long tests.
It was created based on the relative states of the Relativity and Autonomous LSTM and candle states.
It is very fast and adaptive but, you should definitely use the risk / reward ratio if you are going to trade just by looking at it.
c_) Cloud :
It is the region between fast and slow moving average.
Cloud Color : Red for : crossunder(price , signal ma) and Green for : crossover(price,signal ma)
d-) Plotarrows :
Plotted after crossover and crossunder closings to inform the intersection of the two adaptive moving averages.
e*) Triangle Shapes :
They only reports when the moving average of the signal is long and short. And cloud color is same but without risk/reward radio rule.Rules :
Blue : Long Condition with Long Risk/Reward Ratio < 2.5
Orange : Short Condition with Short Risk/Reward Ratio < 2.5
Green : Long Condition with Long Risk/Reward Ratio >= 2.5
Red : Short Condition with Short Risk/Reward Ratio >= 2.5
4 - INFOPANEL - Trader Panel
- Calculation results of Risk / Reward Ratios for each bar for Long and Short Position
- Current Support and Resistance Levels
- Percentage change of the price moving average (period = signal period) only in the signal period
* Percentage change of the volume moving average (period = signal period) only in the signal period
* Supply and Demand Bias :
They are given separately for both long and short (Bull - Bear).
It is the reflection of the quantum formulas that form the core of relativity.
Nevertheless, the signal moving averages data price and volume are also above in InfoPanel.
Important Note : Two starred rules are given to investors and traders to choose between the following facts :
Increasing Volume __ Increasing Price = > Healthy Bear Session
Increasing Price __ Increasing Volume = > Healthy Bull Session
Decreasing Volume __ Increasing Price = > Bulls are weakening
Decreasing Volume __ Decreasing Price = > Bears are weakening
*** SUMMARY AND USAGE :
NOTES
It's definitely not just for signals,
all data in the system
evaluating according to the current economic agenda,
carry out your trade like that.
You can zoom in using the zoom in zoom out feature (+) of Tradingview, especially in small timeframes.
And according to the signal average of the price, cloud coloring was made in green and red.
Because in some cases, infopanel can intervene and block small triangles.
Alerts :
There is no need for any precise alert.
In case of need, users can set alarms at support and resistance levels.
NOTE :
In the design and basic cases of support and resistance levels,inspired by borserman's this script:
Special thanks to him.
Last Note and Reminder
This script may will be updated in terms of design and simplification if deemed necessary.
Best regards.
Candlesticks ANN for Stock Markets TF : 1WHello, this script consists of training candlesticks with Artificial Neural Networks (ANN).
In addition to the first series, candlesticks' bodies and wicks were also introduced as training inputs.
The inputs are individually trained to find the relationship between the subsequent historical value of all candlestick values 1.(High,Low,Close,Open)
The outputs are adapted to the current values with a simple forecast code.
Once the OHLC value is found, the exponential moving averages of 5 and 20 periods are used.
Reminder : OHLC = (Open + High + Close + Low ) / 4
First version :
Script is designed for S&P 500 Indices,Funds,ETFs, especially S&P 500 Stocks,and for all liquid Stocks all around the World.
NOTE: This script is only suitable for 1W time-frame for Stocks.
The average training error rates are less than 5 per thousand for each candlestick variable. (Average Error < 0.005 )
I've just finished it and haven't tested it in detail.
So let's use it carefully as a supporter.
Best regards !
ANN Next Coming Candlestick Forecast SPX 1D v1.0WARNING:
Experimental and incomplete.
Script is open to development and will be developed.
This is just version 1.0
STRUCTURE
This script is trained according to the open, close, high and low values of the bars.
It is tried to predict the future values of opening, closing, high and low values.
A few simple codes were used to correlate expectation with current values. (You can see between line 129 - 159 )
Therefore, they are all individually trained.
You can see in functions.
The average training error of each variable is less than 0.011.
NOTE :
This script is designed for experimental use on S & P 500 and connected instruments only on 1-day bars.
The Plotcandle function is inspired by the following script of alexgrover :
Since we estimate the next values, our error rates should be much lower for all candlestick values. This is just first version to show logic.
I will continue to look for other variables to reach average error = 0.001 - 0.005 for each candlestick status.
Feel free to use and improve , this is open-source.
Best regards.
ANN BTC MTF Golden Cross Period MACDHi, this is the MACD version of the ANN BTC Multi Timeframe Script.
The MACD Periods were approximated to the Golden Cross values.
MACD Lengths :
Signal Length = 25
Fast Length = 50
Slow Length = 200
Regards.
ANN BTC MTF CM Sling Shot SystemHi all, this script was created as a result of ANN training in all time frames of bitcoin data.
Trained data is built on Chris Moody's Sling Shot system.
CM Sling Shot System :
This system automatically generates the ANN output for all time periods.
Therefore, it has multi-time-frame feature.
Artificial Neural Networks training details:
Average Errors
1 minute = 0.005570
3 minutes = 0.006674
5 minutes = 0.007067
15 minutes = 0.010000
30 minutes = 0.009398
45 minutes = 0.010000
1 Hour = 0.006848
2 Hours = 0.006901
3 Hours = 0.009608
4 Hours = 0.009774
1 Day = 0.010000
1 Week = 0.010000
The results look good (All Average Error <= 0.01 ), the Sling Shot Method is also good, but you can also refer to historically slower period averages to filter these arrows a bit more. I leave the decision to you.
Best regards.
Relativity Adaptive Stop-LossRelativity Adaptive Stop-Loss is a stop-loss technique that uses the Relativity Autonomous Distribution Blocks algorithm.
For detailed info about Relativity Autonomous Distribution Blocks :
*** Features
This structure is different from standard stop-losses.
The base frame is based on "Market Adaptive Stop-Loss" script.
For detailed information about Market Adaptive Stop-Loss:
This script uses the Relativity Autonomous Distribution Blocks as cross method.
Tradeable / Non Tradeable Region Detector :
This script separates tradeable and non-tradeable regions with a coloring method.
Plotting Rules :
* Maroon : Uncorfirmed Short Positions
* Teal : Unconfirmed Long Positions
* Green : Confirmed Long Positions
* Red : Confirmed Short Positions
This script can be used in only 1W time frame. (TF = 1W )
Does not repaint on 1W and larger time frames. ( Source = close )
*** Settings :
The only option here is the ATR multiplier.
The default use value of this ATR multiplier, which is of the standard of stop-loss, is 2.You can set it from the menu.
No alert is set.
Because the positive and negative regions are the same as Relativity Autonomous Distribution Blocks.
Since the traders can trade according to the support and resistance outside the definite regions, the unnecessary signal was confused and the alerts were removed.
*** USAGE
The Stop-Loss indicator can slide on the chart.
So you have to make sure you put it in right place.
Using this script in a new pane below will radically solve slip problems.
Stop-Loss values do not slip definitely.The values can select from the alignment.
NOTE :
Some structures (Market Adaptive Stop-Loss) and design in this script are inspired by everget's Chandelier Exit script :
Best regards.
Relativity Autonomous Distribution Blocks
The relativity method is a method of trade inspired by the Theory of Relativity of Albert Einstein , which argues that trade is a relative concept and, according to the case it advocates, creates the values to be evaluated relatively by using various engineering methods, and converts these values to factors to ensure the highest efficiency.
Many layers are common with Autonomous LSTM.
For more information about Autonomous LSTM :
But there are additional layers that are much higher than that.
These systems use COT (Commitment of Traders) data positively in trade and significantly increase the hit rate compared to conventional methods.
And in all traded instruments, it decides the degree of scoring by linking with global markets.
The more liquidity of the selected parities, the higher the success rate, the higher liquidity in the markets.
***STRUCTURE
Feature Layer 1 : Formulation : Common Layer with Autonomous LSTM
Feature Layer 2: Forecast Algorithm : Common Layer with Autonomous LSTM
Feature Layer 3 : Composite of Two Layers : Adaptive Period (Length) Algorithm : Common Layer with Autonomous LSTM
Feature Layer 4 : High - Low Selection Algorithm : Common Layer with Autonomous LSTM
Feature Layer 5 : Volume (Ticker ) - Open Interest (Global Market) Power Factor according to Global Markets and Related instrument (Ticker)
Feature Layer 6 : Quantum Equations including COT Commercial Positions (Communicate with layer 5)
Feature Layer 7 : World's Price/Earnings Ratio (This layer is automatically added to layer 6 as a factor each week.)
Feature Layer 8 : Distribution Blocks : The design of script as a histogram, with distributional buying and selling points and positive/negative zone coloring, with alerts.
Uses the relativity algorithm. This will contribute not only to leveraged transactions but also to portfolio management and will give a more realistic perspective.
Informs the trading points within the regions.
In this way, it allows for gradual buying and selling and reduces the risk to a much lower level.
These feature allows a difference perspective especially for traders who act with portfolio logic and / or add regular income.
The educational idea I shared in order to set an example for this logic:
***SETTINGS
Menu
1. * Market Type
The menu is divided into 5 different algorithms and covers all instruments around the world.
For example:
Futures : XAUUSD , GC , XAGUSD , SUGARUSD , SB1! , XAGUSD
Stocks : All Stocks and Modified Parities (Example : AAPL/EUR , XAU/XAG , AAPL , MT , BAC)
Forex Excluding USD/X : CHFUSD , EURUSD , EURJPY , AUDNZD
Forex USD/X : USDJPY , USDTRY , USDMXN
Crypto : BTCUSD , ETHUSD , ADAUSD or BTCETH , ETHBTC
2. * Barcolor
Barcolor Plotting Rules : On / off section with these rules when barcolor on :
Orange : Distributional Sell Signal ( Not Short )
Blue : Distributinaol Buy Signal
*** FEATURES
Indicator Features :
Red Background with Cross : Short Signal
Green Background with Cross : Buy Signal
Blue Histogram Color : Distributional Buy Signal
Orange Histogram Color : Distributional Sell Signal
Alerts
Long Alert
Short Alert
Distributional Buy Alert
Distributional Sell Alert
*** USAGE
Since the script uses various Commitment of Traders data, it is designed only for the weekly time frame. ( TF = 1W )
Script does not repaint 1 Week and above time frames . (Source = close )
NOTE :
The script design was inspired by one of RafaelZioni's script :
Best regards.
Autonomous LSTM Stop-LossStructure
Autonomous LSTM Stop-Loss is a stop-loss technique that uses the Autonomous LSTM algorithm.
For detailed info about Autonomous LSTM :
*** Features
This structure is different from standard stop-losses.
The base frame is based on "Market Adaptive Stop-Loss" script.
For detailed information about Market Adaptive Stop-Loss:
This script uses the Autonomous LSTM as cross method.
Tradeable / Non Tradeable Region Detector :
This script separates tradeable and non-tradeable regions with a coloring method.
Plotting Rules :
* Maroon : Uncorfirmed Short Positions
* Teal : Unconfirmed Long Positions
* Green : Confirmed Long Positions
* Red : Confirmed Short Positions
This script can be used in all time frames.
Does not repaint. ( Source = close )
*** Settings :
The only option here is the ATR multiplier.
The default use value of this ATR multiplier, which is of the standard of stop-loss, is 2.You can set it from the menu.
No alert is set.
Because the positive and negative regions are the same as Autonomous LSTM.
Since the traders can trade according to the support and resistance outside the definite regions, the unnecessary signal was confused and the alerts were removed.
*** Usage
The Stop-Loss indicator can slide on the chart.
So you have to make sure you put it in place.
Since this is a region scan from the OHLC levels, indicator contains small blue dots to the ohlc levels and made it serve as a guide.
However, since we cannot know the OHLC values precisely, it is best to use them as follows:
Because it is often forgotten to put it in place:
(OHLC : Average of Open, High, Low, and Closing prices for each period)
Using this script in a new pane below will radically solve slip problems.
Stop-Loss values do not slip definitely.The values are selected from the alignment.
NOTE :
Some structures (Market Adaptive Stop-Loss) and design in this script are inspired by everget's Chandelier Exit script :
Best regards.
Autonomous LSTM [Noldo] Structure
Feature Layer 1 : Formulation :
The Autonomous LSTM adaptive period equation is a multivariate equation created by averaging a table based on market weights and optimizing it for each time period, by specially Artificial Neural Networks (ANN) training and taking note of the instruments chosen from Foreign exchange instruments, Stock markets , Futures and Commodities , Interest Rates and Yields all over the Global Markets.
Market weights and liquidities were taken into consideration and included in the calculations.
Feature Layer 2: Forecast Algorithm :
When we apply only the first item, we only get the buy and sell signals in reverse.
In other words, since we measure the expectation, the positive signal informs the bear market and the negative scenario informs the bull market.
If we only act according to the expectations market, our system will be very sensitive.
When we associate this with real prices, both our accuracy increases and the reverse market returns to the normal market.
In other words, as in the indicators with standard average, the upward crosses are buy and the downward crosses are sell signal.
Examples:
a -) The normal deep learning script (ANN), which is only created according to expectations:
Unlike standard market, it gives reverse signals.
Original script :
b-) Script with Forecast Algorithm but it only uses valid and standard periods for certain instruments :
Original script :
Feature Layer 3 : Composite of Two Layers : Adaptive Period (Length) Algorithm
This layer is the most important layer.
Outputs the period.
It adjusts itself to market conditions and provides a more agile trading environment under all circumstances.
Display of smart period function and standard period :
Where the market is stagnant, the period increases automatically and reduces unnecessary trade, while in trendy markets the period decreases automatically and allows to see positions first.
The degree of stagnation of the instrument concerned is not calculated solely by volatility.
We may perceive this in relation to several factors, but yes volatility is one of these factors.
When we put the script system under the MACD (Moving Average Convergence Divergence) roof, I did the tests.
Where both averages were positive, they could report accurate harsh trend news, or vice versa.
But I decided to give it up and put it on the Stochastic Money Flow Index .
First of all , Stochastic Money Flow Index function takes the volume into account.
The reason for this is a very important factor, which is naturally contained in the structure of High - Low conditions related codes.
And by using this factor, it could be superfast adaptive in both stagnant and trendy markets.
Feature Layer 4 : High - Low Selection Algorithm
The High-Low Selection Algorithm does not depend on a specific period but scans all periods backwards.(Lookback Function - Lkb )
Outputs the lowest or highest values in the specified new period.
This algorithm was written by me with the concern that if everyone trades according to the same threshold values, it will cause problems and choosing between values of the whole period length will slow down the signals.
This algorithm consists of two functions.
a - Lkb (Lookback Function) :
The lookback function scans back all periods from 0 to Smart Period bars at the same time.
In order to show the effect of the function, it was done between 0 and 84 bars.
However, the scan period of the function is normally at the same time: 0 to adaptive period time.
If the adaptive period includes a fractional day, it can also scan it.
There is no need to be an integer.
All functions are written to make mutable variables appropriate.
And what this function will scan depends on the second feature.
The special selection algorithm is in this function.And the output is given in this function.
b-) High - Low Selection Algorithm
Outputs the lowest or highest values in the specified new period.
This function allows you to select the most advantageous low or high values, even though the adaptive period remains the same.
And the signals are even more accurate.
This is a comparison of the High-Low selection algorithm and the Function: Stochastic Money Flow Index in the standard period.
For the codes of the Stochastic Money Flow Index function:
Speed may not be clear here.
So let's take a look at on chart.
So I would like to show a comparison values of the standard and special selection algorithms on Standard Highest - Lowest Function (All effort goes to RicardoSantos)
Note: This function is the standard function and freed from integer loads.
Blue = Function Highest - Lowest (length = 10 )
Yellow = Smart High-Low Selection Algorithm (length = 10 )
You can better observe the different results in the same period on the chart.
***
4 layers are interdependent.
And when the inter-layer operations are completed, output is given.
*** - Usage of Autonomous LSTM
Plot Rules
Blue Zones = Crossover condition where the average of long and short lines is less than 50.
Orange Zones = Crossunder condition where long and short lines averages more than 50.
Green Zones = Crossover condition where the average of long and short lines is greater than 50.
Red Zones = Crossunder condition where long and short lines averages less than 50.
*** Autonomous LSTM Settings :
It is just the barcolor to be colored according to the crossover and crossunder conditions or not (I / 0) option.
*** Autonomous LSTM Alerts :
As an alert, it only reports crossover and crossunder status as "Long Signal" and "Short Signal" as a warning after the first bar closure.
*** CONCLUSION :
Autonomous LSTM Designed to be used in any time frame.
Does not repaint in any time frame.
Script is independent of constant coefficients.No period adjustment is necessary.
Each layer transfers the information in its own layer to the next layer and the results are reflected in the Stochastic Money Flow Index function built on the resultant.
Regards.
Macroeconomic Artificial Neural Networks
This script was created by training 20 selected macroeconomic data to construct artificial neural networks on the S&P 500 index.
No technical analysis data were used.
The average error rate is 0.01.
In this respect, there is a strong relationship between the index and macroeconomic data.
Although it affects the whole world,I personally recommend using it under the following conditions: S&P 500 and related ETFs in 1W time-frame (TF = 1W SPX500USD, SP1!, SPY, SPX etc. )
Macroeconomic Parameters
Effective Federal Funds Rate (FEDFUNDS)
Initial Claims (ICSA)
Civilian Unemployment Rate (UNRATE)
10 Year Treasury Constant Maturity Rate (DGS10)
Gross Domestic Product , 1 Decimal (GDP)
Trade Weighted US Dollar Index : Major Currencies (DTWEXM)
Consumer Price Index For All Urban Consumers (CPIAUCSL)
M1 Money Stock (M1)
M2 Money Stock (M2)
2 - Year Treasury Constant Maturity Rate (DGS2)
30 Year Treasury Constant Maturity Rate (DGS30)
Industrial Production Index (INDPRO)
5-Year Treasury Constant Maturity Rate (FRED : DGS5)
Light Weight Vehicle Sales: Autos and Light Trucks (ALTSALES)
Civilian Employment Population Ratio (EMRATIO)
Capacity Utilization (TOTAL INDUSTRY) (TCU)
Average (Mean) Duration Of Unemployment (UEMPMEAN)
Manufacturing Employment Index (MAN_EMPL)
Manufacturers' New Orders (NEWORDER)
ISM Manufacturing Index (MAN : PMI)
Artificial Neural Network (ANN) Training Details :
Learning cycles: 16231
AutoSave cycles: 100
Grid
Input columns: 19
Output columns: 1
Excluded columns: 0
Training example rows: 998
Validating example rows: 0
Querying example rows: 0
Excluded example rows: 0
Duplicated example rows: 0
Network
Input nodes connected: 19
Hidden layer 1 nodes: 2
Hidden layer 2 nodes: 0
Hidden layer 3 nodes: 0
Output nodes: 1
Controls
Learning rate: 0.1000
Momentum: 0.8000 (Optimized)
Target error: 0.0100
Training error: 0.010000
NOTE : Alerts added . The red histogram represents the bear market and the green histogram represents the bull market.
Bars subject to region changes are shown as background colors. (Teal = Bull , Maroon = Bear Market )
I hope it will be useful in your studies and analysis, regards.
Blockchain Artificial Neural NetworksI found a very high correlation in a research-based Artificial Neural Networks.(ANN)
Trained only on daily bars with blockchain data and Bitcoin closing price.
NOTE: It does not repaint strictly during the weekly time frame. (TF = 1W)
Use only for Bitcoin .
Blockchain data can be repainted in the daily time zone according to the description time.
Alarms are available.
And you can also paint bar colors from the menu by region.
After making reminders, let's share the details of this interesting research:
INPUTS :
1. Average Block Size
2. Api Blockchain Size
3. Miners Revenue
4. Hash Rate
5. Bitcoin Cost Per Transaction
6. Bitcoin USD Exchange Trade Volume
7. Bitcoin Total Number of Transactions
OUTPUTS :
1. One day next price close (Historical)
TRAINING DETAILS :
Learning cycles: 1096436
AutoSave cycles: 100
Grid :
Input columns: 7
Output columns: 1
Excluded columns: 0
Training example rows: 446
Validating example rows: 0
Querying example rows: 0
Excluded example rows: 0
Duplicated example rows: 0
Network :
Input nodes connected: 7
Hidden layer 1 nodes: 5
Hidden layer 2 nodes: 0
Hidden layer 3 nodes: 0
Output nodes: 1
Controls :
Learning rate: 0.1000
Momentum: 0.8000
Target error: 0.0100
Training error: 0.010571
The average training error is really low, almost worth the target.
Without using technical analysis data, we established Artificial Neural Networks with blockchain data.
Interesting!
ANN Forecast Dependent Variable Odd GeneratorHello , this script is the ANN Forecast version of my "Dependent Variable Odd Generator " script.
I went to simplify a bit because the deep learning calculations are too much for this command.
The latest instruments included:
WTI : West Texas Intermediate (WTICOUSD , USOIL , CL1! ) Average error : 0.007593
BRENT : Brent Crude Oil ( BCOUSD , UKOIL , BB1! ) Average error : 0.006591
GOLD : XAUUSD , GOLD , GC1! Average error : 0.012767
SP500 : S&P 500 Index ( SPX500USD , SP1! ) Average error : 0.011650
EURUSD : Eurodollar ( EURUSD , 6E1! , FCEU1!) Average error : 0.005500
ETHUSD : Ethereum ( ETHUSD , ETHUSDT ) Average error : 0.009378
BTCUSD : Bitcoin ( BTCUSD , BTCUSDT , XBTUSD , BTC1! ) Average error : 0.01050
GBPUSD : British Pound ( GBPUSD , 6B1! , GBP1!) Average error : 0.009999
USDJPY : US Dollar / Japanese Yen ( USDJPY , FCUY1!) Average error : 0.009198
USDCHF : US Dollar / Swiss Franc ( USDCHF , FCUF1! ) Average error : 0.009999
USDCAD : Us Dollar / Canadian Dollar ( USDCAD ) Average error : 0.012162
VIX : S & P 500 Volatility Index (VX1! , VIX ) Average error : 0.009999
ES : S&P 500 E-Mini Futures ( ES1! ) Average error : 0.010709
SSE : Shangai Stock Exchange Composite (Index ) ( 000001 ) Average error : 0.011287
XRPUSD : Ripple (XRPUSD , XRPUSDT ) Average error : 0.009803
Simply select the required instrument from the tradingview analysis screen, then add this command and select the same instrument from the settings section.
The codes are not open-source because they contain forecast algorithm codes a little that I will use commercially in the future.
However, I will never remove this script, and you can use it for free unlimitedly.
For more information about my artificial neural network forecast series:
For more information about my dependent variable odd generator :
For more information about simple artificial neural networks :
(detailed information about ANN )
(25 in 1 version )
I hope it helps in your analysis. Regards , Noldo .
NOTE : In the first pass bar of the definite positive and negative zone, alerts are added for both conditions.
Easy Loot BandsEasy Loot Bollinger Bands:
This indicator is a bollinger band that also auto-generates a trendline, giving you the best opportunities to buy & sell. That's it.
You can use this on any time-frame, any stock, and any cryptocurrency.
NAND PerceptronExperimental NAND Perceptron based upon Python template that aims to predict NAND Gate Outputs. A Perceptron is one of the foundational building blocks of nearly all advanced Neural Network layers and models for Algo trading and Machine Learning.
The goal behind this script was threefold:
To prove and demonstrate that an ACTUAL working neural net can be implemented in Pine, even if incomplete.
To pave the way for other traders and coders to iterate on this script and push the boundaries of Tradingview strategies and indicators.
To see if a self-contained neural network component for parameter optimization within Pinescript was hypothetically possible.
NOTE: This is a highly experimental proof of concept - this is NOT a ready-made template to include or integrate into existing strategies and indicators, yet (emphasis YET - neural networks have a lot of potential utility and potential when utilized and implemented properly).
Hardcoded NAND Gate outputs with Bias column (X0):
// NAND Gate + X0 Bias and Y-true
// X0 // X1 // X2 // Y
// 1 // 0 // 0 // 1
// 1 // 0 // 1 // 1
// 1 // 1 // 0 // 1
// 1 // 1 // 1 // 0
Column X0 is bias feature/input
Column X1 and X2 are the NAND Gate
Column Y is the y-true values for the NAND gate
yhat is the prediction at that timestep
F0,F1,F2,F3 are the Dot products of the Weights (W0,W1,W2) and the input features (X0,X1,X2)
Learning rate and activation function threshold are enabled by default as input parameters
Uncomment sections for more training iterations/epochs:
Loop optimizations would be amazing to have for a selectable length for training iterations/epochs but I'm not sure if it's possible in Pine with how this script is structured.
Error metrics and loss have not been implemented due to difficulty with script length and iterations vs epochs - I haven't been able to configure the input parameters to successfully predict the right values for all four y-true values for the NAND gate (only been able to get 3/4; If you're able to get all four predictions to be correct, let me know, please).
// //---- REFERENCE for final output
// A3 := 1, y0 true
// B3 := 1, y1 true
// C3 := 1, y2 true
// D3 := 0, y3 true
PLEASE READ: Source article/template and main code reference:
towardsdatascience.com
towardsdatascience.com
towardsdatascience.com
ANN Forecast Stochastic Oscillator [Noldo] In this script, I tried to integrate ANN Forecast Algorithm on Stochastic Oscillator.
It took me quite a while, but i guess it worth.
After selecting the ticker, select the instrument from the menu and the system will automatically turn on the appropriate Forecast Stoch system.
The system is trained with ANN values of ANN MACD 25 in 1.
The Forecast algorithm is not open-source.
But I'm never remove this script.
You can use it forever for free.
As you can see in the presentation, although it is in the same period, it is more accurate and agile than standard Stochastic Oscillator .
I think even a bar is important in trade.
For those who don't see that command,listed instruments with alternative tickers and error rates:
WTI : West Texas Intermediate (WTICOUSD , USOIL , CL1! ) Average error : 0.007593
BRENT : Brent Crude Oil ( BCOUSD , UKOIL , BB1! ) Average error : 0.006591
GOLD : XAUUSD , GOLD , GC1! Average error : 0.012767
SP500 : S&P 500 Index ( SPX500USD , SP1! ) Average error : 0.011650
EURUSD : Eurodollar ( EURUSD , 6E1! , FCEU1!) Average error : 0.005500
ETHUSD : Ethereum ( ETHUSD , ETHUSDT ) Average error : 0.009378
BTCUSD : Bitcoin ( BTCUSD , BTCUSDT , XBTUSD , BTC1! ) Average error : 0.01050
GBPUSD : British Pound ( GBPUSD , 6B1! , GBP1!) Average error : 0.009999
USDJPY : US Dollar / Japanese Yen ( USDJPY , FCUY1!) Average error : 0.009198
USDCHF : US Dollar / Swiss Franc ( USDCHF , FCUF1! ) Average error : 0.009999
USDCAD : Us Dollar / Canadian Dollar ( USDCAD ) Average error : 0.012162
SOYBNUSD : Soybean ( SOYBNUSD , ZS1! ) Average error : 0.010000
CORNUSD : Corn ( ZC1! ) Average error : 0.007574
NATGASUSD : Natural Gas ( NATGASUSD , NG1! ) Average error : 0.010000
SUGARUSD : Sugar ( SUGARUSD , SB1! ) Average error : 0.011081
WHEATUSD : Wheat ( WHEATUSD , ZW1! ) Average error : 0.009980
XPTUSD : Platinum ( XPTUSD , PL1! ) Average error : 0.009964
XU030 : Borsa Istanbul 30 Futures ( XU030 , XU030D1! ) Average error : 0.010727
VIX : S & P 500 Volatility Index (VX1! , VIX ) Average error : 0.009999
ES : S&P 500 E-Mini Futures ( ES1! ) Average error : 0.010709
SSE : Shangai Stock Exchange Composite (Index ) ( 000001 ) Average error : 0.011287
XRPUSD : Ripple (XRPUSD , XRPUSDT ) Average error : 0.009803
Extras :
- Crossover and crossunder alerts
- Switchable barcolor
NOTE :
Australian Dollar / US Dollar ( AUDUSD ) removed due to high average error. (Average error > 0.013 )
Timeframe advice :
I suggest you to use that system TF >= 1D
My favorite is 1 week bars. (1W)
More info about forecast series (My last forecast example ) :
Special thanks :
Special thanks to dear wroclai for his great effort .
NOTE : I decided to build Autonomous LSTM on Stochastic Oscillator , i think Stochastic Oscillator one of the best and it contains naturally high-lows.