BTC Pair Change %This script makes it easier to quickly check how the BTC pair of the current symbol is performing on any pair.
It adds a " change percentage widge t" (of the BTC pair ) to the top right of the chart.
(Refer to the image for an example.)
The change percentage calculation is performed as described here:
www.tradingview.com
To match the "Chg%" that appears on TradingView watchlists, a 24H (1440min) timeframe is used, as described here:
money.stackexchange.com
In short, this script:
Searches for the BTC pair of the current symbol
Calculates the change % using the above described logic (links)
Adds a " change percentage widget " (of the BTC pair) to the top right of the chart
Allows for using 24H timeframe or the current timeframe (enable " Use current timeframe " under the script options)
Taux de change (ROC)
Rate of Change Candle Standardized (ROCCS)ROCCS is a standardized rate of change oscillator with "error bars". Rate of change helps traders gauge momentum in a market by comparing the current price with the price "n" periods ago. What makes this special is you get to see the momentum of the momentum via the candle view. The candle transformation utilizes a moving average to smooth the signal however this is only used for the close price. The high and low prices are not smoothed. The moving average has an adjustable period, and so does the standardization.
I hope you can find great use in this upgraded roc indicator.
Adaptive Fisherized ROCIntroduction
Hello community, here I applied the Inverse Fisher Transform, Ehlers dominant cycle determination and smoothing methods on a simple Rate of Change (ROC) indicator
You have a lot of options to adjust the indicator.
Usage
The rate of change is most often used to measure the change in a security's price over time.
That's why it is a momentum indicator.
When it is positive, prices are accelerating upward; when negative, downward.
It is useable on every timeframe and could be a potential filter for you your trading system.
IMO it could help you to confirm entries or find exits (e.g. you have a long open, roc goes negative, you exit).
If you use a trend-following strategy, you could maybe look out for red zones in an in uptrend or green zones in a downtrend to confirm your entry on a pullback.
Signals
ROC above 0 => confirms bullish trend
ROC below 0 => confirms bearish trend
ROC hovers near 0 => price is consolidating
Enjoy! 🚀
[ChasinAlts] The Great Reset Hello fellow tradeurs, "The Great Reset" just tracks the % change of a coin. For whichever reset hour is chosen,
once the reset time is reached the % changes of all the coins reset to 0. This is great to find which coins have
been moving the most and to be able to see how all of them are moving compared to the rest. Once the reset interval
is up and the % change resets to 0, you can see the "*" at the end of the plots and if you hover over it the coin's
name is shown in a tooltip. Lastly, if a threshold of 5 is selected and alerts are also used then it will alert you at that % change
level as well as threshold*2 and threshold*3 so you can be notified if a coin is going on a tear and pumping through those % change
levels (the threshold, threshold*2, and threshold*3 levels are also printed as Hlines on the chart)
There is also the Printed Bar Filter to only show the coins that have been moving the most according to the values set in the filter
(if you choose to use/select to use the filter). This is the same filter on many of my other scripts so as not to
clutter up the chart with coins that have not been moving much. Hope it comes of some use to anyone.
Peace and love people...peace and love. -ChasinAlts
Performance Tablethis scrip is modified of Performance Table () of TradingView user @BeeHolder = Thank u very much.
-
@BeeHolder formula is based on daily basis,
but my calculation is based on respective day, week and month.
-
The formula of the calculation is (Current Close - Previous Close) * 100 / Previous Close, where Past value is:
1D = close 1 day before
5D = close 5 day before
1W - close 1 week before
4W = close 4 week before
1M - close 1 month before
3M - close 3 month before
6M - close 6 month before
12M - close 12 month before
52W - close 52 week before
Also table position cane be set.
thank you all
-
Crypto-DX Crypto Directional Index [chhslai]Crypto-DX can be used to help measure the overall strength and direction of the crypto market trend.
Furthermore, it can be used as a screener to find out cryptocurrencies which are accumulating momentum and tends to potentially pump or dump.
How this indicator works :
If the Crypto-DX cross above the zero-level, it could be an indication that there is a trend reversal into upward. You should close your short position or place a long order right away.
If the Crypto-DX cross below the zero-level, it could be an indication that there is a trend reversal into downward. You should close your long position or place a short order right away.
If the Crypto-DX is consolidated around the zero-level, it could be an indication that the trend may be ended and followed by a sideway market. You are suggested not to place any order and wait for the market moves.
Divergence based trading strategy is fully applicable, just like the MACD.
Screener features :
Plot "Crypto Index" and "5 Custom Crypto"
Plot "Crypto Index" and "Top 30 Crypto"
Clutter Fitler [Loxx]Clutter Fitler is a simple indicator to demonstrate a clutter filter. The purpose of this technique is to filter useless noise.
What is a Clutter Filter?
For our purposes here, this is a filter that compares the slope of the trading filter output to a threshold to determine whether to shift trends. If the slope is up but the slope doesn't exceed the threshold, then the color is gray and this indicates a chop zone. If the slope is down but the slope doesn't exceed the threshold, then the color is gray and this indicates a chop zone. Alternatively if either up or down slope exceeds the threshold then the trend turns green for up and red for down. Fro demonstration purposes, an EMA is used as the moving average. This filtering technique will be used for future indicators.
Included
Bar coloring
HMA Slope Variation [Loxx]HMA Slope Variation is an indicator that uses HMA moving average to calculate a slope that is then weighted to derive a signal.
The center line
The center line changes color depending on the value of the:
Slope
Signal line
Threshold
If the value is above a signal line (it is not visible on the chart) and the threshold is greater than the required, then the main trend becomes up. And reversed for the trend down.
Colors and style of the histogram
The colors and style of the histogram will be drawn if the value is at the right side, if the above described trend "agrees" with the value (above is green or below zero is red) and if the High is higher than the previous High or Low is lower than the previous low, then the according type of histogram is drawn.
What is the Hull Moving Average?
The Hull Moving Average ( HMA ) attempts to minimize the lag of a traditional moving average while retaining the smoothness of the moving average line. Developed by Alan Hull in 2005, this indicator makes use of weighted moving averages to prioritize more recent values and greatly reduce lag.
Included
Alets
Signals
Bar coloring
Loxx's Expanded Source Types
T3 Slope Variation [Loxx]T3 Slope Variation is an indicator that uses T3 moving average to calculate a slope that is then weighted to derive a signal.
The center line
The center line changes color depending on the value of the:
Slope
Signal line
Threshold
If the value is above a signal line (it is not visible on the chart) and the threshold is greater than the required, then the main trend becomes up. And reversed for the trend down.
Colors and style of the histogram
The colors and style of the histogram will be drawn if the value is at the right side, if the above described trend "agrees" with the value (above is green or below zero is red) and if the High is higher than the previous High or Low is lower than the previous low, then the according type of histogram is drawn.
What is the T3 moving average?
Better Moving Averages Tim Tillson
November 1, 1998
Tim Tillson is a software project manager at Hewlett-Packard, with degrees in Mathematics and Computer Science. He has privately traded options and equities for 15 years.
Introduction
"Digital filtering includes the process of smoothing, predicting, differentiating, integrating, separation of signals, and removal of noise from a signal. Thus many people who do such things are actually using digital filters without realizing that they are; being unacquainted with the theory, they neither understand what they have done nor the possibilities of what they might have done."
This quote from R. W. Hamming applies to the vast majority of indicators in technical analysis . Moving averages, be they simple, weighted, or exponential, are lowpass filters; low frequency components in the signal pass through with little attenuation, while high frequencies are severely reduced.
"Oscillator" type indicators (such as MACD , Momentum, Relative Strength Index ) are another type of digital filter called a differentiator.
Tushar Chande has observed that many popular oscillators are highly correlated, which is sensible because they are trying to measure the rate of change of the underlying time series, i.e., are trying to be the first and second derivatives we all learned about in Calculus.
We use moving averages (lowpass filters) in technical analysis to remove the random noise from a time series, to discern the underlying trend or to determine prices at which we will take action. A perfect moving average would have two attributes:
It would be smooth, not sensitive to random noise in the underlying time series. Another way of saying this is that its derivative would not spuriously alternate between positive and negative values.
It would not lag behind the time series it is computed from. Lag, of course, produces late buy or sell signals that kill profits.
The only way one can compute a perfect moving average is to have knowledge of the future, and if we had that, we would buy one lottery ticket a week rather than trade!
Having said this, we can still improve on the conventional simple, weighted, or exponential moving averages. Here's how:
Two Interesting Moving Averages
We will examine two benchmark moving averages based on Linear Regression analysis.
In both cases, a Linear Regression line of length n is fitted to price data.
I call the first moving average ILRS, which stands for Integral of Linear Regression Slope. One simply integrates the slope of a linear regression line as it is successively fitted in a moving window of length n across the data, with the constant of integration being a simple moving average of the first n points. Put another way, the derivative of ILRS is the linear regression slope. Note that ILRS is not the same as a SMA ( simple moving average ) of length n, which is actually the midpoint of the linear regression line as it moves across the data.
We can measure the lag of moving averages with respect to a linear trend by computing how they behave when the input is a line with unit slope. Both SMA (n) and ILRS(n) have lag of n/2, but ILRS is much smoother than SMA .
Our second benchmark moving average is well known, called EPMA or End Point Moving Average. It is the endpoint of the linear regression line of length n as it is fitted across the data. EPMA hugs the data more closely than a simple or exponential moving average of the same length. The price we pay for this is that it is much noisier (less smooth) than ILRS, and it also has the annoying property that it overshoots the data when linear trends are present.
However, EPMA has a lag of 0 with respect to linear input! This makes sense because a linear regression line will fit linear input perfectly, and the endpoint of the LR line will be on the input line.
These two moving averages frame the tradeoffs that we are facing. On one extreme we have ILRS, which is very smooth and has considerable phase lag. EPMA has 0 phase lag, but is too noisy and overshoots. We would like to construct a better moving average which is as smooth as ILRS, but runs closer to where EPMA lies, without the overshoot.
A easy way to attempt this is to split the difference, i.e. use (ILRS(n)+EPMA(n))/2. This will give us a moving average (call it IE /2) which runs in between the two, has phase lag of n/4 but still inherits considerable noise from EPMA. IE /2 is inspirational, however. Can we build something that is comparable, but smoother? Figure 1 shows ILRS, EPMA, and IE /2.
Filter Techniques
Any thoughtful student of filter theory (or resolute experimenter) will have noticed that you can improve the smoothness of a filter by running it through itself multiple times, at the cost of increasing phase lag.
There is a complementary technique (called twicing by J.W. Tukey) which can be used to improve phase lag. If L stands for the operation of running data through a low pass filter, then twicing can be described by:
L' = L(time series) + L(time series - L(time series))
That is, we add a moving average of the difference between the input and the moving average to the moving average. This is algebraically equivalent to:
2L-L(L)
This is the Double Exponential Moving Average or DEMA , popularized by Patrick Mulloy in TASAC (January/February 1994).
In our taxonomy, DEMA has some phase lag (although it exponentially approaches 0) and is somewhat noisy, comparable to IE /2 indicator.
We will use these two techniques to construct our better moving average, after we explore the first one a little more closely.
Fixing Overshoot
An n-day EMA has smoothing constant alpha=2/(n+1) and a lag of (n-1)/2.
Thus EMA (3) has lag 1, and EMA (11) has lag 5. Figure 2 shows that, if I am willing to incur 5 days of lag, I get a smoother moving average if I run EMA (3) through itself 5 times than if I just take EMA (11) once.
This suggests that if EPMA and DEMA have 0 or low lag, why not run fast versions (eg DEMA (3)) through themselves many times to achieve a smooth result? The problem is that multiple runs though these filters increase their tendency to overshoot the data, giving an unusable result. This is because the amplitude response of DEMA and EPMA is greater than 1 at certain frequencies, giving a gain of much greater than 1 at these frequencies when run though themselves multiple times. Figure 3 shows DEMA (7) and EPMA(7) run through themselves 3 times. DEMA^3 has serious overshoot, and EPMA^3 is terrible.
The solution to the overshoot problem is to recall what we are doing with twicing:
DEMA (n) = EMA (n) + EMA (time series - EMA (n))
The second term is adding, in effect, a smooth version of the derivative to the EMA to achieve DEMA . The derivative term determines how hot the moving average's response to linear trends will be. We need to simply turn down the volume to achieve our basic building block:
EMA (n) + EMA (time series - EMA (n))*.7;
This is algebraically the same as:
EMA (n)*1.7-EMA( EMA (n))*.7;
I have chosen .7 as my volume factor, but the general formula (which I call "Generalized Dema") is:
GD (n,v) = EMA (n)*(1+v)-EMA( EMA (n))*v,
Where v ranges between 0 and 1. When v=0, GD is just an EMA , and when v=1, GD is DEMA . In between, GD is a cooler DEMA . By using a value for v less than 1 (I like .7), we cure the multiple DEMA overshoot problem, at the cost of accepting some additional phase delay. Now we can run GD through itself multiple times to define a new, smoother moving average T3 that does not overshoot the data:
T3(n) = GD ( GD ( GD (n)))
In filter theory parlance, T3 is a six-pole non-linear Kalman filter. Kalman filters are ones which use the error (in this case (time series - EMA (n)) to correct themselves. In Technical Analysis , these are called Adaptive Moving Averages; they track the time series more aggressively when it is making large moves.
Included
Alets
Signals
Bar coloring
Loxx's Expanded Source Types
Multi HMA Slopes [Loxx]Multi HMA Slopes is an indicator that checks slopes of 5 (different period) Hull Moving Averages and adds them up to show overall trend. To us this, check for color changes from red to green where there is no red if green is larger than red and there is no red when red is larger than green. When red and green both show up, its a sign of chop.
What is the Hull Moving Average?
The Hull Moving Average (HMA) attempts to minimize the lag of a traditional moving average while retaining the smoothness of the moving average line. Developed by Alan Hull in 2005, this indicator makes use of weighted moving averages to prioritize more recent values and greatly reduce lag.
Included
Signals: long, short, continuation long, continuation short.
Alerts
Bar coloring
Loxx's expanded source types
Multi T3 Slopes [Loxx]Multi T3 Slopes is an indicator that checks slopes of 5 (different period) T3 Moving Averages and adds them up to show overall trend. To us this, check for color changes from red to green where there is no red if green is larger than red and there is no red when red is larger than green. When red and green both show up, its a sign of chop.
What is the T3 moving average?
Better Moving Averages Tim Tillson
November 1, 1998
Tim Tillson is a software project manager at Hewlett-Packard, with degrees in Mathematics and Computer Science. He has privately traded options and equities for 15 years.
Introduction
"Digital filtering includes the process of smoothing, predicting, differentiating, integrating, separation of signals, and removal of noise from a signal. Thus many people who do such things are actually using digital filters without realizing that they are; being unacquainted with the theory, they neither understand what they have done nor the possibilities of what they might have done."
This quote from R. W. Hamming applies to the vast majority of indicators in technical analysis . Moving averages, be they simple, weighted, or exponential, are lowpass filters; low frequency components in the signal pass through with little attenuation, while high frequencies are severely reduced.
"Oscillator" type indicators (such as MACD , Momentum, Relative Strength Index ) are another type of digital filter called a differentiator.
Tushar Chande has observed that many popular oscillators are highly correlated, which is sensible because they are trying to measure the rate of change of the underlying time series, i.e., are trying to be the first and second derivatives we all learned about in Calculus.
We use moving averages (lowpass filters) in technical analysis to remove the random noise from a time series, to discern the underlying trend or to determine prices at which we will take action. A perfect moving average would have two attributes:
It would be smooth, not sensitive to random noise in the underlying time series. Another way of saying this is that its derivative would not spuriously alternate between positive and negative values.
It would not lag behind the time series it is computed from. Lag, of course, produces late buy or sell signals that kill profits.
The only way one can compute a perfect moving average is to have knowledge of the future, and if we had that, we would buy one lottery ticket a week rather than trade!
Having said this, we can still improve on the conventional simple, weighted, or exponential moving averages. Here's how:
Two Interesting Moving Averages
We will examine two benchmark moving averages based on Linear Regression analysis.
In both cases, a Linear Regression line of length n is fitted to price data.
I call the first moving average ILRS, which stands for Integral of Linear Regression Slope. One simply integrates the slope of a linear regression line as it is successively fitted in a moving window of length n across the data, with the constant of integration being a simple moving average of the first n points. Put another way, the derivative of ILRS is the linear regression slope. Note that ILRS is not the same as a SMA ( simple moving average ) of length n, which is actually the midpoint of the linear regression line as it moves across the data.
We can measure the lag of moving averages with respect to a linear trend by computing how they behave when the input is a line with unit slope. Both SMA (n) and ILRS(n) have lag of n/2, but ILRS is much smoother than SMA .
Our second benchmark moving average is well known, called EPMA or End Point Moving Average. It is the endpoint of the linear regression line of length n as it is fitted across the data. EPMA hugs the data more closely than a simple or exponential moving average of the same length. The price we pay for this is that it is much noisier (less smooth) than ILRS, and it also has the annoying property that it overshoots the data when linear trends are present.
However, EPMA has a lag of 0 with respect to linear input! This makes sense because a linear regression line will fit linear input perfectly, and the endpoint of the LR line will be on the input line.
These two moving averages frame the tradeoffs that we are facing. On one extreme we have ILRS, which is very smooth and has considerable phase lag. EPMA has 0 phase lag, but is too noisy and overshoots. We would like to construct a better moving average which is as smooth as ILRS, but runs closer to where EPMA lies, without the overshoot.
A easy way to attempt this is to split the difference, i.e. use (ILRS(n)+EPMA(n))/2. This will give us a moving average (call it IE /2) which runs in between the two, has phase lag of n/4 but still inherits considerable noise from EPMA. IE /2 is inspirational, however. Can we build something that is comparable, but smoother? Figure 1 shows ILRS, EPMA, and IE /2.
Filter Techniques
Any thoughtful student of filter theory (or resolute experimenter) will have noticed that you can improve the smoothness of a filter by running it through itself multiple times, at the cost of increasing phase lag.
There is a complementary technique (called twicing by J.W. Tukey) which can be used to improve phase lag. If L stands for the operation of running data through a low pass filter, then twicing can be described by:
L' = L(time series) + L(time series - L(time series))
That is, we add a moving average of the difference between the input and the moving average to the moving average. This is algebraically equivalent to:
2L-L(L)
This is the Double Exponential Moving Average or DEMA , popularized by Patrick Mulloy in TASAC (January/February 1994).
In our taxonomy, DEMA has some phase lag (although it exponentially approaches 0) and is somewhat noisy, comparable to IE /2 indicator.
We will use these two techniques to construct our better moving average, after we explore the first one a little more closely.
Fixing Overshoot
An n-day EMA has smoothing constant alpha=2/(n+1) and a lag of (n-1)/2.
Thus EMA (3) has lag 1, and EMA (11) has lag 5. Figure 2 shows that, if I am willing to incur 5 days of lag, I get a smoother moving average if I run EMA (3) through itself 5 times than if I just take EMA (11) once.
This suggests that if EPMA and DEMA have 0 or low lag, why not run fast versions (eg DEMA (3)) through themselves many times to achieve a smooth result? The problem is that multiple runs though these filters increase their tendency to overshoot the data, giving an unusable result. This is because the amplitude response of DEMA and EPMA is greater than 1 at certain frequencies, giving a gain of much greater than 1 at these frequencies when run though themselves multiple times. Figure 3 shows DEMA (7) and EPMA(7) run through themselves 3 times. DEMA^3 has serious overshoot, and EPMA^3 is terrible.
The solution to the overshoot problem is to recall what we are doing with twicing:
DEMA (n) = EMA (n) + EMA (time series - EMA (n))
The second term is adding, in effect, a smooth version of the derivative to the EMA to achieve DEMA . The derivative term determines how hot the moving average's response to linear trends will be. We need to simply turn down the volume to achieve our basic building block:
EMA (n) + EMA (time series - EMA (n))*.7;
This is algebraically the same as:
EMA (n)*1.7-EMA( EMA (n))*.7;
I have chosen .7 as my volume factor, but the general formula (which I call "Generalized Dema") is:
GD (n,v) = EMA (n)*(1+v)-EMA( EMA (n))*v,
Where v ranges between 0 and 1. When v=0, GD is just an EMA , and when v=1, GD is DEMA . In between, GD is a cooler DEMA . By using a value for v less than 1 (I like .7), we cure the multiple DEMA overshoot problem, at the cost of accepting some additional phase delay. Now we can run GD through itself multiple times to define a new, smoother moving average T3 that does not overshoot the data:
T3(n) = GD ( GD ( GD (n)))
In filter theory parlance, T3 is a six-pole non-linear Kalman filter. Kalman filters are ones which use the error (in this case (time series - EMA (n)) to correct themselves. In Technical Analysis , these are called Adaptive Moving Averages; they track the time series more aggressively when it is making large moves.
Included
Signals: long, short, continuation long, continuation short.
Alerts
Bar coloring
Loxx's expanded source types
Trade HourThis script is just finds the best hour to buy and sell hour in a day by checking chart movements in past
For example if the red line is on the 0.63 on BTC/USDT chart it mean the start of 12AM hour on a day is the best hour to buy (all based on
It's just for 1 hour time-frame but you can test it on other charts.
IMPORTANT: You can change time Zone in strategy settings.to get the real hours as your location timezone
IMPORTANT: Its for now just for BTC/USDT but you can optimize and test for other charts...
IMPORTANT: A green and red background color calculated for show the user the best places of buy and sell (green : positive signal, red: negative signals)
settings :
timezone : We choice a time frame for our indicator as our geo location
source : A source to calculate rate of change for it
Time Period : Time period of ROC indicator
About Calculations:
1- We first get a plot that just showing the present hour as a zigzag plot
2- So we use an indicator ( Rate of change ) to calculate chart movements as positive and negative numbers. I tested ROC is the best indicator but you can test close-open or real indicator or etc as indicator.
3 - for observe effects of all previous data we should indicator_cum that just a full sum of indicator values.
4- now we need to split this effects to hours and find out which hour is the best place to buy and which is the best for sell. Ok we should just calculate multiple of hour*indicator and get complete sum of it so:
5- we will divide this number to indicator_cum : (indicator_mul_hour_cum) / indicator_cum
6- Now we have the best hour to buy! and for best sell we should just reverse the ROC indicator and recalculate the best hour for it!
7- A green and red background color calculated for show the user the best places of buy and sell that dynamically changing with observing green and red plots(green : positive signal, red: negative signals) when green plot on 15 so each day on hour 15 the background of strategy indicator will change to 15 and if its go upper after some days and reached to 16 the background green color will move to 16 dynamically.
RSI, Stoch Rsi, EMA, SMA, & ROCThis indicator is simply an enhanced version of the RSI followed up by a few extra indicators that pair strongly with the RSI. This indicator allows the user to interact with various inputs based off the indicators provided. All indicators include moving average, relative strength index, stochastic relative strength index, simple moving average, exponential moving average, and rate of change. This program is unique as it is very versatile allowing the user to use as little or as many indicators as needed interchangeably.
Multi-timeframe MomentumThe Multi-timeframe momentum indicator is similar in concept to a velocity indicator like rate-of-change, but visualizes smoothed price changes by applying an EMA and linear regression to price difference at every bar. Momentums from 1 minute to 1 quarter are plotted on a single chart using the request.security function. Standard and Fibonacci timeframes are available as well as the ability to hide high-timeframes to keep the chart clean. Like any oscillator, divergence in the momentums can be used to identify price reversals in conjunction with support and resistance. When linear regression is applied, high and low inflection points are used to identify reversals in a manner similar to MACD.
Much love to DumpCap! The script is presented sans secret sauce.
MZ HTF HFT ROCit Bot - Non Repainting Scalper v1.2 ADX RSI MOM This is a new iteration based on my Momentum trading bot.
This is an original script meant to be a high frequency trader that works on higher time frame calculations.
I came up with the idea that using calculus I can figure out the actual rate of change and momentum with different calculations than the momentum indicator that is provided by trading view. Once momentum is shifted on a small time frame, it will provide an entry signal. The script is meant to be used on an algorithmic trading system for scalping purposes. It should be run on a one minute time frame. Unfortunately due to various plotting constraints in Pinescript, you cannot plot the rate of change and momentum and price in the same pane. To counter this, I have a showdata toggle to give you values of the indicators at each entry.
This version has two main entry settings toggled with a checkbox. There is the ROC (rate of change) version and the MOM (momentum) entry signals.
The rate of change version is meant to take a look at your moving average and try to trigger when it hits a certain rate of change point. This can be helpful if you rather play it safer. I have noticed that you can get slightly better entry points but also does not give you as many entries. The momentum algorithm will give you faster entry points and might work best with a slight offset (use your back test to help you figure it out).
I have started to add tooltips to help you along. If you have suggestions please let me know.
How does it work?
Let's just assume that you are looking at a one minute chart. I recommend using the one minute for bots because it will give you the fastest execution for entries. Pinescript has an issue where the signal is not usually sent until the end of the bar/beginning of next bar. If the signal was triggered at the beginning of a 15 minute bar, it might not actually send the signal until the following 15 minute bar. If you are trading on small time frames, this can make all the difference. If you are using an algo platform that trailing stops, stop losse, take profits, etc. I would recommend you use that platform to close your trade. The close trade message will work, but pinescript does not know the exact entry price you received, so if you are trying to collect small profits, it is best that intermediary platform does that calculation for you. If you are dealing with larger moves, instead of small 1-3% scalps, you are probably fine to use the close message setting from pinescript.
Ok, so to take an example. I like to use the 3L and 3S tokens on Kucoin. This gives you a lot of volatility to work with compared to other tokens and coins. However, it can also meas that you are likely taking a higher risk. However, there are some things that can help with that (more on that later).
So we have a token we want to run, and have it on the 1m chart.
First, be sure that all of your filters are OFF when you start playing with the back test. This allows you to see how to best optimize the bot.
Use the show data to show you additional data when you are backtesting. This can allow you to try to filter out results or market conditions that do not work. I typically work with the RSI and use the 30 minute and 15 minute RSIs. I make sure that it is trading within a certain band - about 40-75. You can try the inverse and only buy during really low RSI's as well.
www.dropbox.com
Find the source of your data with the variant drop down. You can use any time frame, open, close. high, low, olc4. Open is pretty much guaranteed to not have any repainting issues - although all the other calcs use a custom isbarconfirmed security repaint calculation. I have been finding that Open and SMA work well, but feel free to explore. If you use a source like open, close, high, low, etc - the interval will not change anything further. If you use a variant such as an sma, you should try to find an interval that works well for that token. For instance, try an sma of 8-11 minutes and see which gives you the best backtest result without changing anything else. Offset ALMA/LSMA parameters are only used for those specific variants. These specific parameters will also affect the ALMA and LSMA if you use that variant in the trend filter. In other words, you can skip these if you are not using those types of moving averages.
www.dropbox.com
Configure the ROC and MOM intervals. If you are using a source such as open, close, etc- this is where you set the interval for your change. So consider using OHLC4 or a interval of 5 thru 15 and see what works best. The Momentum inverval usually works best in the 2-5 bars. There is a custom calculation I added in to try to filter out false entries as momentum is waning. This calculation works best in 2-5 bar interval.
Configure the trigger point and offset. If you are using rate of change, the best settings will likely be between -1 to 0.5. If you are using momentum, you will likely want -20 to 10. This is where you will notice the entries will shift a bit. Try to find a balance between your backtest settings and actually finding what you thin will be the best entries based on a slight delay from trading view, to algo, to your trading platform. This can likely be a minute (maybe even) or so- so be sure to not get too caught up between the backtest results and be sure to finesse the entries to actually fit nicely - maybe a bar earlier than you would likely think. If your entries are coming in too early, you can use the offset to delay your entry by a few bars. This is both science and an art form- don't get too caught up on the back test results as that is based on having all the data tha already transpired, it's not based on how it will actually perform during deployment.
Take profit and stop loss. This should be self explanatory. This script can toggle between static take profit and a trailing profit. For scalping, you will likely want to limit it below 2% to get a good win ratio. Stop loss should be at least 5-6% for these types of 3L/3S tokens to give the strategy some room to move (if the token goes down 2% before it shoots back up, the price will go down 6%). This does not yield the best R/R ratio from a traditional trader perspective, but the statistical probabilities are in your favor for these events will happen. If you have better ideas for how to set this all up, feel free to contribute your ideas in the comments as we can all learn from each other. You can definitely set a much tighter stop loss with a larger take profit to get a lower win rate but in turn might get much better returns. It's all up to you.
FILTERS www.dropbox.com
These filters require you to know a bit about each indicator and how you want to use them. I will only go over the general idea.
Variant Filter - this is especially useful if you want to trade above a moving average. Say for instance you only want to take trades when we are over the 100 Day moving average. Or above a 30 minute, 30 bar EMA, etc. Although originally ported over from my other scripts, this is not a filter that I use often in conjunction with this script.
RSI - perhaps you want to buy when we are below the 30 line on the 30 minute RSI, or we want only want to have the strategy work when we are above the 50 RSI, this can all be configured here. I typically like to try a few different rationales here.
Now with brand NEW ADX filter - this is a brand new idea that seems to work rather well. Based on your ADX settings you can also turn on the "only uptrend" which will try to calculate if you are in an uptrend based on your ADX config. Please keep in mind that uptrend is based relatively on the ADX settings.
- There is a sprinkle of RSI magic in the entry signal to make sure that rsi is not declining in the calculation, so this can affect how many entries you get.
Some other tips:
Forward test.
Set up your algo bot on a one minute interval.
Set up take profit and stop loss on your algo trading platform.
Don't use the exact settings as your backtest, maybe try a slightly more conservative approach from the algo trading platform to make sure you are within range of triggering your events with a slight delay from signal to execution. If you have a 1.6% take profit, perhaps try 1.5% on your platform first.
By using these scripts you agree that you are trading at your own risk. I make no guarantees of returns or results. I just provide tools to help you trade better. However, I hope this ROCit will take you to the moon. And if it does, be sure to give me a shout as well as some tips of your own.
Send me a message with any questions or suggestions.
ToleranceThis indicator measures the Tolerance in the price, it works on all timeframes,
The main goal actually was to indicate the undefined trend zones like when the price is squeezed, the indicator value will be very close to zero (at this zone you should not place any orders)
But also the moving averages may give a good signals on the indicator, crossing up moving average indicate a long signal, you may need aid of other indicators to make sure this zone is long before going long in a bullish trap!
Simple Percentage Change IndicatorFeatures:
- Shows % change per Bar.
- Shows countdown per bar.
- Shows Day, Month, and Yearly % Change in Bottom Right Corner.
Rate Of Change Trend Strategy (ROC)This is very simple trend following or momentum strategy. If the price change over the past number of bars is positive, we buy. If the price change over the past number of bars is negative, we sell. This is surprisingly robust, simple, and effective especially on trendy markets such as cryptos.
Works for many markets such as:
INDEX:BTCUSD
INDEX:ETHUSD
SP:SPX
NASDAQ:NDX
NASDAQ:TSLA
Moving Average Convergence Divergence with Rate of Change
Purpose - MACD is an awesome indicator. However, I felt I could improve the existing MACD indicator by also letting it visualize the rate of change (ROC) of the histogram (whether rate of change is increasing or decreasing - just like a derivative). By doing so, the indicator will better show the rate of change of the trend.
How It's Done - To the original MACD indicator, I have added a bit more conditional statements that automatically calculates the ROC in MACD histogram and visualizes through 8 different colors.
Interpretation - While the histogram is above 0, darker color indicates the stronger up trend, and lighter the color, weaker the up trend and potentially indicates the bears are overtaking, and vice versa for the case where the histogram is below 0.
Pchange10xModified version of pchange NM, changed to 10x
Plots the percentage change of one data point to the next
IR% - Intraday Range (% or $)Shows the percentage difference between the High and Low of the price bar expressed as a percent of the Open of that bar. In the settings, you can change to Price Change instead of percent change. This will show the price change between the High and Low for each price bar.
It can be used on any time frame.
I use it on the daily chart . I note the daily figure, and that lets me know how far the price tends to move during a typical day (no gaps included).
If using on another time frame other than the daily, then it is an intrabar calculation, not intraday.
Apply a moving average to it to see the average intraday movement after the open when using a daily chart .
The IR% of a 1-minute chart tells you the price range of that one-minute price bar, and a weekly chart will show the price range of each weekly price bar.
It only measures high to low versus the candle's open price. It does not include gaps between candles, which makes it different than the ATR. ATR is more useful for swing trading, where the trader may be holding through gaps in price, and thus wants to factor them in.
The IR% is useful for day traders because it shows how much a stock tends to move during the day (intraday range), when using a daily chart . ATR is not as effective for this because it includes gaps, which day traders can't generally capitalize on.
If the IR% is fluctuating between 5% and 10% over the last 50 days or so (on the daily chart ), day traders know that AFTER the open, the price is likely to move 5% to 10% from high point to low point. This can help with establishing profit targets, seeking out stocks that tend to move a lot within the day, or avoid these types of stocks if they are undesirable to you. Seek out low IR% stocks if you prefer lower movement during your selected time frame.
A stock may have an ATR% of 5% but ATR doesn't tell us if that movement occurred after the open or includes a gap. Some stocks are prone to gaps. They may gap 4% most days, and then only move 1% during the day. This will still be a 5% ATR%, but most of that movement ISN'T capturable each day. The IR% for this stock would only be 1%, not 5% like the ATR suggests.
I developed this because I like day trading volatile stocks, and I wanted a measure that ONLY includes movement during the day, and doesn't include price gaps in the calculation. Because as a day trader, gaps don't matter to me. I can only make money on what happens during the day, after the open.
It is similar to another indicator called Average Day Range (ADR). Although most ADR calculations are already calculated as an average (so I don't see each individual value) or plots things on the chart. This may be useful for some people, but I wanted to see the data on each price bar, have the option to add a moving average or not, and not have anything plotted on the price chart. It also nice to be able to flip from % to $ dollar movement if desired.
Rate Of Change and rsi zonesHi,
I played with the ROC ( Rate of change ) indicator.
First of all I made it smooth. And came up with decent buy sell signals for long-term potential trades. It can be useful for DCA and profit booking in market tops ( before potential crash)
Recommended time frame = 1 Daily , 3 Daily , Weekly.
Usage :
1. Look for Buy and sell arrow signals. But don't jump straight away. Specially for sell. You might sell early. Instead you can move up your stop loss when you see a sell signal or profit book partially.
if you wait and combine with your own supply and demand zones you can get some nice sell price.
2. Better to wait and look for a divergence in price and ROC. As price will slow down it will reflect on the ROC line. Which means market is exhausted and potentially a correction might happen.
3. You can draw trendline one the ROC and look for breakout. ( warning won't always work )
4. You can also see the RSI in thick red/green color. It will help you determine oversold and overbought zones. Trick is don't sell when it's oversold ( red thick line) . Because it might be a start of a strong uptrend.
So better is to wait and see when the signal is printing then execute.
Best strategy is to DCA and sell in parts whenever you see such signals.
I believe it will visually help us that when to be bull and when to be bear.
Anyway if you find it useful let me know in the comment.
Also if you have some idea to improve the code you can contribute as well.
Thanks . Feedbacks are welcome.