Gain Loss V2This is the Version Two of my Gain/Loss percent indicator, it's really simple but very handy indicator, when you go into a position, most of the time during a day trade, you don't have enough time to sit back and calculate the percentage of your gain or loss specially with maker/taker fee and leverage and sometimes funding fee you should pay the exchanges/brokers.
The default values for maker/taker and funding fees are set as you would encounter in Bitmex exchange. every 8 hours you are in position, you should rise the number of funding you pay by one, The rest will be calculated automatically.
Normally you need to set the fees for maker/taker and fund based on what your broker/exchange tells you once, then each trade, you set your entry point, being it a margin trade or not, and finally if it's margin, the direction and the leverage and that would be it.
Again, most of the time traders don't change their leverages, so you would set it for once and after that, you just set the entry, click the direction boolean and that is it.
The source is hidded but every one can use the script.
Percent
ec tEST cODE FOR pERCENT DIFERENCE ////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 04/04/2015
// Percent difference between price and MA
////////////////////////////////////////////////////////////
study(title="Percent difference between price and MA")
source = close
useCurrentRes = input(true, title="Use Current Chart Resolution?")
resCustom = input(title="Use Different Timeframe? Uncheck Box Above", type=resolution, defval="60")
smd = input(true, title="Show MacD & Signal Line? Also Turn Off Dots Below")
sd = input(true, title="Show Dots When MacD Crosses Signal Line?")
sh = input(true, title="Show Histogram?")
macd_colorChange = input(true,title="Change MacD Line Color-Signal Line Cross?")
hist_colorChange = input(true,title="MacD Histogram 4 Colors?")
res = useCurrentRes ? period : resCustom
fastLength = input(12, minval=1), slowLength=input(26,minval=1)
signalLength=input(9,minval=1)
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
Length = input(9, minval=1)
Length2= input(36,minval=1)
Length3= input(81,minval=1)
AveragePrice= input(9,minval=1)
Length5= input(3,minval=1)
xSMA = (sma(close, Length)+sma(close, Length2)+sma(close, Length3))/3
pSAM=sma(close, AveragePrice)
nRes = (pSAM - xSMA) * 100 / close
signalnRes = sma(nRes, signalLength)
macd = nRes
signal = sma(macd, signalLength)
hist = macd - signal
outMacD = security(tickerid, res, macd)
outSignal = security(tickerid, res, signal)
outHist = security(tickerid, res, hist)
histA_IsUp = outHist > outHist and outHist > 0
histA_IsDown = outHist < outHist and outHist > 0
histB_IsDown = outHist < outHist and outHist <= 0
histB_IsUp = outHist > outHist and outHist <= 0
//MacD Color Definitions
macd_IsAbove = outMacD >= outSignal
macd_IsBelow = outMacD < outSignal
plot_color = hist_colorChange ? histA_IsUp ? aqua : histA_IsDown ? blue : histB_IsDown ? red : histB_IsUp ? maroon :yellow :gray
macd_color = macd_colorChange ? macd_IsAbove ? lime : red : red
signal_color = macd_colorChange ? macd_IsAbove ? yellow : yellow : lime
circleYPosition = outSignal
// MA COLOR DEFINITION
maColor = change(nRes)>0 ? green : change(nRes)<0 ? red : na
mA_IsAbove = nRes> 0
mA_IsBelow = nRes< 0
plot( nRes, color=maColor, style=line, title="MMA", linewidth=2)
//plot(smd and signalnRes ? signalnRes : na, title="Signal Line", color=signal_color, style=line ,linewidth=2)
//plot(smd and outMacD ? outMacD : na, title="MACD", color=macd_color, linewidth=4)
//plot(smd and outSignal ? outSignal : na, title="Signal Line", color=signal_color, style=line ,linewidth=2)
//plot(sh and outHist ? outHist : na, title="Histogram", color=plot_color, style=histogram, linewidth=4)
plot(sd and cross(outMacD, outSignal) ? circleYPosition : na, title="Cross", style=circles, linewidth=4, color=macd_color)
hline(0, '0 Line', linestyle=solid, linewidth=2, color=white)
//////ALERT cONDITION////
src = input(close)
ma_1 = sma(src, 20)
ma_2 = sma(src, 10)
c = cross(ma_1, ma_2)
alertcondition(c, title='Red crosses blue', message='Red and blue have crossed!')
d = cross(outMacD, outSignal)
alertcondition(d, title='GOING DOWN', message='SELL!')
//
//e = cross(outSignal, outMacD)
//alertcondition(E, title='GOING UP', message='BUY!')
Multiplier ChartI am proposing an alternative to the percent change.
An alternative that is symmetrical to both positive and negative change, unlike percentage change.
The simple idea is to have a positive number if the reference value (called val in the script) is lower than the stock value and needs to be multiplied;
a negative number instead if the reference number is higher than the stock value, so the reference value needs to be divided.
Multiplying all by 100 to give clearer and more readable results, the Multiplier would have a huge gap between +100 and -100, because a stock multiplied by 1 or divided by 1 are the same thing.
So we need to compromise and move all positive numbers down by 100 and all negative numbers up by 100. This actually gives a similar result to percentage change, and it is actually identical in the positive range.
The fundamental difference lies on the negative range, which is completely symmetrical. So if a stock goes up 100 points one day (doubles), and the next it goes down another 100 points (halves), at the end of the second day the stock has the same value as it had at the beginning of the first day! On percentage change it would be +100% the first day and -50% the second.
We mustn't undervalue the human tendency to compare a 1% change to a -1% change, but they do not mean the same even if they seem to indicate so.
A clear example of this can be found on CMC 0.60% -3.56% -3.56% (CoinMarketCap), in which each day are shown the best and worst performing coins of the day. So you might see a +900% there in the top performing, but you'll never see a -900%, because percentage change cannot go further than -100%. It is a fundamentally asymmetric scale that can confuse people a lot especially in those fast moving new markets.ù
I am welcome to feedback and all kinds of opinions and critics.
Some interesting things to note: you can use it as a percentage change indicator or as a different perspective to a stock chart. In fact, it lets you see how big of a difference it made buying coins when they were very cheap, because when they are cheap a difference of what it might seem nothing is amplified by all the gains that the stock/coin made after. So, looking at coins charts using this indicator shows how "not flat" were the early days, which in a normal chart are flattened to 0.
Price relation viewer - add percent change of two symbols (BETA)This script is very much beta!
This is a simple script to visualize how two symbols move in relation to each other. For example if the underlying symbol is a 2x Gold ETF (meaning the ticker moves at 2x the spot price of gold---if gold goes up 3% this ticker should go up 6%) and the comparison symbol is an 2x inverse gold ETF (at gold up 3% this should move down 6%). If these ETFs were 100% accurate at tracking the price of gold then this tool would report a value of zero at all times.
Day 1
Ticker - $10
Comparison - $10
Day 2
Ticker - $12
Comp - $11
This tool value - |20%| + -|10%| = 10%
It uses a short simple moving average to smooth things out a bit (see inputs). It is important to keep your axis scale in mind when using this! Two symbols that are always near zero mean they are offsetting each other very well but the value displayed might range from 0 to 0.005, but the graphed area can make it look extreme if autoscaled.
This is a tool with very specific uses : comparing how one digital currency moves in relation to bitcoin's price, comparing how gold moves in relation to silver, etc.
Correction Percent and Days SinceS
Use this script to see the depths of corrections and also to see how long it has been since a correction.
I published this script because the last time the SNP has gone this long without a 5% correction was 1996 excluding bear markets of course.
NOTE: This script is a 2 in 1. In order to see correction depth only use the first 3 plot settings as visible.
In order to see the days since a correction use the last two plot settings.
Percent Change per CandleThis indicator allows you to quickly view the true % change per candlestick (prev close > current close), but it also has 3 other customizable values for you to set your own % change conditions (such as open > high). Feel free to edit the script to suit your own needs as well.
Gain LossA very simple yet, very useful and lovely oscillator, most of the time, when we have a position in a trend and we want to take a look at percentage of our gain or loss, we need to use the "Price Range" tool time and time again, this, in some trades that you would buy and sell in less than an hour, can become a problem, also, if you have few different things going on in the chart, the price range tool will only add more to it.
Using this little oscillator, you can put the price of your position in the input section and close the settings window and watch your gain or loss percentage in real time.
B3 AutoEdgeBreak FibonacciHere is the lazy person's Fibonacci retracement drawing machine. Keep the bars in range pretty big, but you can play around and see what it does. If too small, it gets in your way, and If oversized, your retracements will not properly work upward and downward according to action. So, if you notice that it's always retracing the same direction, then lower the first input.
Now on top of the coding being tricky because of massive history in T-view, trading the Fibs is not an easy task either. Experienced Fib traders will probably love my script, and those that are not good at Fibs will love the historical look of it, but feel helpless in real-time. It took me years to learn a reaction pattern to the Fib lines, and the one key piece of my memory: if a price-line test comes and fails in relation to your trade, get out!!! <- Not real advice, just experience talking.
I expect to be upgrading this particular script in the future. Enjoy!
Percent change bar chart Strategy Backtest This histogram displays price or % change from previous bar.
Can be applied to any time frame.
This strategy buy if value above 0 and sell if value below 0.
You can change long to short in the Input Settings
Please, use it only for learning or paper trading. Do not for real trading.
Percent change bar chart v 3.0 This histogram displays price or % change from previous bar.
Can be applied to any time frame.
06/01/2017
Added look back bars.
Percent change bar chart v 2.0 This histogram displays price or % change from previous bar.
Can be applied to any time frame.
15/12/2016 Update:
Number of digits after the floating point for study values on the axis now two.
Difference % between PRICE and VWAP V2Shows difference between price and daily/weekly/monthly/hourly/whatever VWAP.
In v2:
option to color bars
average percentual difference of custom period
histogram changes color depending on which levels it's at
Levels/period/color etc can be customized.
Use these inputs in the timeframe box:
M - month
W - week
D - day
2D (or 3W or 2M or whatever) = 2 Days (or three week or 2 months and so on)
60= 1 H
240= 4 H
5 = 5 min
and so on.
btw, vaguely remembering reading somewhere that the big players like to make their entry at 4% difference.
Percent Difference Between VWAP and Price MTFShows the difference between vwap and price in percent.
You can can choose between multiple timeframe vwap. Default is normal daily.
The levels on the indicator can be changed to whatever you want to.
In the chart above we can see eurusd reverting up at 3% below monthly vwap, after the brexit dip, It then turns down again at 1% from monthly and lastly it turns up again at 2% from monthly.
Script is a small modification of this:
Williams %R I needed the %R code in one of my indicators and TradingVeiw have it hidden. So here is my attempt.
[RS]Timed Percentual Change V0EXPERIMENTAL: time based percentual change.
note: each series uses it self as base reference so there's a bit a divergence.
CM ATR PercentileRankCM ATR PercentileRank - Great For Showing Market Bottoms.
When Increased Volatility to the Downside Reaches Extreme Levels it’s Usually a Sign of a Market Bottom.
This Indicator Takes the ATR and uses a different LookBack Period to calculate the Percentile Rank of ATR Which is a Great Way To Calculate Volatility
Be Careful Of Using w/ Market Tops. Not As Reliable.
***Ability to Control ATR Period and set PercentileRank to Different Lookback Period
***Ability to Plot Histogram Just Showing Percentiles or Histogram Based on Up/Down Close
Fuchsia Lines = Greater Than 90th Percentile of Volatility based on ATR and LookBack Period.
Red Lines = Warning — 80-90th Percentile
Orange Lines = 70-80th Percentile
Other Useful Indicators
Williams Vix Fix
CM_RSI EMA Is a Great Filter for Williams Vix Fix