PROTECTED SOURCE SCRIPT
已更新 Liq level to Entry Calculator

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.

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.

I hope this helps inform your trades.
-Sim
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.
I hope this helps inform your trades.
-Sim
發行說明
//version=3study("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")
發行說明
Added a feature; the option to choose separate long and short leverages.受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。