Percent % Change Since Specific Date / TimeFUNCTIONS
- User specified Date/Time of importance
- Calculate the percent change since user input date/time to current price
- Plot a line at user input date/time
USAGE
You want to see how much price has changed since a certain important date/time.
Example important date: Trump win, FED rate change, Earnings, etc.
DATE
Watermark, Date, Symbol & Timeframe [ANR Trades]" Watermark, Date, Symbol & Timeframe " is a simple yet powerful TradingView indicator designed to provide essential information directly on your trading charts.
Key Features:
- Add a watermark with a title and subtitle to your charts. Customize the position, colour, and size to suit your preferences.
- View the current date, symbol, and timeframe directly on your chart.
This indicator is essential for traders who frequently save or share their chart images publicly who would want to watermark their chart as well as make it easier to know when it was, what symbol and what timeframe it was on.
date & symbolHey y'all
If you are like me and you keep a record of your performance, adding date and symbol information will surely help you.
You can choose English or Spanish, and also choose between full or abbreviated date. If you want to see the day and if you want to see the symbol.
You can customize position, text size, text color, background.
Time Bound Trading SessionsTime Bound Trading Sessions allows to add time bound conditions to your trading sessions given a date range , a time range and/or days of the week .
This indicator can be very handy if you want to control your trading sessions along those three time boundaries, applying them together and/or separately.
Feel free to reuse this code in your own strategy, and leverage the inSession condition as needed.
Features
+ It allows for date range start and/or end to be set.
+ It allows for session time range to be set.
+ It allows for days of the week to be set.
+ It applies chart background color if we are not within the given time bound session parameters.
+ It includes turn on/off functionality.
Settings
Date Range
+ {Start} checkbox: turns on/off start date
+ {Start} date/time
+ {End} checkbox: turns on/off end date
+ {End} date/time
Time Range
+ {Session} checkbox: turns on/off session time range
+ {Session} time range
Days
+ {M} checkbox: turns on/off Mondays
+ {T} checkbox: turns on/off Tuesdays
+ {W} checkbox: turns on/off Wednesdays
+ {T} checkbox: turns on/off Thursdays
+ {F} checkbox: turns on/off Fridays
+ {S} checkbox: turns on/off Saturdays
+ {S} checkbox: turns on/off Sundays
Get start of previous day on any timeframeUseful on pine scripts which need to identify the start of the previous trading day i.e. from the perspective of today's date - not the previous day on each bar calculation.
Works on any timeframe - which is the whole point as on a daily chart you can simply do time .
Selected Dates Filter by @zeusbottradingWe are presenting you feature for strategies in Pine Script.
This function/pine script is about NOT opening trades on selected days. Real usage is for bank holidays or volatile days (PPI, CPI, Interest Rates etc.) in United States and United Kingdom from 2020 to 2030 (10 years of dates of bank holidays in mentioned countries above). Strategy is simple - SMA crossover of two lengts 14 and 28 with close source.
In pine script you can see we picked US and GB bank holidays. If you add this into your strategy, your bot will not open trades on those days. You must make it a rule or a condition. We use it as a rule in opening long/short trades.
You can also add some of your prefered dates, here is just example of our idea. If you want to add your preffered days you can find them on any site like forexfactory, myfxbook and so on. But don’t forget to add function “time_tradingday ! = YourChoosedDate” as it is writen lower in the pine script.
Sometimes the date is substituted for a different day, because the day of the holiday is on Saturday or Sunday.
Made with ❤️ for this community.
If you have any questions or suggestions, let us know.
The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold zeusbottrading TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script.
ISODateTimeLibrary "ISODateTime"
getDateParts(dateStr)
Get year, month, day from date string.
Parameters:
dateStr : : ISO 8601 format, i.e. "2022-05-04T14:00:00.001000-04:00" or "2022-05-04T14:00:00Z"
Returns: array of int
getTimeParts(dateStr)
Get hour, minute, seconds from date string.
Parameters:
dateStr : : ISO 8601 format, i.e. "2022-05-04T14:00:00.001000-04:00" or "2022-05-04T14:00:00Z"
Returns: array of int
getUTCTimezone(dateStr)
Get UTC timezone.
Parameters:
dateStr : : ISO 8601 format, i.e. "2022-05-04T14:00:00.001000-04:00" or "2022-05-04T14:00:00Z"
Returns: string UTC timezone
Fixed Quantum VectorSelect a zone to analyse the vectors.
This screener show the ratio of the bullish and bearish candle vector and on volume.
Slide the white bar to choose your sample size or you can enter the date.
Click label to hide start calculation and end calculation.
- Happy trading
DateNow█ OVERVIEW
Library "DateNow"
TODO: Provide today's date based on UNIX time
█ INSPIRATIONS
Use pinescript v4 functions such as year(), month() and dayofmonth().
Use pinescript v5 function such as switch.
Export as string variables.
Not using any match function such as math.floor.
█ CREDITS
RicardoSantos
█ KNOWN ISSUES
Date for Day display incorrectly by shortage 1 value especially Year equal to or before 1984
Timezone issue. Example : I using GMT+8 for my timezone, try using other GMT will not work. Al least, GMT+2 to GMT+13 is working. GMT-0 to GMT+1 is not working, although already attempt using UTC-10 to UTC-1.
dateNow()
: DateNow
Parameters:
: : _timezone
Returns: : YYYY, YY, M, MM, MMM, DD
DATE and ATR20 for practice using kojiro_indicatorsThis is an indicator to display ATR20, EMA100 of ATR20 and date at a glance for trade practices using kojiro_indicaotrs.
This will allow you to easily perform your practices.
Please change the period of EMA and the display interval and size of the indicator as needed.
Please enter small, normal, large, huge, or auto for the size.
The following is in Japanese.
小次郎講師のインジケーターでプラクティスする際に、
ATR、日付を見やすくするためのインジケーターです。
サイズや間隔を変更可能です。サイズはnormal、normal、large、huge、autoを入力してください。
Fed and ECB Calendar by KziHello traders,
Here is a script that i've done for testing the timestamp and the input.time fonction.
You can see verticals lines blue and yellow.
The blue are the ECB meeting date (7 dates)
The yellow are the FED meeting date. (10 Dates)
// In the parameter you can enter the next rolling month date for ECB and FED
// I don't figure out how to add label / Txt on the lines
// And be carreful i don't put the real hours of the meeting.
FunctionDatestringLibrary "FunctionDatestring"
Methods to stringify date/time, altho there is already builtin support for it.
datetime(unixtime) a stringified date stamp at specified unix time.
Parameters:
unixtime : int unix timestamp.
Returns: string
date_(unixtime) a stringified date stamp at specified unix time.
Parameters:
unixtime : int unix timestamp.
Returns: string
time_(unixtime) a stringified date stamp at specified unix time.
Parameters:
unixtime : int unix timestamp.
Returns: string
Custom Date Buy/Sell StrategyThis strategy allows you to back test longing or shorting during a period of time between two dates.
Make sure you are in the daily time frame while viewing the performance and trade history to ensure you have the most historical data as possible from Trading View.
Finally, due to the way Trading View enters trades at the end of a candle, you must subtract one day from your starting and your end dates.
Date-selected Synch and Compare Script Module [yoxxx]This Script is a Convenience Script Module for calculations based or started on a fix time / date.
(In difference to bar_index-based where the reference point is shifting from bar to bar, thus is dynamic).
Purpose examples:
- Comparison by start date
- Time driven studies or strategies
- Measuring from Date of Interest
The script also contains a date input box with the feature of auto-converting the default time to local user time (a newer feature of Tradingview which too me a lot of research to find; so here integrated).
Last not least it the module gives you a ready to go example for multi security comparison on percentage scale with a free selectable start date.
Enjoy
Yoxxx
P.S:. For further notes look at the script code.
They are concerning usage and how avoiding some strange display issues.
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!
[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.
How To Set Trade Dates
Example how to backtest specific date(s) which can be useful for testing seasonality strategy ideas such as "Sell in May", etc.
If using Daily period with wild card dates it will not trade on 1st day of month. If market is closed will trade on next open day.
Works only with Daily or lower timeframes. When using on Daily timeframe set dates 1 day earlier to execute on desired dates.
Entering 0 in any of the date fields acts a wild card. Example -> Entry Year: 0 is "Every Year", Exit Month: 0 is "Every Month", etc.
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!
How To Auto Set Date RangeExample how to automatically set the date range window to be backtested from X days or weeks ago to present. Additional options are also included to manually set the date range or to show entire range available.
Normally when you change chart period it changes the number of days being backtested, which means as you increase the chart period (for example from 5min to 15min), you also increase the number of days traded. So you can not compare apples to apples for which period would yield best performance for your strategy.
By incorporating this code with your own strategy's logic (replacing buy and sell), it will allow you to compare results of different period backtests over the same duration of time.
Date Range: ALL uses entire history.
Date Range: DAYS uses number you set in # Days or Weeks
Date Range: WEEKS uses number you set in # Days or Weeks
Date Range: MANUAL uses manual dates you set in From and To fields
Much gratitude to @pinechrix for suggesting this improvement to me, and to @Gesundheit for pointing me in the right direction on the original example I published previously. Thank you both!
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!
C320up Strategy Tester Start TimeC320up Strategy Tester Start Time
This is a little snippet you can paste into your Strategy to set the testing start date and time.
It is not a Strategy per se, though is an example with the timestamp script included.
Instructions are fairly straight forward, and are listed in the script.
If for some reason you also wanted an end date, that too is possible. Just leave a note in the comments.
Disclaimer: We searched for a similar script on TV, and could not find anything at this point in time.
You can set your preferred date and time in the input section of the settings.
Enjoy!
BTC Futures Settlement DatesShows the CBOE and CME settlement dates as horizontal lines, with the option to show a 7 day warning in the background. This should hopefully give ample warning.
I intend to update the script as new dates become available but please PM if I've forgotten.