Math RoundHello Reader,
This is Observer from Vietnam.
PURPOSE
I'd like to share my script for Round Math, it's for only education purpose.
I make the formula math_row(x, y) to round the value as we design and shorten the number appearance (value). It's more flexible than str.tostring(close,format.volume) or others.
HOW TO USE
Formula math_row(x,y)
- x is the value which need to be rounded or shorten
- y is the number which you want to round after "." symbol.
***Shorten***
If x < 1.000, no shorten
If x >= 1.000 and x < 1.000.000, shorten to thousand value with "K" letter
If x >= 1.000.000 and x < 1.000.000.000, shorten to million value with "M" letter
If x >= 1.000.000.000, shorten to billion value with "B" letter
***Round***
If y = 0 => no round
If y = 1 => round to format ###.#
If y = 2 => round to format ###.##
If y = 3 => round to format ###.###
If y is other => round to default format of Tradingview
EXAMPLE
math_row(1.002342, 3) = 1.002
math_row(1923.321, 2) = 1.92K
math_row(221452133, 1) = 221.5M
Hope it useful and clear to you.
Round
TSG's Binance Round NRs - only for BTCThis is good real-time / scalp indicator for those scalping Bitcoin.
It is based solely on Binance's BTCUSDT Perpetuals, but can be used on any BTCUSD pair as I am requesting info directly from Binance's chart.
IDEA
I have spotted that many times, round nrs (most likely caused by algo-trading) mark a top / bottom on a trend. Many times have catched extremes because of this technique and I have now coded it into an indicator on TradingView.
Feel free to test it out - It's not a 100% strategy - but if you spot round nrs around confluences - your odds go up big time.
SETUP
You are able to set the amount of candles you want to search for - default is 20.
Ofcourse we look only for extremes, therefore it will only look for extreme highs and lows within the amount of candles of your input.
HOW TO READ IT
The indicator will mark only the last High and Low matching the criteria - above and below the candle with the price number.
Good luck!
Quarter Theory LevelsQuarter Theory Levels is a script that will create level lines based on major round numbers and spilt those levels into half and quarter ranges. This tool is intended to help traders see major levels that price will likely react to in the future.
The Script is inspired by Quarters Theory.
Round Number LevelsQuick Script to mark out round number levels. These levels often become reversal points or where the next price range will develop. This script is intended to be a tool to aid along with additional trading strategies.
Round Numbers and Quarter LevelsThis script is based on "Round Numbers Above and Below" by BitcoinJesus-Not-Roger-Ver, but unlike this script that only shows "Round Numbers" levels, my script also shows "Quarter Number" levels like 25 and 75 that are very important for those who follow the quarters theory.
Also the original script doesn't have different colors for different levels while my script has different colors and different styles for every level, this way it will be much easyer to recognize the levels at first sight.
Finally the origianl script only works with Forex while my script also works with indexes like SP500 and others.
Round Numbers are very important psychological levels in trading but also quarters levels (25 and 75) have a huge importance, so I created this script that shows all these levels with different colors and different lines style.
You can edit the color and the style of the lines as you wish and you can add all the levels you want.
In 1 hour chart 4 levels is usually enough but if you watch a daily chart then 8 levels is way better.
Features:
Personalize color to 00 round levels
Personalize color to 50 round levels
Personalize color to Quarters levels
Personalize line style to 00 round levels
Personalize line style to 50 round levels
Personalize line style to Quarters levels
Choose number of lines above and below price level (4 is default)
Auto Round levels by Script051This indicator is designed to show psychological levels/round levels.
The difference between this version and the others is that :
It will automatically show round levels for each symbol you select without having to enter "tick value" manually.
Settings
Gap : If the value is equal to zero, the round levels will be found automatically, but if you change the value, the gap between the lines will be adjusted based on the value you specified.
X2 and /2 : doubles or halves the distance between round lines
Number of lines : Specifies the number of lines to be displayed
Round Open and CloseHighlights the candles having round numbers or having decimals 0.1 as opening or closing
Bank Levels - Psychological Levels - Bitcoin, Indices, ForexThis got removed so I'm publishing it again.
What it is:
- This script draws in levels refereed to as bank levels. They are basically psychological/even numbers(40000, 45000, 150, 1850..)
Why doesn't it work on some charts?
- Each pair has a different tick value. You will have to edit the code to make it work on certain pairs. It's pretty simple, take a look.
RK's 18 ∴ All Sources Auto Support and Resistance IndicatorThis indicator will do a logarithmic base round in any of traditional Trading View Sources to get the Support and Resistance values, then will draw lines in the most repeated prices levels.
Higher values in "Precision Digit" input will make it more precise.
Mod and Round To Tick FunctionI have not found this function anywhere on Tradingview but it can be very useful in setting orders in a strategy and non-integer boundaries for certain indicator designs. Its a bit underwhelming, but in other languages you can call a mod() function and the output will be the remainder of the integer.
If you want to set an order at a specific tick value, particularly in futures, you can't set it at a specific tick when using calculated values like ATR or Standard Deviation without a function like this.
It can also be used to clean up certain band/envelope style indicators if you want to have a straight line, but don't want to simply round to an integer.
Credit for the round to tick aspect goes to the eternal fountain of resources, the Backtesting & Trading Engine script from @pinecoders
This is just another tool to throw in the box for when you might need it.
Efficient Support & Resistance LevelsThis script is a mixture of my two previous scripts "True Strong Classical Support/Resistance Levels" and "Hidden Supports & Resistances + Round Levels". This combination brings on better identification of the most efficient support/resistance levels.
Note that "Hidden SnR Levels" part of the code is only expected to work on Forex charts, but apart from that, the other parts could be applied to any chart.
The script may:
- Draw classical support/resistance levels which retraced the price previously, aided by multi-timeframe analysis
- Draw hidden support/resistance levels based on psychological patterns of the price
- Adjust to wicks better than Pine Script built-in pivot functions
- Differ the levels color based on chart reactions
- Merge nearby classical levels to avoid congestion on the chart
Feel free to use it and send me your thoughts.
Proper Round Functions [QuantNomad]Round function in PineScript is very simple and allows you to round numbers only to the closest integer number. This is a bit irritating because I very often have to round numbers to some decimal places and not integer.
So I created 2 functions I use all the time and now sharing them with you.
roundn - rounds the values in its first argument to the specified number of decimal places.
roundtick - rounds the values to current symbol mintick
I hope they will be useful for you.
Hidden Supports & Resistances + Round LevelsIf you search the internet, you won't find much about these types of resistance and support levels. Hidden levels are SnR levels calculated based on some psychological patterns and sometimes it's unbelievable that the chart responds to these levels.
So use the indicator and check the idea.
dP magnet//Strategy based on the idea that stop loss and take profit are often placed at full price levels or round numbers, whcih acts as resistance and supports levels
//Buy Rules:
//Actual price (close) is above round number.
//Round number level was not touched in previous ten bars (arbitrary value).
//Place a buy and follow the order with a trail step because price can bounce at round number (support) or can go through it.
//Sell Rules are the same of buy rules but inverted.
//
//Need improvement on conditions' logic and round numbers definitions