Heikin-Ashi Source Function HTFHigher TimeFrame using custom source function for toggling traditional Candle sources or Heikin-Ashi sources on a traditional Candles chart.
Thanks to PineCoders for rounding method: www.pinecoders.com
Thanks to @LucF and @RicardoSantos for their advice and enlightenment as always.
NOTICE: This is an example script and not meant to be used as an actual strategy. By using this script or any portion thereof, you acknowledge that you have read and understood that this is for research purposes only and I am not responsible for any financial losses you may incur by using this script!
HTF
Moving Average MTF Live [Experimental]Hello Everyone,
While using "Security" function for Higher Time Frames (htf) you must accept "Repainting" issue or better you must use previous day data such "security(syminfo.tickerid, 'D', close, lookahead=barmerge.lookahead_on)" that's best normally (or barmerge.lookahead_off). But the problem is (as you can see) it uses previous day data, and this causes latency.
So how to draw LIVE and NON-REPAINTING HTF moving averages?
Until the last candle of higher time frame all is fine and no repaint issue. when it came to last candle of HTF and if we use real data, (because of we can not know the future) while price is changing it starts drawing on each candle of current period without correcting old ones (this is repaint issue). it needs to calculate number of curent time frame candles for higher time frame and must change all points in that period as you can see in the video below.
We have "50 lines" limitation in current Pine version. we hope to have unlimited lines in next versions.
This work is completely experimetal.
btw Thanks to all Pine Platform Developers, They are doing very good job !
Better to watch following video to see how they look like:
P.S. There is no check for Higher time frame, so you should set time frame for HTF accordingly in the options.
Enjoy!
CHK FOLLOW THE STAIRSCHK FOLLOW THE STAIRS....
The stairs are nothing but HIGH LOW CHANNEL at HTF or LTF
I observed 10 Period Moving Average an optimum length for the Staircase
you can change it to 8 or 13, one will generate noise, other will generate lag
Tinker with the Staircase Time Frame to get an optimum fit
The script also shows Strength of the Trend.
If there is a gap between the price and the stairs, that is relection of the strength
The script can also be used for scalping.
Pivots MTF [LucF]Pivots detected at higher timeframes are more significant because more market activity—or work—is required to produce them. This indicator displays pivots calculated on the higher timeframe of your choice.
Features
► Timeframe selection
— The higher timeframe (HTF) can be selected in 3 different ways:
• By steps (15 min., 60 min., 4H, 1D, 3D, 1W, 1M, 1Y). This setting is the default.
• As a multiple of the current chart's resolution, which can be fractional, so 3.5 will work.
• Fixed.
— The HTF used can be displayed near the last bar (default).
— Note that using the HTF is not mandatory. If it is disabled, the indicator will calculate on the chart's resolution.
— Non-repainting or repainting mode can be selected. This has no impact on the display of historical bars, but when no repainting is selected, pivot detection in the realtime bar will be delayed by one chart bar (not one bar at the HTF).
► Pivots
— Three color schemes are provided: green/red, aqua/pink and coral/violet (the default).
— Both the thickness and brightness of lines can be controlled separately for the hi and lo pivots.
— The visibility of the last hi/lo pivots can be enhanced.
— Prices can be displayed on pivot lines and the text's size and color can be adjusted.
— The number of bars required for the left/right pivot legs can be controlled (the default is 4).
— The source can be selected individually for hi and lo pivots (the default is hlc3 and low .
— The mean of the hi/lo pivot values of the last few thousand chart bars can be displayed. Pivots having lasted longer during the mean's period will weigh more in the calculation. The mean can be displayed in running mode and/or only showing its last level as a long horizontal line. I don't find it very useful; maybe others will.
► Markers and Alerts
— Markers can be configured on breaches of either the last hi/lo pivot levels, or the hi/lo mean. Crossovers and crossunders are controlled separately.
— Alerts can be configured using any of the marker combinations. As is usual for my indicators, only one alert is used. It will trigger on the markers that are active when you create your alert. Once your markers are set up the way you want, create your alert from the chart/timeframe you want the alert to run on, and be sure to use the “Once Per Bar Close” triggering condition. Use an alert message that will remind you of the combination of markers used when creating the alert. If you use multiple markers to trigger one alert, then having the indicator show those markers will be important to help you figure out which marker triggered the alert when it fired.
A quick look at the pattern of these markers will hopefully convince you that using them as entry/exit signals would be perilous, as they are prone to whipsaw. I have included them because some traders may use the markers as reminders.
Using Pivots
These pivots can be used in a few different ways:
— When using the high / low sources they will show extreme levels, breaches of which should be more significant.
— Another way to use them is with hlc3 (the average of the high , low and close ) for hi pivots and low for the lo pivots. This accounts for my personal mythology to the effect that drops typically reach previous lows more easily than rallies make newer highs.
— Using low for hi pivots and high for lo pivots (so backward) can be a useful way to set stops or to detect weakness in movements.
You will usually be better served by pivots if you consider them as denoting regions rather than precise levels. The flexibility in the display options of this indicator will help you adapt it to the way you use your pivots. To indicate areas rather than levels, for example, try using a brightness of 1 with a line thickness of 30. The cloud effect generated this way will show areas better than fine lines.
Realize that these pivot lines are positioned in the past, and so they are drawn after the fact because a given number of bars need to elapse before calculations determine a pivot has occurred. You will thus never see a pivot top, for example, identified on the realtime bar. To detect a pivot, it takes a number of bars corresponding to the dilation of the higher timeframe in the current one, multiplied by the number of bars you use for your pivots' right leg. Also note that the Pine native function used to detect pivots in this indicator considers a summit to be a top when the number of bars in each leg are lower or equal to that top. Bars in legs do not need to be progressively lower on each side of the pivot for a pivot to be detected.
If you program in Pine
— See the Pinecoders MTF Selection Framework for an explanation of the functions used in this script to provide the selection mechanism for the higher timeframe.
— This code uses the Pine Script Coding Conventions .
Thanks
— To the Pine coders asking questions in the Pine Script chat on TV ; your questions got me to write this indicator.
HTF Candle [Custom Time Period] by JustUncleL [SOMMI 1.0 edit]This is a custom High Time Frame indicator, originally created by JustUncleL. 💚
I have edited the Pine Script to allow a custom Time Period input. 💛
In the original version, you could only select from a few time periods as your High Time Frame. 💙
In this version you can put any time frame as your reference. 🧡
Example: 6-hour HTF or 2-Day HTF
SOMMI'S SPECIAL NOTES:
-This indicator works with Heikin-Ashi candles.
-Please change your candles to Heikin-Ashi and apply the indicator.
-Advised to disable "Body Wicks"
-Advised to also refresh your page a few times a day as it doesn't update properly due to limitations of TradingView / Pinescript currently.
💙💛💚🧡
ADX+DMI MTF byPeterOThe goal of this study was to use ADX from Higher Timeframe - to determine trend direction
Why? Because ADX is very sensitive, able to show trend ending without any delay, but not in the middle of it.
Being able to see such immediate trend change on higher timeframe, is a great indicator of trend direction.
Adding just security() calls to 'highest', 'lowest' and 'close' didn't seem right, because it produced some ugly ADX, D+ and D- plotlines.
I wanted to see plotlines, which look exactly like those on actual higher timeframe. Therefore I modified the calculations.
You can read more about my take on (not) using security() calls in my other source code indicator RSI MTF: link in comments.
On top of all that, I added interpretation of DMI readings, because it is not as simple as plus>minus + ADXrising = uptrend.
So GREEN background means higher timeframe uptrend and RED background means downtrend.
Supertrend Multi Time Frame - Auto HTF calculationThere is already SuperTrend indicator and thanks to its developer.
This script draws supertrend for current and higher time frame, it automatically calculates higher time frame and you don't need to adjust it when you change the period.
it also change the color of bars according to current and HTF supertrend, so you can see the trend by looking at bars color.
Bar color is lime if trend is up and red if trend is down. but if you see white bars then there is movement opposite the main trend.
if you like it please comment.
HTF High/LowThis simple script draws the previous higher timeframe candle high/low to your chart.
You can also make the script paint the zone between the low/open and the high/close.
Higher Timeframe EMAThis script plots a higher timeframe EMA to your chart.
You can specify the timeframe and the length of the EMA in the settings.
This chart demonstrates the 5-minute 50EMA (black) combined with the 1-hour 50EMA (colored) on the 1 minute timeframe.