Simple HashmapA very simple Hashmap in Pinescript version 4
It uses two arrays one to store indices and one to store values
currently this only supports keys of type int and values of type floats.
index array: (20, 30, 80, 90)
value array: (9.1,8.1,6.5,3.5)
You can access the value 9.1 by using the key 20.
No fancy hash functions were used just a very simple practical mechanism.
Narzędzia Pine
{QG}Spread CandelsticksThis indicator charts the spread between 2 instruments in a subwindow and it has a multiplier for calculating dollar value or volatility for those 2 instruments,
I have shown a sample spread between NQ and ES with multipliers representing the dollar value per point.
The indicator can then be applied to this spread candelsticks indicator.
RealTime Max LeverageEver wanted a script that could tell you what is the maximum reasonably safe leverage if you were to open a trade and hold it for a given number of candles? This is it!
Using rate of change based volatility and the maximum expected number of candles/periods you will hold your trade for, based on your risk profile this indicator will tell you what is the maximum reasonable leverage.
Stop losses / take profits or some other prudent exit strategy should not be avoided. The idea is effectively to prevent yourself from using leverage that is too risky for the current market conditions on whatever timeframe you are entering your trade based on.
If you have any suggestions on how to improve the indicator, please leave a comment below!
Streamer WatermarkThis unique indicator doesn’t help you trade but it makes your charts look super clean and professional in images and live streams! This indicator works by displaying two tables. The first table has day of the week, date, and free form text. The second table has ticker symbol and timeframe of the current chart.
Everything about the tables and the cells is completely controllable by the user! Here is a breakdown of how customizable the user can make this indicator:
Table:
Toggle each table to be displayed on or off
Move each table into 9 different locations around the chart
Move each table separately
Table background color and transparency
Table border color and transparency
Table border width
Table frame width
Cells:
Each cell can be individually toggled on or off (the table will resize dynamically)
Cell text color and transparency
Text size with 6 different options
Date format with 12 different formats
Input Text:
Text
Emoji
Text & emojis
ASCII characters
Symbols
Anything that can by copied and pasted
Any combination of the above
Notes
Use text size “Auto” if viewing the same chart on desktop and on smart phone (Auto makes the text scale based upon screen size)
Gallery
Disclaimer
Please read the TradingView House Rules carefully before using this indicator to add text, symbols, characters, or anything else to your charts and posting on TradingView Ideas or Scripts. This indicator and the author are not responsible for users not reading, fully understanding, and abiding by TradingView’s House Rules. Please watermark responsibly.
All-Time-High Drops and Bounces ScreenerThis screener tracks the following for up to 40 assets:
All-Time-High
Days since ATH
Percentage drop from ATH
Bounce off the low after ATH
Thanks to @QuantNomad and @MUQWISHI for building the base for this screener. I only adjusted it to show different data.
pineCalc- Calculator for PineHello and welcome to v1.00 of pineCalc - the calculator for Pine
A sleek, quick, and discrete calculator in a window pane in your chart!
Right now it supports basic math operation and series of two numbers but will try to update it and don't hesitate to comment any ideas
SOME FEATURES:
- Supports decimal numbers.
- Switch statement with option to choose Addition, Subtraction, Multiplication , or Division
- Choose any two numbers to use math on
- Inputs, Math Type and Result Output
Simple Percentage Change IndicatorFeatures:
- Shows % change per Bar.
- Shows countdown per bar.
- Shows Day, Month, and Yearly % Change in Bottom Right Corner.
Highlight last bar, work on all timeframe, v4 & v5 @magnummHighlight last bar only. No refresh needed.
Works on all time frame and for version 4 & 5.
Can be added in your own scripts copy/pasting just one line.
//DON'T FORGET TO HYDRATE
Old Buddy Old Pal... Color Scheme Pallet GeneratorFor the Tasteful Pine Coder, Find your inner rainbow.
Color pallet tool with 7 standard colors as per syntax highlighters typical scheme.
Hue, Sat, Lum adjustments, transparency, and 4 different modes.
Please Share in comments any Chart Captures showcasing your designs if his tool helped you.
a library version is in the works as of may 2022. will enable a 7 color standard output direct into script with floating color input shifting of the whole pallet or partials.
(( next level past gradients)
RaenonX - NQ 7 InfluenceShows the top 7 NASDAQ 100 component stock (AAPL, MSFT, GOOG, AMZN, TSLA, NVDA, FB) influence as plot.
RaenonX - NQ 7 DashboardPlaces a table at the bottom right side showing the top 7 stocks (AAPL, MSFT, GOOG, AMZN, TSLA, NVDA, FB) current position for the given MA and daily position.
The 2nd row shows the current position related to the prior day open/high/low. There are 4 possible values:
H+ : Higher than the prior day high - indicates bullish in daily timeframe.
O+ : Higher than the prior day open - indicates pro-bullish consolidation in daily timeframe.
L+ : Higher than the prior day low - indicates pro-bearish consolidation in daily timeframe.
L- : Lower than the prior day high - indicates bearish in daily timeframe.
The 3rd row shows the current position related to the given SMA parameters. The default period is 22 using 5 minutes timeframe. There are 4 possible values:
B+ : Higher than the SMA upper band - indicates bullish movement.
+ : Higher than the SMA - indicates pro-bullish movement, possibly consolidating.
- : Lower than the SMA - indicates pro-bearish movement, possibly consolidating.
B- : Lower than the SMA lower band - indicates bearish movement.
Template Signal IndicatorThis script is an example on how to create a custom indicator that produce start/end long/short deal signals based on configurable conditions from internal and external indicators.
This indicator can be used as an external indicator to other strategies like "Template Trailing Strategy" that will execute the deals and enter the desired positions based on the signals produced by this script.
Combining this script with the aforementioned strategy (or any other compatible) has the advantage that you can backrest the results of your custom deal conditions. Also additional functionality that is provided by the strategy can be utilized (e.g. Take Profit Targets, Trailing Stop Loss etc.).
In this particular example I combined the RSI and Stoch RSI indicators (internal) with the "Trend Explorer" indicator (external) so it produces buy and sell signals based on the logic I defined in the input tab of this indicator. To combine "indicators on indicators" you need Pro+ TV subscription.
The convention I use to communicate the signals is the following (2 -> enter long, 1 -> exit long, -2 -> enter short, -1 ->exit short). However, this convention is also configurable in the consumer/strategy script "Template Trailing Strategy" so make sure that both script "speak the same language" before procced.
No Active BarThis is probably the only script on TradingView that's clinically proven to lower your blood pressure!***
This script in conjunction with some chart settings changes can completely hide the active candle, only showing historic candles, thus, reducing risk of cardiac arrest and or panic attack.
What to do:
0. Make sure you are using a candlestick chart or this script won't work properly
1. Right click the chart and select "Settings..."
2. Select "Symbol" under the "Chart Settings" menu
3. Disable every item EXCEPT for the "Body"
4. Click on the boxes next to "Body" to access the color picker then change both box's transparency settings down to 0
(the script only colors closed bars, so the active bar will be present just transparent)
5. Right click on the price scale on the far left or far right side of the screen and hover the mouse over "Labels". If any selections have a check mark next to them click them to disable them (especially the "Ask & Bid" price setting since it tracks current price)
That's it! Instead of wicks the High & Low prices are plotted above and below the candles using a step line. It looks a bit strange at first but you'll get used to it. Check out the indicator settings to change the color and style of the High & Low lines.
***The statement could prove true for some but is mostly complete bullshit
Lunch-BreakThis script is only for Lunch breaks of London, NYSE and Tokyo session for those who don't want to trade between in these times.
Custom Multi-Timeframe IndicatorIt's a pretty simple example of a nice custom screener you can run for multiple timeframes. This is an RSI screener, but you can easily change the function for your own Indicator.
Screener displays:
Last value of the instrument
RSI value for up to 10 instruments / 4 timeframes.
In Parameters you can change:
4 timeframes
10 instruments
Parameters for RSI
Styling parameters for table
If the selected timeframe will be lower than the current one you will receive a warning message in a table.
Thanks to @MUQWISHI to help me code it.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
TRADEMASTER 2.35Trade master Trend Finder This is a volatility tool designed to get the daily bottom and top values calculated using a daily ATR and IV values. ATR values can be calculated directly, however for IV I recommend to take the values from external sources for the asset that you want to
Front Angler Percent CJA nice little gadget.
Can be used to visually hint on volatility.
Will show a leading vertical bar which shows percentage of price, both up and down, in relation to current price.
Easy Backtester PROWHAT IS EasyBacktester ?
EasyBacktester is a tool that helps you backtest trading strategies built by yourself with an included strategy builder and a multitude of options.
From within the parameters of the tool, you can specifically pick your entry settings across 12 most common indicators, such as "RSI", "MACD", "Moving Averages" etc... Then you can immediately visualise your setup's Stop-loss & Take Profit, your expected Profits & Loss and a lot of other statistics for your entry strategy. Once you are satisfied with your entry strategy, you are given a set of tools to optimize your setup using stop-loss rules, take profits rules, partial profits, trailing-stops, entry timing...
WHY IS THIS TOOL DIFFERENT ?
EasyBacktester is a backtesting engine with no coding skills required. TradingView allows for "Strategy Scripting" using PineScript, which is not an option for non-coder audience. EasyBacktester fills this gap and allow non-coders to get an idea of how their trading strategies may perform using mouse clicks only.
Some similar attempts have been made on TradingView, allowing some limited options, but none have the same capabilities EasyBacktester offers, for instance, as of April 2022 these features have not been seen in any other TradingView tools:
- partial take profits
- leverage simulation
- a multitude of trailing stop-loss possibilities including trail triggers and trail parameters
- visualisation of entries including stop-loss, take profits, partial take profits, and trailing stops. One can now visualize such complex setups.
- visualisation of Profits & Loss
- time in trade
- wait strategy after a signal: for example, when RSI is oversold, "WAIT until price retraces 100% of the original signal" amongst other possibilities
QUICK START GUIDE:
STEP 1: DEFINE YOUR SIGNAL STRATEGY
From the settings of the tool, find the "SIGNALS STRATEGY" section.
Select a type of entry you wish to simulate, for example "LONGs", and activate the checkbox right before "Simulate".
Right below, you will find 4 signal builder for you to play with and pick your strategy accordingly.
For example, to simulate a signal when RSI is oversold, follow these steps:
- On the 1st multiple choice box, select "RSI"
- On the 2nd multiple choice box, select "is below..."
- On the 3rd multiple choice box, select "OverSold level"
Don't forget to activate this rule by checking the checkbox in front of it.
After this first step, one should immediately see the chart affected with some plots. The dots represents the signal entry defined by the rule we just created, and the red/green boxes visually represent trades that could have been taken with this signal which, in this example, occurs "when RSI is below oversold level". Note that all specific parameters for RSI including its specific "oversold level" is customisable at the end of the tools settings along with all other indicators settings.
STEP 2: STATISTICS
By default, the "APPEARANCE" section only plots potential entry signals (materialized by dots) and actual entry boxes (materialized by red/green boxes).
But the user can easily add other precious statistics to the chart, and obviously the most important one for backtesting: Profits & Loss (P&L).
In the "STATISTICS" section please check the "P&L" box to see appear a chart of the simulated P&L for our example. You should immediately see a new graph below the chart representing the evolution of the P&L after each entry.
Other statistics are available to the user, including: Equity, Number of Trades, Time in Position, Number of trades Won, Number of trades Lost, Number of trades Stopped.
Play around with those to see them plotted on your chart.
STEP 3: OPTIMIZE YOUR ENTRY
Under the "ENTRY STRATEGY" section, one can pick how to enter AFTER the signal, which provides the user with an extensive flexibility to pick its timing.
Here there are a various set of choices offered, ranging from the default "Market Order at Next Candle Open", to "Limit Order: at signal's candle open" or even "Stop-Buy: at break of last candle high". As its name suggests, this option allows you to actually wait before randomly enter in trade.
It is important to also note that the user can totally prevent entry if the conditions are not filled after a customizable number of candles represented in "Max bars to wait for entry" (default being 1, meaning the engine will wait the condition to be filled during only 1 candle)
STEP 4: MANAGE YOUR RISK
Under the "RISK MANAGEMENT" section, the user is given a series of options to set the amount (s)he would like to risk.
This is extremely important to set, and is the result of a combination of customizable options including:
- the Initial Capital of the account
- the amount to risk per trade, and HOW to risk it: some fixed % the initial equity or adjust the stop-loss to the desired risk ?
- use of leverage or not
- initial stop-loss, as well as minimum and maximum
- trailing stop-loss: what should trigger the trailing ? and by how much should the engine trail ?
STEP 5: HAVE AN EXIT PLAN
Under the "EXIT STRATEGY", the user can define how to exit the trade.
For instance, here again a lot of options are given:
- Take Profit: exit at some level of profits defined by a multiple of the stop-loss, or a multiple of the ATR, or some % or points
- Partial Profit taking before exit
- Panic close position after some time spent on the trade
STEP 6: FURTHER OPTIMIZATIONS
Under the sections "Commissions" & "Calendar & Sessions", one can simulate real trading conditions by including commissions fees as well as filtering actual dates and trading sessions. These sections are straightforward for any user to use.
SETP 7: INDICATORS SETTINGS
Since EasyBacktester uses a predefined set of indicators to get started, those indicators are also customizable in the last section of the settings. Here, one can easily customize RSI periodicity, MACD lengths, Moving averages types & lengths, ATR, etc...
STEP 8: GOING FURTHER
This is only a start to give users an overview of how various options affect their trading performance. But of course, each trader has its special recipe and specific detailed setup that is not possible to embed in a single tool. For advanced simulation, EasyBacktester provides plug & play connectors for advanced users. Namely, there are 3 connectors:
- signal connector
- trail trigger connector
- exit connector
Each of these connectors are an opportunity to customize the engine signals, trail trigger and exit choices with the user's own options. This case does require a little bit of coding, but it can easily be implemented by copy-pasting existing resources or with a slight help of a professional. In fact, the only conditions to build a proper connector is to export a plot with the numbers 1 (for signals), 2 (for trigger trails) and 3 (for exits). Here is an example of custom SIGNAL connector compatible with EasyBacktester, to produce a signal when last RSI was below 30 and current RSI reads above 30:
============================================================
//@version=5
indicator("My custom RSI signal")
// when previous RSI 14 was below 30 and current RSI 14 is above 30, set "custom_signal" to 1, otherwise set "custom_signal" to 0
custom_signal = ta.rsi(close, 14) < 30 and ta.rsi(close, 14) > 30 ? 1 : 0
// Export a plot of "custom_signal", but do not display it
plot(custom_signal, title="my signal", display=display.none)
============================================================
Once this indicator has been built, the user only needs to connect it with EasyBacktester as follow:
1. Open a desired chart, and add both EasyBacktester indicator as well as the custom "My custom signal" we just created above.
2. Open EasyBacktester's settings, and in the first option, there is "Connect signals source" which by default is set to "close". In the multiple choices, find your custom signal which should be named something like "My custom RSI signal: my signal", generally speaking the name is built like this " : ".
3. Now the custom code is connected to EasyBacktester, but we need to indicate the engine we actually want to use it as custom signal.
4. Under the "SIGNALS STRATEGY" section, where we generally build signals rules, there is special rule for this specific connection named "Use external source as entry signal". Just check the checkbox to activate it and see how the chart took our custom signal into consideration.
That's it for the overview of EasyBacktester. Thank you for reading and happy trading :)
Ultimate risk management toolHow to use:
Use the cursor to select the time, entry, stop loss, and target position. Then a window will pop up and type the trading fee or any other things you want to adjust to calculate the actual reward/risk ratio according to the price you selected.
Known error:
Settings of this script can't be saved as default might due to the interactive price selection function. If anyone knows how to fix it, please let me know.
feature:
1. Dynamic profit label can move up and down vertically on the right-hand side of the box.
2. The breakeven line can tell you you can move your stop loss to the entry price when the price reaches it.
3. Calculate the actual reward/risk ratio based on the trading fee. The calculator only calculates the actual Risk/Reward Ratio, which might be helpful for scalpers.
4. When the price touches sl or tp, that side of the box will be highlighted. Sometimes it doesn't work but I will try my best to fix it. Feel free to share your idea to help me to fix it.
5. Price alert. This tool compares with the alert function but reopens it if you want to change the alert price.
CRYPTO MARKET SESSION ANALYZER INDICATORCrypto Market Session Analyzer is an easy-to-use yet powerful analysis tool that helps the trader visualize and analyze price movements over three different trading sessions:
1) European Session
2) US session
3) Asian session
Automatically tracks the corresponding levels for each market session.
This indicator can be used on all timeframes equal to or less than 15 minutes.
Although this is a simple indicator to use, some care must be taken when using it. The trader must be careful to set the correct times for each session according to his UTC timezone. By default the indicator uses UTC. If your console is set to UTC + 2 for example, you will need to take this into account and align the times correctly. You can adjust the time for each session from the user interface. Following the example, if the opening of the UE session is set to 9 and UTC of your console is set to UTC + 2, the script will proceed to create the level at opening time 11.
HOW IT WORK
The indicator automatically draws a horizontal line at the open and a horizontal line at the close of each session. The indicator clears past support and resistance every 24 hours to provide a clean and easy-to-read chart, updating new levels session after session.
Blue indicates the EU session.
Orange indicates the US session.
Purple indicates the Asian session.
Input Text Area to Array then Reshape Table█ OVERVIEW
Simple method to convert from input.text_area to array using str.split.
Reshape table using switch, not necessary must use matrix.reshape.
Might be useful pine script to replace input.symbol.
█ FEATURES
Table can positioned by any position and font size can be resized.
Reshape table and sorting array if necessary.
█ CREDITS
Credits to TradingView for new update of input.text_area.
[TTI] StockBee labelsHISTORY AND CREDITS –––––––––––––––––––––––––––––––––––––––––––––––––––––––
Since I am getting a big interest in the StockBee's TI65 indicator, I decided to make another one which covers the rest of the things I have seen on his chart.
WHAT IT DOES ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
👉 StockBee Labels = these include important measurements that you can have on the chart
— V = Traded Volume Today
— $ = Dollar Net Change Today
— Stop = Stop which is calculated by Low + 1/2 Trading Range
— TI65 = Absolute momentum value
— LD1 = Yesterday's Low
— TC = Todays True Closing Range
— MDR = Modified Double Trouble
Hover over the cells to get additional information
👉 Unusual Volume Bubble = these indicate when an unusually big volume has occurred
👉 Daily Bull/Bear Flags = Technical formation for Bull and Bear Flags
HOW TO USE IT –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
👉 StockBee Labels = can be used to determine the momentum strength, stop losses and general movement of stock. They are really good utility labels
👉 Unusual Volume Bars = Indicate significant times in the development of the tickers price movement. These signal extra caution as can be a begining of a big move
👉 Daily Bull and Bear Flags are technical patterns. If you look to trade Bull Flags make sure there is a preceding trend, consolidation channel and good volume pattern beforehand
Positions Watcher & Gain/Loss LinesPositions Watcher & Gain/Loss Lines is a companion table indicator that keeps an eye on open positions, regardless of the ticker you are currently viewing.
Keep track of up to 20 positions and their change on the day as well as the gain/loss of your positions. There are 9 different default positions as well as the ability to add a gap from the borders, incase you have other information already in the default position you want to use. It also has the ability to change the width of the table borders.
Additionally, this indicator provides the ability to overlay gain/loss horizontal lines at set percentages. This can be based on the positions that are set, in addition to placing lines on all charts starting at the close, open, high or low.
Part of this indicator is based on the following indicator and at some point the plan is to merge both indicators.
Have modification ideas for this indicator? Just let me know and I will gladly consider them!