How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Feature Request FAQ Help & Wiki Twitter

# Mix Strategy Magrus LSKBTC 15M

163 0
Testing
```//@version=2
strategy("Mix Strategy Magrus", overlay=true)
length = input(title="Length", type=integer, minval=1, maxval=1000, defval=1)
price = close

upBound = highest(high, length)
downBound = lowest(low, length)

//RSI
overSold = input( 30 )
overBought = input( 70 )

vrsi = rsi(price, length)

//MA
malong = crossover(sma(close, 10), sma(close, 20))
mashort = crossunder(sma(close, 10), sma(close, 20))

//DMI
len = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)
up = change(high)
down = -change(low)
trur = rma(tr, len)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / trur)
sum = plus + minus
adxm = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

//DMI END
Balert = malong and (not na(close[length])) and (crossover(vrsi, overSold))
Salert = (minus > plus) and (down)
Salert2 = (mashort) and (minus > plus) and (down)

if malong and (not na(close[length])) and (crossover(vrsi, overSold))
strategy.entry("ChBrkLE", strategy.long, stop=upBound + syminfo.mintick, comment="Long")

if (mashort) and (minus > plus) and (down) or (minus > plus) and (down)
strategy.entry("MACrossSE", strategy.short, comment="Short")

```
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia

한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter