Pine script indicator for Trading View

Job ID: 33298765

Budget: $30 – $250 AUD

I would like to create a calculation/indicator in tradingview.
I would like to calculate what the volume is when the stochastic indicator (for 1 period) is above 50, and also what the volume is for when the stochastic indicator (for 1 period) is below 50. This will be obtained over 50 candles.
Then divide the volume when the stochastic is above 50 by the volume when the stochastic is below 50.