Papercuts Recency CandlesPapercuts Recency Candles
V0.8 by Joel Eckert @PapercutsTrading
***This is currently an experimental visual exploratory concept.***
*** Experimental tools should only be explored by fellow coders and experienced traders.***
DESCRIPTION:
As coders, how can we seamlessly transition between actual and smoothed price data sets as data ages?
This is a visual experiment to see if and how data can be smoothly transitioned from one value to another over a set number of candles. If we visualize a chart in 3 zones, a head, a body, and a tail we can start to understand how this could work. The head zone would represent the first data set of actual asset prices. The body zone would represent the transition period from the first to the to the second data set. Last, the tail zone would represent the second data set made of a Hull Moving Average of the asset.
CONCEPT:
It is conceived that data and position precision constantly shift as they decay or age, therefore making older price levels act more like price regions or zones vs exact price points. This is what I am calling Recency.
This indicator utilizes the concept of "Recency" to explore the possibility of a new style of candle. It aims to maintain accurately on recent prices action but loosen up accuracy on older price action. The very nature of this requires ALTERING HISTORICAL DATA within the body zone or transition candles to achieve the effect. It is similar to trying to merge a line chart type with a candle chart type.
This experiment of using recency for candles was to create candles that stay more accurate near current price but fade away into a simple line as they age out, resulting in a simplified view of the big picture which consists of older price action.
This experimental design theoretically will help you stay focused only on what is currently unfolding and to minimize distractions from older price nuances.
USAGE:
WHO:
This is not recommended for new traders or novices that are unfamiliar with standard tools. Standardized tools should always be used to get grounded and build a foundation.
Active traders who are familiar with trading comfortably should experiment with this to see if they find it interesting or usable.
Pine coders may find this concept interesting enough, and may adapt the idea to other elements of their own scripts if they find it interesting… I just ask they give credit where credit is due.
HOW:
The best way to visualize how this works is to do the following:
Load it on a chart.
Turn off Standard candles in Chart Setting of the current window. I actually just turn off the bodies and borders, and dim the old wicks as I like the way the old wicks look when left alone with these new candles.
Enable chart replay at a faster speed, like 3x, and play back the chart to watch the behavior of the candles.
You’ll be able to see how the head of the candle type preserves OHLC, and indicates direction but as the candle starts to age it progressively flowers into the HMA
While it plays back try adjusting settings to see how they affect behavior.
You can see the data average in real-time which often reveals how unstable actual price noise really is.
The head candle diagonals indicate the candle body direction.
SETTINGS:
Coloring: You can choose your own bullish or bearish colors to match your scheme.
Price Line: The price line is colored according to the trend and
Head Length: These candles are true to the source high and low. They remain slightly brighter than transition candles. We have a max of 50 to keep things responsive.
Time Decay Length: This is the amount of candles it takes to transition to the tail. Max is 300 to keep things responsive.
Decay Continuity: This forces transition candles to complete the HMA curve instead of creating gaps when conforming to it. The best way to visualize this feature is to run a 3x replay of an asset, and toggle the result on and off. On is preferred.
Tail HMA Length: This is the smoothing amount for the resulting HMA stepline that calculates every close, but has a delayed draw until after the transition candles. You can optionally turn off the delayed visibility to help with comprehension.
Tail HMA Weight: This is simply an option to make the tail thicker or thinner. This also adjusts the border on the head candles to help them stand out.
Show Side Bias Dots: Default true: Draws a dot when bias to one side changes to help keep you on the right side of trade. Side bias is simply the alignment of 3 moving averages in one direction.
IMPORTANT NOTES:
You'll have to turn off or dim the standard candles in your view "Chart Settings" to see this properly.
Be aware that since the candles are based on boxes and utilize the “recency concept”, which means their data decays and changes as it ages. This results in a cleaner chart overall, but exact highs and lows will be averaged out as the data decays, forming a Hull Moving Average stepline of your defined length once decay has finished.
SUMMARY OF HOW IT WORKS:
First it takes candle information and creates unique boxes that represent each candle based on the high and low. It utilizes boxes because standard candles once written, cannot be later altered or removed… which is a key element for this effect to work.
Next it creates a second box and line from open to close for the body of the Head candles. This indicates direction at a glance.
As candles age beyond the defined distance of the “Head” they enter the "Body" aka "Time Decay" zone. Here the accuracy of the high and low will be averaged down using an incremental factor of the HMA, defined by "Time Decay Length" amount of candles.
The resulting tail is an HMA of Tail HMA Length. This tail is always calculate at close, but is not drawn instantly. The draw is delayed so that there is not overlapping data, and this makes the effect look more elegant.
There are also two EMAs within the script that do nothing but help candle coloring and help provide a trade side bias. When both EMA's and the HMA align, a side bias is defined. Only when the side bias changes will a new dot is formed.
Head candles have been simplified from previous versions to be easier to read at a a glance.
Papercuts
Papercuts Time Sampled Higher Timeframe EMA Without SecurityThis EMA uses a higher time sampled method instead of using security to gather higher timeframe data.
Its quite fast and worked well with the timeframes prescribed, up to 8hrs, after 8hrs, the formatting gets more complicated and i probably wouldn't use it anyway.
You can use this as a guide to avoid security and even f_security with this method.
NOTE: This includes the non repainting f_security call so that i woudl be able to check my results against what it does, thats not nessecary to keep at all.
There is some minor differences in data, but its so minor it doesnt bother me, though it would be interesting to know what the difference actually is. If anyone figures that out, leave a comment and let me know!
This is meant to be an example for others to build and learn and play with.. so enjoy!
Papercuts Price Distance TravelledPapercuts Price Distance Travelled
aka
Maximum Per-Share Profit Potential
For: Intraday swing and scalp Traders.
This is a simple idea i wanted to explore where you could visualize the data of how much a price actually moves during the day.
Measuring through Daily ATR is helpful, but it only measures OHLC of the day, and way more tradeable movement happens than that.
So this measures movement a different way to increase perspective and awareness of price action.
Its like taking a pleated filter and unpleating it, which reveals a way longer structure.
It does this by aggregating the path of travel of an RSVAEMA (Relative Strength Volume Adjusted EMA) and returns the absolute value of its results.
Then it resets this daily, and returns the peak into an array that gets averaged.
This is helpful for seeing how normal or abnormal a days move might actually be. Many days feel extreme, but they are not, and vice versa.
This can be utilized to see how much movement actually happens at different levels. TSLA on 5m is an average daily movement of around 20$, but TSLA 15sec chart shows an average movement of around 100$. Pretty insane.
Papercuts Dynamic EMA - Relative Parameter FunctionThe goal of this is to link two parameters of different known low and high values so one affects the other.
In this case, I want to link Relative Volume to the length of an EMA, so it responds faster in times of high volume.
As an animator I am used to linking values in this way with Maya using a set driven key, took some work to figure it out in pine.
Looking up this concept, it has a few names, Relative values, linear interpolation, or rescale values.
Thanks to pinecoders for writing the EMA funciton that can accept length variables!
Here's a quick look at the root function to link the two values.
f_relativeVal(_source, in_bot, in_top, out_bot, out_top) =>
// float _source: input signal
// float in_bot : minimum range of input signal.
// float in_top : maximum range of input signal.
// float out_bot : minimum range of output signal.
// float out_top : maximum range of output signal.
clampSrc = _source > in_top ? in_top : _source < in_bot ? in_bot : _source //claps source to create a controlled range
//relInput = (clampSrc - in_bot) / (in_top - in_bot) * 100
inDiffIncrement = (in_top - in_bot)
outDiffIncrement = (out_top - out_bot)
out_bot + (clampSrc - in_bot) * outDiffIncrement / inDiffIncrement // rescale input range to output range
Papercuts Dual PSAR v01Dual PSAR is a trend following script that uses auto-higher timeframe calculation of the current timeframe to create a dual Parabolic Stop And Release.
This is useful because it can determine periods of transition or indecision and can flag those periods with which way it is learning even though it is undecided, what i call "Wait Zones".
When both PSARS are not in alignment, it uses the lower timeframe one to determine which way the wait zone is learning.
You can see below in the chart shows some good trends and some wait zones.
A wait zone can have bullish indication, but then still have a bearish continuation.
A wait zone can have bullish indication, and then enter a bull trend.
Typically I won't make trades in wait zones, and I will exit trades when entering one.
Just wanted to try this out and see how it did. Figured I'd share.
Papercuts Super Trend MTF v02All my scripts are part of a suite called Papercuts .
This one uses one current timeframe supertrend and adds Four Automatic Higher Timeframe Supertrends based on those same parameters to help you determine larger trends while only needing a single chart. This works quite well on 5 and 15 minute charts and will look up in time. Confident trends can be identified by having two or more lines in the same direction.
When unified, the intensity of the glow should increase a trends confidence. Unify collapses the 3 highest timeframe supertrends into the first higher timeframe supertrend. Without Unify on, the overall trends are usually easier to see at just a glance. Higher timeframe supertrends can show support or resistance and act as stop loss limit ranges if you choose. Unify keeps things a bit cleaner and more compact.
V02 updated to fsecurity for no repainting and added a 3MA trend option as well.
Thanks to @Pinecoders for helping me better understand the security function!
Here is a view with Unify on....
Here is a view with Unify off...