Profitable Contrarian scalping
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Jaerevan47

//@version=5
strategy("Smooth VWMA scalping contrarian", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
length1 = input(5, title = "Length1")
length2 = input(200, title = "Length2")
length3 = input(20, title = "Stop length")
vwma1 = ta.vwma(ta.sma(close,5), length1)
vwma2 = ta.vwma(ta.sma(close,5), length2)
vwma3 = ta.vwma(ta.sma(close, 5), length3)
plot(vwma1)
plot(vwma2, color = color.white)
if ta.crossover(vwma1, vwma2)
    strategy.entry("Short", strategy.short)
if ta.crossunder(vwma1, vwma3)
    strategy.close("Short")
if ta.crossunder(vwma1, vwma2)
    strategy.entry("Long", strategy.long)
if ta.crossover(vwma1, vwma3)
    strategy.close("Long")