Start the Script on Last Nth Bar [Experimental]Hello Pine Scripters,
Sometimes we need to run some processes in the scripts on last N bar but currently we don't know bar_index value of realtime bar or number of remaining bars before we reached it. So most of us use "start date" as input and run some processes after "start date".
This experimental script finds last Nth bar approximately. As you can see in the script we (should) use GMT, otherwise as I see the result might not be accurate (we don't know timezone used on the chart)
The idea is to find/use similar bar in the past (using timenow as reference) and then calculate aproximate the time of last Nth bar. the results may not be accurate all the time, also we can not know local holidays etc.
At the moment the script works on 1minute or higher time frames (it won't work on less 1min timeframes)
In the future if the Pine Team add something like "bar_index_realtime" then we will not need such things. by the way many thanks to Pine Team, they are doing great job.
You can use this script in your scripts as you want, no need to ask permission. If you can improve it let me know ;)
Enjoy!
TIEMPO
Alert of Cryptooo fox HYPER trading(CRYPTOOO FOX ( BCH ) long & short no repaint strategy)
Hello traders
- The alert of strategy is using higher time frame but it never repaint .
- The alert of strategy is working only in ( 10 % of equity ) you can change it as you want .
- When you use this alert you will get this message alert ( THIS INDICATOR MAY BE REPAINT )
and this is normal so we use higher time frame but as i said it ( never repaint )
- The alert of strategy is working in ( BCH / USDTP ) and ( BTC / USDTP) IN BINANCE FUTURE MARKET .
- I recommanded too much using ( 15 min , 30 min ) charts .
- This script is working in standard charts no ( heikien ashi or range ) charts .
- ( TO ACCES THIS SCRIPT PLEASE USE THE LINKS BELOW ) .
Cryptooo fox HYPER trading(CRYPTOOO FOX ( BCH ) long & short no repaint strategy)
Hello traders
- The strategy is using higher time frame but it never repaint .
- The strategy is working only in ( 10 % of equity ) you can change it as you want .
- I use 0.04 % as fees ( this future market in binance fees ) .
- I use 1000 dollar as capital ( you also can change it as your capital ) .
- The strategy is working in ( BCH / USDTP ) and ( BTC / USDTP) IN BINANCE FUTURE MARKET .
- I recommanded too much using ( 15 min , 30 min ) charts .
- This script is working in standard charts no ( heikien ashi or range ) charts .
- ( TO ACCES THIS SCRIPT PLEASE USE THE LINKS BELOW ) .
Forex Session Breaks DST AWARE!There seems to be no open source forex trading session DST (Daylight Savings Time) aware scripts which I think is absurd. This amazing community deserves better. So I adapted some code by icostan adding DST capabilities.
Original code by icostan here
I added DST code. Warning may not be perfect yet. Could be a bug or two. It only supports 3 major sessions right now but you can add your own rules for the other timezones by copying my logic.
It is open source so please add the other sessions and regions as needed and update me please.
Love.Gunfire - Giant All For One 巨人VIPGiant is All For One , the Last special version for all markets, optimized by Love.Gunfire from Gann. Each one contains natural numbers. If you want to know the recent support. resistance and trends, read on.
Only disciples who have learned "Giant Weapons" can select VIPs to use and the version will be continuously updated.
There the usage settings:
Enable/Disable signals on chart
Enable/Disable XTV based on trend
Enable/Disable label code to smart trade
How does it work?
Basic usage
After the small/medium giant appears BUY, and above T line, may be you can consider the operation of buying
After the small/medium giant appears SELL, and below T line, may be you can consider the operation of selling
What are the signals?
Advanced usage
The small/medium giant cooperates with the giant weapon operation to confirm the upward trend and consider buying
The small/medium giant cooperates with the giant weapon operation to confirm the downward trend and consider selling
For giants to operate, no matter how to make any transaction, they must have the mind of "continuing to stop making profits is the emperor's way, and strictly guarding against erosion is a virtue."
Want to get this indicator today!
For access, please DM us or visit the link/Telegram below in our Signature.
Contact: Love.Gunfire
US30 CURRENCYCOM:US30
GOLD OANDA:XAUUSD
HKEX:700
FX:EURUSD
BINANCE:BTCUSDT
--------------------------------------------------------------------------------------------
巨人是結合天地為一。特別的版本可以應用全球商品,是由彥暉從江恩中使用八多年來優化而來,每一個都含有自然的數字,如果想知道近來的支持、阻力和趨勢,一定不可錯過。
更新設定方法 :
開啟/關閉 訊號
開啟/關閉 XTV趨勢
開啟/關閉 數字
如何使用?
基本使用方法 :
待小/中巨人出現BUY後配合T線以上 ,可考慮買入的操作動作。
待小/中巨人出現SELL後配合T線以下,可考慮沽空的操作動作。
訊號是什麼?
進階使用方法 :
小/中巨人配合巨人兵器操作,確認向上的趨勢可考慮買入。
小/中巨人配合巨人兵器操作,確認向下的趨勢可考慮沽空。
暫時只開放給「巨人兵器」的弟子和特選VIP使用,版本會持續更新。
巨人操作,無論做任何交易,必須要有「不斷止賺是皇道,嚴守止蝕是美德。」的心思。
立刻行動,良機勿失 !
想獲取權限,請給本族訊息或訪問Telegram,本族簽名中的以下鏈接。
請聯絡 : Love.Gunfire
US30 CURRENCYCOM:US30
GOLD OANDA:XAUUSD
HKEX:700
FX:EURUSD
BINANCE:BTCUSDT
[RS]Supertrend GridDynamic grid system based on supertrend.
note: the input nlines/nfractions are not locked so if values too high might start overlapping line objects.
indicatorenindicatoren is one non-overlaying indicator with multiple oscillators combined.
indicatoren provides the following functions:
- RSI (Relative Strength Index)
- Stochastics (representation of mathematically calculated momentum)
- Configurable MAcd (Moving Average Convergence Divergence) visually compressed to 0-100 range
- DMI & ADX (Directional Movement Index & Average Directional indeX) with visual lowering option
- Bollinger Bands direction
- COMBI Average
- Hourly, 4Hourly, Daily and Weekly time-indications
The length and appearance for each element can be adjusted. The MAcd has several modes and the brightness
of its elements can be adjusted with one single control.
The COMBI Average consists of a weighted average of the RSI, Stochastics, MAcd, DMI and the BB Direction.
It has its own definable length. Depending on the timeframe used, a visual indication of Hours, 4 Hours,
Days and Weeks might prove handy, especially on shorter timeframes.
Displaying this number of oscillators all at once may look like a carnival, therefore, each function can easily
be switched on or off. indicatoren can be used as just an advanced MAcd for example, or have it show the
combination of functions suiting you the most.
In order to combine a MAcd (+/- infinite scale) with Stochastics or RSI (0-100 scale), the MAcd is being visually
compressed and a Visual Multiplier parameter is provided to make it fit under any circumstances on any timeframe.
The DMI +/- and ADX scale are divided by 2.5 by default. Having the DMI’s on the lower portion of the indicator
does still provide decent info at a glance while it is not in the way of the other oscillators.
Books have been written and many articles and videos have been made about the meaning and possible applications
of these oscillators in trading.
The unique combination of these oscillators within indicatoren , together with the simple, yet useful,
visual options, make it to quite a versatile indicator on every timeframe on any chart.
GuidoN - November 2019, July 2020
Alpha Performance of PeriodAlpha Performance of Period (PoP) produces a visualization of returns (gains and losses) over a quarterly, monthly, or annual period. It also displays the total % gain and loss over any length of days, months, and years as defined by the user.
Performance of Period (PoP) can be used to understand the performance of an asset over multiple periods using a single chart layout, and to compare the performance of different assets by using a multi-chart layout.
This can, for example, be used to compare the NASDAQ, S&P, and DJI over the past 20 years to create a dow vs. nasdaq vs. s&p performance chart. This can help you understand a comparison of historical returns by showing which performs the best month-over-month, quarter-to-quarter, year-to-year, throughout any custom period of days/months/years.
The ability to get a visualization of the % gain/loss can help to better understand how markets have performed over time and which markets have historically performed the best.
Check out the up and coming Educational Idea we will be releasing soon after this is live to see an example of how we use this tool.
Current Period Label
-----
Current Period : This label shows the current period's performance only when you hover over it.
(This label is located to the left of the current period's open candle and at the current candles close price)
TICKER "Time Period" Performance Label
-----
Total Period Gain : The total of all % gain periods from the start to end date.
Largest Period Gain : The biggest % gain period from the start to end date.
Total Period Loss : The total of all % loss periods from the start to end date.
Largest Period Loss : The biggest % loss period from the start to end date.
Total period Performance : The total % performance, the difference between the total gain and total loss.
NOTE : The "Current Period" performance is excluded from ALL five of the above-mentioned figures. This was done to avoid giving inaccurate comparison figures due to the period not being finished yet.
Inputs
-----
Current Script Version + Info : A drop-down list of instructions for the user to refer to.
Dark Mode Labels : Toggle on for Dark Mode. This is done since Labels text and background color can not be adjusted separately within the visual inputs so this is the best fit solution.
Time Period of Returns : Pick the period of performance you would like to emulate monthly/quarterly/annual.
Start Date : The day to start tracking performance.
Start Month : The month to start tracking performance.
Start Year : The year to start tracking performance.
End Date : The day to stop tracking performance.
End Month : The month to stop tracking performance.
End Year : The year to stop tracking performance.
As always if you have any feedback let us know in the comments and leave a like if you enjoy this tool :)
DC Time KeeperBefore anything, take notes of the script limitations :
1) This script doesn't give trading information on itself.
It is intended has additional value to my other script named : Time Dilated Donchian Channel
Blue line = Normal time of the day
Orange line = Observed time of the day
Red line = What if time travel was allowed... Which time would I observe?
More information about this script :
2) The script has the setting : "Max_bars_back" set to 390. This is required to use dynamic length and an "internal clock"
*390 is the normal number of bars in a typical stock trading day.
3) The script requires volume data to work correctly
* I use a way to represent volatility that requires ( volume + price movement + time, no sma , no stdev)
Why ? Because:
HIGH-LOW = Fail to get gap information, fail to get volume information
TR /ATR = Fail to get volume information
STDEV = Not very good with dynamic length as it use SMA and fails when length <2
SMA = SMA give very strange results when using non-integer numbers.
So a good idea is to use the 1 minute timeframe for this indicator.
Conclusion: this script is basically limited to stock trading.
If I could set Max_bars_back to 23 400 this would even work better with a 1 second time frame as more data would be entered in the system.
The idea behind the script is that volatility exists in two different formats depending on how you observe the situation.
Remember your physics class? Light can be a wave or a particle depending of the situation.
Volatility seems to share a strange similar property.
If volatility share similarities with light, then time dilation effect could be applied to stock movement.
Time Dilation formula
Time observed = (Last time - First time) / sqrt(1-(pow(v,2)/pow(c,2))
I've tried a lot of ways to use this formula as is.
Problem is : C.
C is the speed of light and I haven't found the equivalent stock market constant yet.
In order to keep the law of physics like they actually work, when a new time is set, I had to "Protect its value".
protected_new_time = highest_(observed time , normal time)
No time travel is allowed. *yet.
For more information about time dilation:
en.wikipedia.org
Mercury Retrograde Cycles V2 [Moon]Plots Mercury Retrograde cycles from start to end.
What is Mercury Retrograde?
Mercury Retrograde is when the planet Mercury appears to be traveling in reverse or backwards across the night sky with respect to the stars, the zodiac, and other bodies in the celestial canopy.
It happens when Mercury goes in between the Earth and the Sun. Basically, Mercury is lapping or passing Earth during this period.
An illusion created by the way that Earth and Mercury orbit around the sun. In reality, this is both planets perpetually orbiting in the same uniform direction.
In ancient Roman mythology Mercury is supposed to rule all types of communication including - buying, selling, speaking, reading or contractual agreements.
Does this work or mean anything
I don't hold the answers to the universe you'll have to go looking for yourself.
Works best right now on the Daily (D) timeframe.
Send me a DM if interested.
Combination Parabolic MA/IIR/ALMA Strategy, and other goodies Okay, so this is a lot. It started mostly with me combining indicators and looking for ideal entry criteria.
It is also a collection of conditions, whether used or unused, for my current chosen "best" strategy. It is currently set how I like it, but it has changed with time, and will continue to do so. Within, there are variables that are unused, but offer some insight into the overall odds of a trade. They were, in fact, once used but fell out of favor. And all details for this strategy are within the comment header of the script.
As this evolves, I most certainly wont keep any future findings and hope for profit from my peers (yinz). Also, I'd like to give a sincere thanks to the people of TV for what I learned in a few month's time and their flexible membership plans. Basically, I'm just a mad scientist, but this monster's a masterpiece and folks here before me made many indirect contributions to it.
--------------------------
Okay guys, lastly and most importantly,
Each smack of the like button is a vote of your confidence in me, to my beautiful landladies, Celeste and Adele, that my rent will be caught up and that it won't always be a problem. Which, in my mind, makes me a graph. And they've got strong hands and don't sell the low. I more than respect that. Seriously. And I'm very grateful for their willingness to work with me, but the thing is that I didn't ask first; life just happens. But few are tolerant of others. And quite importantly, I truly believe that I will be successful one day, and that "thumbs-up" button is your vote of confidence. If you're not sure, then don't hit it yet. Maybe my scripts will boost your confidence in me :)
-------------------------
PS: And you know what? I'ma give a shout-out to Philakone for teaching me everything that I know about Elliot Wave . Absolutely. Two years ago, I would keep telling myself that one day I will put something in his gratuity wallet or pursue the paid courses. And, I still plan on it, because I'm grateful. And so also, to everybody else, I'm recommending him to learn from. because as a trader who might not know everything for free, you can certainly fill in the gaps with his altruistic offerings. And I'm betting that you will then feel more than inclined to buy the Udemy course.
"If wave 2 retraces a lot; number 4 will not". Repetition. Philakone didn't fix my memory but he sure did find a workaround, haha
Okay, everyone, Thanks!
Renko AccelerationRenko is a very useful charting method for analyzing stock movement. It does a great job of filtering out all the excess noise so that all we're left with is pure price action. But, what about time? Time is a fundamental part of chart analysis and we are only seeing part of the picture. After all, shouldn't we take a very different approach to trading signals from a block that renders in 2 seconds as opposed to a block that renders in 30 minutes?
This indicator provides the best of both worlds, enabling us to correlate the passing of time with price movement and clearly see when squeezes and breakouts occur.
As the indicator turns up to green we can see that volatility is on the move and the market is accelerating (breakout), and as it turns down to red the market is stagnating (squeeze). There is also an alternate 'Precise' view which renders the exact time per block for more granular analysis.
[FN] Session Range & Date Range For BacktestingThis has been done before in different ways, however, my goal is to publish a single, simplified copy/paste version of the idea so you can quickly and easily incorporate it into your strategy backtesting.
You can designate weekdays, weekdays + weekends for 24/7 markets, and also session range.
So, you trade bitcoin? It works. CME futures? It works. You are a discretionary trader so the only signals that matter are the ones that happen when you're awake? It works. Copy and paste.
The goal is that its that easy. You'll have to let me know if it is. glhf everyone.
If I'm not mistaken, you should be able to copy/paste this directly into your strategy script (Paste it in before your entry declarations). Just leave out the last 2 lines where the bgcolor() is declared... unless you want the background color lit up, that's up to you. It's just for demonstration purposes in this script.
After you've pasted it in, then in your strategy.entry() function you are adding: to the strategy.entry() function.
e.g:
strategy.entry("Long", strategy.long, qty=1, when = ENTRY_SIGNAL and signal_backtest())
Shoutouts to @zenandtheartoftrading and @allanster for providing the basis of this code that I put together here. We stand on the shoulders of giants.
World Markets Session ShadingHighlights different world session times the times and highlight colors can be adjusted
MF Custom Sessions (PST)Public Version - This is a session timing indicator for people in the PST time zone and represents each major session with a different color time block for intraday studies.
ATR By Time [Chart]What is ATR By Time (Chart)?
This premium indicator is a companion script to my ATR By Time indicator.
This companion script draws your stop loss price to the chart directly. In the above example, the black line represents a regular 1x ATR stop loss above and below price action, while the colored lines are the 1x ATR By Time indicator values when set to use the "Smallest ATR" in the settings menu.
When set to "Smallest ATR", the script calculates the regular ATR and the ATR By Time of Day and compares the distance of the two values. It then selects whichever value is smaller to be used as the stop loss, and adds or subtracts it to the most recent swing high or low (or the closing price if desired).
This allows for tighter stops and larger position sizing during certain times of day for aggressive traders when set to Smallest ATR, or wider stop losses during more volatile periods of the day for conservative traders when set to Largest ATR.
Stop Loss Distance Options:
- Regular ATR
- ATR By Time
- Smallest ATR
- Largest ATR
More Information
Similar to my RVOL By Time indicator, the ATR By Time indicator works on any market that has consistent trading session lengths . So it works best on Forex & Crypto, but also works on some Stock and Futures markets.
Instead of calculating the ATR based on recent price data like the regular ATR indicator, it calculates an ATR value for each candle based on that candle’s time of day .
For example, if you set the Lookback setting on this indicator to 14, then instead of calculating the ATR based on the past 14 candles, it will calculate an ATR value based on the past 14 trading sessions for each candle (as an average).
So in other words, your 10:00AM candle will show the average of the past 14 10:00AM candles rather than the past 14 candles leading up to that 10:00AM candle.
This is extremely useful for day traders in particular as it allows you to gauge the average range of candles during certain times of day instead of only by the most recent price action.
It also draws a regular ATR (optional) – so this is essentially an enhanced ATR script that gives you multiple readings on price volatility.
If you are interested in trying the script or you want more information on how the script works, there is more information available on my website including instructions on how to apply for a free trial: ATR By Time Feature Page .
Good luck with your trading!
TimeSync by KingThies TimeSync by Kingthies
Written in Pine v4
Applies one function that was published in the Tradingview Pinescript Manual
The Motivation behind this script - Time is 50% of your chart. Many ignore it entirely. This should help give an idea on how to read it and incorporate it in their analysis.
TimeSync by KingThies takes a simple concept and turns it into a visual tracking system of when timeframes of significant impact, all close at the same time.
By utilizing several high time-frames, we see overlaps in periods and more significant events occurring when multiple periods close at once.
The TFs included are 3D,1W,2W and 1M. When users use the timeframes above intraday, the resolution for these HTF's is shown. When using the LTFs, anything lower than 1D/is intraday, the user sees a similar concept but comprised of the 4H, 6H,8H and 10H charts.
Users can adjust the settings to show the HTFs in sync AND also factor in if the event was on a business quarter or new year, which adds more significance to the occurrence.
By seeing when these periods end in sync, we can assume more volatility is present in a given market, presenting various opportunities for traders to take advantage of a given situation.
Apologies in advance for any questions that come up - I will do my best to reply or respond here on Tradingview.com.
Additional Resources for this topic can be found in my account signature, located at the bottom of this post.
FUNCTION: Specify lengths in time (or bars) This is a function to give measures in time rather than bars...
I often want to measure in things in time rather than bars and change the sample rate (the candle size)
without reconfiguring my settings. This is a handy function for setting you input lengths in time units
(or bars when you want that)
For example
I want a 3 hour moving average, regardless of whether I have 5 minute candles or 30 min candles...
I want a 200 day moving average, regardless of whether I have 1 day or 1 week candles...
This is designed for you to put in your own scripts for your own purpose, but you can use this as is for time constant moving averages
or as an indicator on an indicator.
This shows the same moving averages 45 min / 3 hours in aqua / fuchsia and 1 day / 1 week in red / green
First row: On an extended session chart with 10m, 30m and 60m candles (all of them use the same settings (day length is 16 hours) everything else default.
Second row: On a standard session chart with 10m, 30m and 60m candles (all of them use the same settings everything else default.
[RS]Shadows Of Past, Present and FutureExperimental:
session projection into the future..
Past, Present, Future
Tell me, tell me, smiling child,
What the past is like to thee ?
'An Autumn evening soft and mild
With a wind that sighs mournfully.’
Tell me, what is the present hour ?
'A green and flowery spray
Where a young bird sits gathering its power
To mount and fly away.’
And what is the future, happy one ?
'A sea beneath a cloudless sun ;
A mighty, glorious, dazzling sea
Stretching into infinity.’
by Emily Brontë
Custom Time ranges. Daily price ranges.Addition to previous time range script, now containing daily ranges. You can select a day of the week, and have it show the high, low, mid, and open of that day.
For the time bands:
Monday = 2
Tuesday = 3
Wednesday = 4
Thursday = 5
Friday = 6
Saturday = 7
Sunday = 1
Example 1:
1500-1800:2
This will colour the background between 3pm and 6pm on Mondays.
Example 2:
0000-0600:247
This will colour the background between midnight and 6am on Mondays, Wednesdays, and Saturdays.
For the Daily price ranges:
Just select the tick-box forthe day, and then the price levels you'd like to see.
I want to add specific weekly levels to this, for example: week 06 of year 2020, but I've not figured out how to do it yet. If anyone knows, I'd appreciate it if you let me know. I'll then update this script.
As always, any questions you may have, please leave in comments below and I'll respond when I have time.
If you notice anything good with this indicator, let me know. We are all in this to make money after all! ;)