Bitmex Liquidation Zones for TradingView

This script written for TradingView using Pinescript calculates the forced liquidation price for the volume weighted average price of a certain candle for leverages of 25x,50x and 100x

Code:

//@version=3
//Made by André Couto
study(“Liq zones”, overlay=true)
plot(vwma(close, 1), transp= 100)
L100=0.995117vwma(close, 1) L50=0.985294vwma(close, 1)
L25=0.966235vwma(close, 1) S100=1.004882vwma(close, 1)
S50=1.015117vwma(close, 1) S25=1.036117vwma(close, 1)
plot(L100, style=circles, title=”L100″,color=yellow, linewidth=4)
plot(L50, style=circles, title=”L50″, color=purple, linewidth=4)
plot(L25, style=circles, title=”L25″, linewidth=4)
plot(S100, style=circles, title=”S100″, color=yellow, linewidth=4)
plot(S50, style=circles, title=”S50″,color=purple, linewidth=4)
plot(S25, style=circles, title=”S25″, linewidth=4)

Colors, thickness and shape can be changed via the Indicator Style Menu