Simpel_Bart

Liq level to Entry Calculator

Simpel_Bart Güncellendi   
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
Sürüm Notları:
//@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")
Sürüm Notları:
Added a feature; the option to choose separate long and short leverages.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmıştır ve özgürce kullanabilirsiniz. Bir grafikte kullanmak için favorilerinize ekleyebilirsiniz. Kaynak kodunu görüntüleyemez veya değiştiremezsiniz.
Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?