Channel Take Profit Tool for AlertatronWhat is this for
This tool is designed as a companion to an automated strategy running on Alertatron. Sometimes when a strategy opens a trade, you decide that based on TA you would like to close all or or a portion of your trade at a support or resistance level. The strategy may already be programmed to take profit but this tool allows you to add additional take profit criteria that can trigger an alert to Alertatron if it happens before the strategy closes.
How to use it
When you add the indicator to your chart, it will ask you to select two points on the chart. These two points will be connected by a line and create the parallel channel that will be used for triggering a take profit alert. The offset is how wide you want the channel to be. When the high or low of a candle enters the channel from either direction, the alert will be fired. AFTER you add the indicator to the chart and configure ALL of the settings, you need to create an alert on the indicator for "All Alert Functions" and paste your incoming alert webhook from Alertatron into the webhook input.
Alertatron Setup
You will need to provide the API name that you have configured in Alertatron that matches the account the trade is open in. This tool supports ByBit and FTX.us by may work with other exchanges too (this option just chooses which currency/pair divider is used in the alert message).
Pine utilities
CosmoSetContains widely use indicators
This contains below indicators
RSI
WMA
SMA
EMA
Colored Vwap
Super Trend
All the above indicators are customizable.
Market MonitorThe script can be used to send a JSON message to the webhook once per time. For example, to store market conditions in an external database. The latter is make sense for smaller timeframes due to TradingView limitations on the number of available bars. The interval between messages can be set in the settings. To set up transmitted market metrics, you will probably need to modify the script code to add metrics that are important to you.
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.
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)
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.
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 :):)
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.
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
Futures Exchange Sessions 3.0Description
The ultimate conclusion to the Futures Exchange Sessions 2.0 indicator. In version 3.0 the user gets full control of the start and end times of three separate dynamic boxes and one horizontal line. If the user wants to visually keep track of killzones, lunches, or any other time span in a trading day, version 3.0 will dynamically expand and keep track of price within the time specified by the user.
Inputs and Style
Everything about the three dynamic boxes and one horizontal line can but independently configured. Color, style, border, width can all be adjusted. In the Settings each box has a text box so the user can give each one a unique name.
Timezone
All of the start and end times are in EST. Additionally, each box and line need a dependent start of each day. This is controlled by a setting where the user can specify a timezone called Start Day Timezone which would be midnight of the respective timezone. In general if a box or line resides within a particular Session pick the corresponding timezone. If the users box/line fits in the Asian Session then choose Asia/Shanghai. If the box/line is within the London Session then choose Europe/London. And the same goes for the New York Session.
Special Notes
If start time is within one period of the Start Day Timezone in the Settings, then the line/box won't display
Boxes and time lines only display when timeframe is <= 30 minute
To turn off box text label set opacity to 0%
Light or Dark Mode Tutorial - Luminance DetectionAs a colorblind trader, I think accessibility is a big deal. This script auto detects the chart background color and optimizes text color based on luminance.
Luminance detection is based on pine script new chart.bg_color feature, allowing lines, tables, etc to be optimized. Thanks to TV team for releasing this in the latest update/blog post today! This makes it simple to optimize scripts based off the knowledge that max luminance = 765 (rgb 255 + 255 + 255), thus we know that lum <= 383 is "dark mode" and lum > 383 is "light mode".
Try changing the chart background color and see how this script changes the table printed on the chart. I hope more script authors will begin to utilize this concept and that even better contrast detection may be built future pine script iterations.