# Simple 1m Scalper by thimblemunch

Author: Zer3192, Date: 2022-08-25 19:52:29
Tags:

```//@version=4
study(title='Simple 1m Scalper by thimblemunch', shorttitle='Simple 1m Scalper', overlay=true)

// STC
EEEEEE = input(12, 'STC Length')
BBBB = input(26, 'STC FastLength')
BBBBB = input(50, 'STC SlowLength')

AAAA(BBB, BBBB, BBBBB) =>
fastMA = ema(BBB, BBBB)
slowMA = ema(BBB, BBBBB)
AAAA = fastMA - slowMA
AAAA

AAAAA(EEEEEE, BBBB, BBBBB) =>
AAA = 0.5
var CCCCC = 0.0
var DDD = 0.0
var DDDDDD = 0.0
var EEEEE = 0.0
BBBBBB = AAAA(close, BBBB, BBBBB)
CCC = lowest(BBBBBB, EEEEEE)
CCCC = highest(BBBBBB, EEEEEE) - CCC
CCCCC := CCCC > 0 ? (BBBBBB - CCC) / CCCC * 100 : nz(CCCCC)
DDD := na(DDD) ? CCCCC : DDD + AAA * (CCCCC - DDD)
DDDD = lowest(DDD, EEEEEE)
DDDDD = highest(DDD, EEEEEE) - DDDD
DDDDDD := DDDDD > 0 ? (DDD - DDDD) / DDDDD * 100 : nz(DDDDDD)
EEEEE := na(EEEEE) ? DDDDDD : EEEEE + AAA * (DDDDDD - EEEEE)
EEEEE

mAAAAA = AAAAA(EEEEEE, BBBB, BBBBB)
mColor = mAAAAA > mAAAAA ? color.new(color.green, 20) : color.new(color.red, 20)

if mAAAAA <= mAAAAA and mAAAAA > mAAAAA and mAAAAA > 75
if mAAAAA >= mAAAAA and mAAAAA < mAAAAA and mAAAAA < 25

Length = input(21, 'Trend Length', minval=1),
Multiplier = input(3, 'Trend Multiplyer', minval=0.000001)
avgTR      = wma(atr(1), Length)
highestC   = highest(Length)
lowestC    = lowest(Length)
hiLimit = highestC-(avgTR * Multiplier)
loLimit = lowestC+(avgTR * Multiplier)
ret = 0.0
pos = 0.0
ret:= iff(close > hiLimit and close > loLimit, hiLimit,
iff(close < loLimit and close < hiLimit, loLimit, nz(ret, close)))
pos:= iff(close > ret, 1,
iff(close < ret, -1, nz(pos, 0)))
barcolor(pos == -1 ? color.red: pos == 1 ? color.green : color.blue )

// EMA
em = ema(close, 200)
plot(em, color = color.white, title="EMA Color")

priceCrossUp = crossover(close, ret)
priceCrossDown = crossover(ret, close)
secretSauceLong = close > em and pos == 1 and mAAAAA > mAAAAA and priceCrossUp
secretSauceShort = close < em and pos == -1 and mAAAAA < mAAAAA and priceCrossDown