Super Scalp 007
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MA_Seifi

//@version=4
strategy("Super Scalp 007", overlay=false, initial_capital = 200, default_qty_value = 100, default_qty_type = strategy.percent_of_equity)

// Indicator

len=20
p=close
sma=sma(p,len)
avg=atr(len)
fibratio1=input(defval=1.618,title="Fibonacci Ratio 1")
fibratio2=input(defval=2.618,title="Fibonacci Ratio 2")
fibratio3=input(defval=4.236,title="Fibonacci Ratio 3")
r1=avg*fibratio1
r2=avg*fibratio2
r3=avg*fibratio3
top3=sma+r3
top2=sma+r2
top1=sma+r1
bott1=sma-r1
bott2=sma-r2
bott3=sma-r3

// t3=plot(top3,transp=0,title="Upper 3",color=teal)
// t2=plot(top2,transp=20,title="Upper 2",color=teal)
// t1=plot(top1,transp=40,title="Upper 1",color=teal)
// b1=plot(bott1,transp=40,title="Lower 1",color=teal)
// b2=plot(bott2,transp=20,title="Lower 2",color=teal)
// b3=plot(bott3,transp=0,title="Lower 3",color=teal)
// plot(sma,style=cross,title="SMA",color=teal)
// fill(t3,b3,color=navy,transp=85)

// Conditions
k = 0.005
longCondition = cross(low, bott2)
shortCondition = cross(high, top2)
stop_l = bott3 * (1 - k * 0.5)
stop_s = top3 * (1 + k)
limit_l = top2 * (1 - k)
limit_s = bott2
plot(limit_l, color=color.green)
plot(stop_l, color=color.red)
strategy.entry("long", strategy.long, when = longCondition)
strategy.exit('long', limit = limit_l, stop=stop_l)
// strategy.entry("short", strategy.short, when = shortCondition)
// strategy.exit('short', limit = limit_s, stop=stop_s)
// shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
// if (shortCondition)
//     strategy.entry("My Short Entry Id", strategy.short)
