PROTECTED SOURCE SCRIPT
Aggiornato

Liq level to Entry Calculator

1 145
This script calculates long and short entry levels with leverage and liquidation levels of your choosing. Suppose you are trading XBTUSD and believe the bottom is in. You're looking for a long entry using 10x leverage that will only get liquidated if we hit new lows. You choose "5698.9" USD.

istantanea

By changing the leverage to "10" and the long liquidation price to "5698.9", the script will calculate the price point for your long entry.

istantanea

I hope this helps inform your trades.

-Sim
Note di rilascio
//version=3
study("Liq level to Entry Calculator")
//
plot(close, color = black, linewidth = 2, title = "Close")
leverage = input(10, title = "Leverage")
CalculateLongEntry = input(false, title = "Calculate Long Entry?")
CalculateShortEntry = input(false, title = "Calculate Short Entry?")
//Long Calculator
longliqlevel = input(0, title = "Long Liquidation Level")
denominator = leverage*((1/leverage) - (1/pow(leverage, 2)))
LongEntry = longliqlevel/denominator
plot(CalculateLongEntry?LongEntry:na, color = #247BA0, title = "Long Entry")
plotchar(barstate.islast and CalculateLongEntry?LongEntry:na, color = #247BA0, size=size.auto, location=location.absolute)
plot(CalculateLongEntry?longliqlevel:na, color = #D72946, title = "Long Liquidation Level at X Leverage")
//Short Calculator
shortliqlevel = input(0, title = "Short Liquidation Level")
denominator2 = leverage*((1/leverage) + (1/pow(leverage, 2)))
ShortEntry = shortliqlevel/denominator2
plotchar(barstate.islast and CalculateShortEntry?ShortEntry:na, color = #FC5B03, size=size.auto, location=location.absolute)
plot(CalculateShortEntry?ShortEntry:na, color = #FC5B03, title = "Short Entry")
plot(CalculateShortEntry?shortliqlevel:na, color = #07135B, title = "Short Liquidation Level at X Leverage")

plotshape(leverage==100 and barstate.islast and CalculateLongEntry?longliqlevel:na, style=shape.flag, color = red, location=location.absolute, text="100x")
plotshape(leverage==50 and barstate.islast and CalculateLongEntry?longliqlevel:na, style=shape.diamond, color = red, location=location.absolute, text="50x")
plotshape(leverage==25 and barstate.islast and CalculateLongEntry?longliqlevel:na, style=shape.circle, color = red, location=location.absolute, text="25x")
plotshape(leverage==10 and barstate.islast and CalculateLongEntry?longliqlevel:na, style=shape.xcross, color = red, location=location.absolute, text="10x")
plotshape(leverage==5 and barstate.islast and CalculateLongEntry?longliqlevel:na, style=shape.triangleup, color = red, location=location.absolute, text="5x")


plotshape(leverage==100 and barstate.islast and CalculateShortEntry?shortliqlevel:na, style=shape.flag, color = #07135B, location=location.absolute, text="100x")
plotshape(leverage==50 and barstate.islast and CalculateShortEntry?shortliqlevel:na, style=shape.diamond, color = #07135B, location=location.absolute, text="50x")
plotshape(leverage==25 and barstate.islast and CalculateShortEntry?shortliqlevel:na, style=shape.circle, color = #07135B, location=location.absolute, text="25x")
plotshape(leverage==10 and barstate.islast and CalculateShortEntry?shortliqlevel:na, style=shape.xcross, color = #07135B, location=location.absolute, text="10x")
plotshape(leverage==5 and barstate.islast and CalculateShortEntry?shortliqlevel:na, style=shape.triangleup, color = #07135B, location=location.absolute, text="5x")
Note di rilascio
Added a feature; the option to choose separate long and short leverages.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.