RaenonX - Manual PnL TrackerChange the "ticker" field in the settings to the ticker to track (for example, "SQQQ") before use.
Manually track the PnL of a single ticker.
The current PnL will be shown at the right bottom of the chart.
Сферы применения Pine
Candle Fill % MeterFor use with Hollow Candles
Fills Candles based on either the value of the RSI or coppock scaled to fit properly between the open and close. Makes for a compact visual with lot's of information given. Toggle bells and whistles in settings such as arrows to indicate the direction of the value being measured, dividing levels, fill from candle open all the time instead of the bottom up and more.
Weighted percentile nearest rankYo, posting it for the whole internet, took the whole day to find / to design the actual working solution for weighted percentile 'nearest rank' algorithm, almost no reliable info online and a lot of library-style/textbook-style solutions that don't provide on real world production level.
The principle:
0) initial data
data = 22, 33, 11, 44, 55
weights = 5 , 3 , 2 , 1 , 4
array(s) size = 5
1) sort data array, apply the sorting pattern to the weights array, resulting:
data = 11, 22, 33, 44, 55
weights = 2 , 5 , 3 , 1 , 4
2) get weights cumsum and sum:
weights = 2, 5, 3 , 1 , 4
weights_cum = 2, 7, 10, 11, 15
weights_sum = 15
3) say we wanna find 50th percentile, get a threshold value:
n = 50
thres = weights_sum / 100 * n
7.5 = 15 / 100 * 50
4) iterate through weights_cum until you find a value that >= the threshold:
for i = 0 to size - 1
2 >= 7.5 ? nah
7 >= 7.5 ? nah
10 >= 7.5 ? aye
5) take the iteration index that resulted "aye", and find the data value with the same index, that's gonna be the resulting percentile.
i = 2
data = 33
This one is not an approximation, not an estimator, it's the actual weighted percentile nearest rank as it is.
I tested the thing extensively and it works perfectly.
For the skeptics, check lines 40, 41, 69 in the code, you can comment/uncomment dem to switch for unit (1) weights, resulting in the usual non-weighted percentile nearest rank that ideally matches the TV's built-in function.
Shoutout for @wallneradam for the sorting function mane
...
Live Long and Prosper
Sovereign Gold Hodlers Script for comparing nations and their gold, with options including:
Default Comparing the Price of Gold
Use Relative Valuations price / prior price
Measure Reserves/Price
GDP/Gold Price
GDP/Gold Reserves
Given the state of the world I thought it'd be good do see where countries stand, how much real money they hold. I think gold is going to play an increased role in trade between economies in the near future.
FUNCTION: Limited Historical Data WorkaroundFUNCTION: Limited Historical Data Workaround
If you are working with bitcoin weekly charts, or any other ticker with a low amount of price history this function may help you out. For example you want to apply indicators to some shitcoin that just launched? This can help you.
It can be frustrating to use certain built-ins since they will only give an output once the full lookback length is available. This function allows you to avoid that situation and start plotting things with almost no history whatsoever!
In this example code we do it by utilizing a replacement for the built in pine SMA function. This function allows us to pass a series instead of just a simple int to the length variable of the SMA. This can be achieved with all the pine built ins and I believe @pinecoders has a publication already detailing many of them with full coded examples.
Then we replace the length of the SMA with the custom history function. It checks to see if the current bar index is less than the length of the function. Then if it is, it changes the length to the bar index allowing us to get plots and series earlier than otherwise possible.
Sessionshighlight background of charts when withing trading sessions
Timezone: string: can put GMT+8 etc , for all options , check timeframe.time docs, under Timezone variable
Symbol InfoFor those who likes clean chart:
Adjustable Symbol ticker and timeframe( AKA watermark) script is here.
1: You can place Symbol ticker and timeframe info anywhere on the chart.
Also you can hide one of them or both.
Position:
Horizontal options: Left Center Right
Vertical options: Top Middle Bottom
Size: Tiny Smal Normal Large Huge Auto
Color is adjustable. Background is optional too.
2: Even more cool part is you can add 2 different custom texts that can switch. (Idea from Pinecoders original script)
You don't have to use text function and reposition it everytime, your message will always stays at one place.
Let the chart deliver your message.
I put my favourite trading slangs there:
1. Do Your Own Research (DYOR)
2. Not a Financial Advice ( NFA)
Position -/ lot size calculator - SonarlabCalculating a lot size in MetaTrader is normally not a quick task, but it is a very important one.
MetaTrader doesn't offer a fast way to calculate the position size, so, usually, a trader needs to manually perform several calculations.
When you are submitting an order, you are already supposed to know and type in the lot size for the trade. It can be frustrating to calculate - that's why we made this tool to speed up the process a little. Now you can also see your P/L live and calculate the lot size within seconds straight from Tradingview.
Usage:
Step 1: Set your entry price
Step 2: Set your stop loss
Step 3: Set your Target
Step 4: Choose the symbol, forex will be automatically detected
Step 5: Fill in your balance and set your risk settings
Parameters
- Set symbol: Forex (auto detection), US100, US30, BTC, XAUUSD, NGAS, XBRUSD, XTIUSD, AUS200, US500
- Account balance
- Risk in %
- Contract size
- Levels: Stop loss, Entry, Target 1, Target 2, Target 3
- Display settings for the Trading Panel
Trading panel
- Show Live P/L
- Show Risk to reward
- Show lot size
- Show risk in %
- Show account balance
- Show money at risk (no commissions included)
Option Calculator [elio27]Option Calculator is a simple tool to help people visualize their option positions directly on the chart, it also gives some useful numbers about the position, such as the Break Even point or the net return for example.
Be careful what you do with options, you can easily make mistakes as it is not as easy as spot or futures trading for beginners.
R:R Trading System FrameworkFirst off, huge thanks to @fikira! He was able to adapt what I built to work much more efficiently, allowing for more strategies to be used simultaneously. Simply put, I could not have gotten to this point without you. Thanks for what you do for the TV community. Second, I am fairly new to pinescript writing, so I welcome criticism, thoughtful input and improvement suggestions. I would love to grow this concept into something even better, if possible. So please let me know if you have any ideas for improvement. However I do juggle a lot of different things outside of TV, so implementations may be delayed.
I have decided, at this time, not to add alerts. First, because I feel most people looking to adapt this framework can add their own pretty easily. Also, given how customized the framework is currently, while also attempting to account for all the possible ways in which people may want alerts to function after they customize it, it seems best to leave them out as it doesn't exactly fit the idea of a framework.
For best viewing, I recommend hovering over the script's name > ... > Visual order > Bring to front. Also I found hollow candles with mono-toned colors (like pictured) are more visually appealing for me personally. I HIGHLY RECOMMEND USING WITH BAR REPLAY TO BETTER UNDERSTAND THE FRAMEWORK'S FUNCTIONALITY.
▶️ WHAT THIS FRAMEWORK IS
- A huge collection of concepts and capabilities for those trying to better understand, learn, or teach pinescript.
- A system designed to showcase Risk:Reward concepts more holistically by providing all of the most popular components of retail trading to include backtesting, trade visual plotting, position tracking, market condition shifts, and useful info while positioned to help highlight changes in your risk:reward based decision-making processes.
- A system that can showcase individual strategies regardless of trade direction, allowing you to develop hedging strategies without having multiple indicators that do not correlate with each other.
- Designed around the idea that you trade less numbers of assets but manage your positions and risk based on multiple concurrently running strategies to manage your risk exposure and reward potential.
- An attempt to combine all the things you need to execute with an active trading management style.
- A framework that uses backtested results (in this case the number of averaged bars it takes to hit key levels) in real-time to inform your risk:reward decision-making while in-trade (in this case in your Trade Tracking Table using dynamic color to show how you might be early, on-time, or late compared to the average amount of backtested time it normally takes to hit that specific key level).
▶️ WHAT THIS FRAMEWORK IS NOT
- A complete trading product. DO NOT USE as-is. It is a FRAMEWORK for you to generate ideas of your own and fairly easily implement your own triggering conditions in the appropriate sections of the script.
▶️ USE CASES
- If you decide you like the Stop, Target, Trailing Stop, and Risk:Reward components as-is, then just understanding how to plug in your Entry and Bullish / Bearish conditions (Triangles) and adjust the input texts to match your custom naming will be all you need to make it your own!
- If you want to adapt certain components, then this system gives you a great starting point to adapt your different concepts and ideas from.
▶️ SYSTEM COMPONENTS
- Each of the system's components are described via tooltips both in the input menu and in the tables' cells.
- Each label on the chart displays the corresponding price at those triggered conditions on hover with tooltips.
- The Trailing Stop only becomes active once it is above the Entry Price for that trade, and brightens to show it is active. The STOP line (right of price) moves once it takes over for the Entry Stop representing the level of the Trailing Stop at that time for that trade.
- The Lines / Labels to the right of price will brighten once price is above for Longs or below for Shorts. The Trade Tracking Table cells will add ☑️ once price is above for Longs or below for Shorts.
- The brighter boxes on the chart show the trades that occurred based on your criteria and are color coded for all components of each trade type to ensure your references are consistent. (Defaults are TV built-in strategies)
- The lighter boxes on the chart show the highest and lowest price levels reached during those trades, to highlight areas where improvements can be made or additional considerations can be accounted for by either adjusting Entry triggers or Bullish / Bearish triggers.
- Default Green and Red Triangles (Bullish / Bearish) default to having the same triggering condition as the Entry it corresponds to. This is to highlight either a pyramiding concept, early exit, or you can change to account for other things occurring during your trades which could help you with Stop and Target management/considerations.
TradingView and many of its community members have done a lot for me, so this is my attempt to give back.
Bot Controller V1.1This script allows you to define various trading sessions with alerts for when the session starts and ends. This allows you to do things like switch your trading bots off while you are sleeping.
It starts with default settings for weekday daytime, evening, nighttime, and weekends
Setup recommendations:
Use the Timezone setting in the indicator to match your trading view timezone setting to have alerts triggered when you expect
Add alerts from a lower TF e.g 1min chart
Use once per bar for the alerts
Notes on alerts:
If you have a session stop then immediately have another starting with no time break in between the start/stop alerts may overlap/trigger at the same time so it's probably best just to use the stop or start alerts for each session.
Trading Portfolio Tracker - The Quant ScienceTrading Portfolio Tracker - The Quant Science™ is a tracking and monitoring trades application.
It is a very useful Pine app for day traders and scalpers. This trading portfolio tracker is a unique solution for users who would monitoring their day trading performance instantly and make more efficient trade management decisions.
HOW IT WORK
The user enters the required data before the application is launched. The software automatically generates the portfolio tracking with all performance data information.
DESCRIPTION
This app keeps track of up to 10 trades simultaneously. The user can activate or deactivate each trade from the user interface.
Using this application is very simple. Install it on your monitor and enter the required data parameters.
Required data for each trade:
1. Open price
2. Invested capital
3. Ticker
4. Leverage
5. Direction
Once this data has been entered, the software will generate the portfolio automatically. You will be able to edit closed trades or newly opened trades directly from the user interface and the software will automatically update with the new parameters.
BINANCE_Minimum_qty_for_tradingWe can not buy just 0.001ETH in Binance on 2022.8.8
Why? Binance have trading role about the minimum qty of coins.
Until now, we can not find the info in TradingView.
I hope Our TradingView give us this updating info easily oneday.
I am not a good English speaker.
Sorry about my short explanation.
reference: www.binance.com
OHL Screener by KiranScript is intended to scan Open = High and Open = Low (OHL) stocks for selected Opening Range in minutes.
I have added NSE NIFTY 50 stocks as default input for the script. Hopefully it will work with other stocks and exchanges.
Opening Range time is limited to the "1 min, 3 min, 5 min, 15 min, 30 min and 60 min" as OHL generally required for Intraday.
Stock qualified criteria OPEN = LOW (in selected Opening Range timeframe) will be listed in the table at TOP RIGHT corner of the chart screen in a green background.
Stock qualified criteria OPEN = HIGH (in selected Opening Range timeframe) will be listed in the table at BOTTOM LEFT corner of the chart screen in a red background.
Script scans stocks irrespective of current chart symbol and current time frame on the chart.
Limitations:
- Maximum 40 stocks can be scanned.
- request.security can't be placed under loop hence repeat call to request.security should be placed on separate line
CLOCKDISXLAIMER
Please use this on 1 minute chart, (m1 chart has least amount of bugs, verify that your timeframe do not* Sync to layouts)
With this clock indicator you can set an alert to any time you choose when opening settings, also it will fit if you like dark theme or light theme.
There are more visualization settings that can be altered inside settings for better fitting in other resolutions / monitors, like tablets, laptops, TVs, etc.
Cheers, Green pips to everybody :):)
Grid Premium Indicator - The Quant ScienceGrid Premium Indicator - The Quant Science™ is an indicator that represent the grid trading strategy. Unlike our GRID SPOT TRADING ALGORITHM (which buys in a "buy the dip" style, offering a swing type operation) this indicator uses a trend following strategy with a larger number of grids.
A trend-following strategy in a grid algorithm allows you to open long positions if price rises and breaks up or open short positions if price breaks down.
This indicator was created following the guidelines of the best grid algorithms on 3Commas, Bitsgap, Kucoin, and Binance.
Our goal is to recreate a universal and trust model for all traders and investors who use grid algorithms for their trading.
The ideal market condition as for all grid algorithms is the side market. In the side market this algorithm will create profit during upward movements.
The trader using this algorithm can use it to:
1. Manual trading
2. Backtesting
3. Algorithmic trading
HOW TO SET UP
Using this indicator is very simple. We have configured the creation for a three-step set up. You can manage it without any problems experience in coding. All you have to do is click the grid start and end level and the indicator will automatically load generating the grids and backtesting.
OPERATIVITY
Each open trade is long and is opened when the price crossover an upward level. Each order is closed at the next level. If the price breaks upward or downward the extremes of the grid the algorithm stops trading and will not open any more positions.
FEATURES
Grids: this indicator generates 20 levels of grids.
Direction: opens exclusively long positions.
Strategy: trend-following.
Data table: a table collects all the quantitative data on the strategy's performance. By entering your broker's commission costs and initial capital you will have an instant report on the strategy's performance.
MAIN ADVANTAGE
Compound Interest: the high number of grids allows the gains from each trade to be reinvested quickly by speeding capitalization through compound interest.
LIMITATIONS OF THE MODEL
Like all grid strategies, maximum profit is made when the market is flat or sideways. A market with a bullish or bearish trend does not allow you to generate good profits with this strategy.
Future Risk CalculatorCreated out of revenge against the difficulty of controlling psychology, greed, and risk management. Designed for cryptocurrency futures trading by following the risk management principles from Kevin Sailly. Very welcome if there are suggestions and input to improve the quality of this "indicator". Please use wisely.
How to use:
1. Open indicator settings.
2. Fill out all the forms. (Note: I make Max Loss Risk only has 5 options. Because, you know, to control the greed. You can choose by considering your risk profiles and market condition)
3. All of the information and calculation will appear on the label (right side of the bar chart) and top-right box.
4. You can adjust the three prices (target, entry, and stop) by clicking any part of the indicator. There will be three dots in the middle of the chart window (align with three prices). Click that dots and drag them up/down to customize according to your wishes. The price order must be correct, for LONG direction the price order from the top is target-entry-stop. Vice versa for SHORT direction. There will be "SETUP ERROR" text in the top-right box if the price order is not correct.
"Never, ever argue with your trading system." (by Michael Covel)
Regards,
Ircham
Average Price LineThis was published in substitute of the original AVG price line that was already implemented into TradingVIew.
Get the average price in the desired range you want.
Output TunerA rolling summed window of input values changes with semi-stochastic processing modifying the input source with a power adjustment parameter.
Privately available is a fully dynamic float series inputs version for precision adaptability.
Ultra Magic 2.0 [Jay Jani]Have fun in one indicator. Many more to come.//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
watermarkOverview
This indicator allows you generate a watermark in your charts for your live streams without using additional software.
Features
The main differences with respect to the available tools are:
_ This indicator converts a input text to ascii art in a easy way. That means you won't need to run externals scripts to generate the data required.
_ The watermark can be configured to repeat the message to cover the whole screen or only a specific part.
_ Programmers can use this code as a reference to include additional fonts using ascii art in their charts.
Settings
Below are the available inputs used to configure the watermark:
Text : it's the message shown.
Style : it selects the font style.
Color : the color used in the watermark.
Size : this is used to change the font size.
Position : where the watermark will be applied.
Repetition : number of rows and columns where the watermark is displayed.
Spacing : it defines the horizontal and vertical spacing between the watermarks.
Enable frame : it includes a frame in the watermark.
If you think this type of tools are useful, please consider leave a comment and contact me for additional features.
Ness92