177 0
Strategy + Indicator

```study(title="USDCAD 4h", shorttitle="uc4h", overlay=true)

fastl = security(tickerid, "240", sma(close, 8))
slowl = security(tickerid, "240", sma(close, 57))
tpl = input(title="Take profit", type=integer, defval=2080)
sll = input(title="Stop loss", type=integer, defval=1650)
fasts = security(tickerid, "240", sma(close, 40))
slows = security(tickerid, "240", sma(close, 102))
tps = input(title="Take profit", type=integer, defval=920)
sls = input(title="Stop loss", type=integer, defval=550)
c = 100000 //contract size

buy = cross(fastl,slowl) and fastl>slowl and close
sell = cross(fasts,slows) and fasts<slows and close
short = (sell*close? sell*close : na)

//Signal
plot(fastl, color=silver, trackprice=false, title="8", transp=100)
plot(slowl, color=gray, trackprice=false, title="57", transp=100)
plot(fasts, color=silver, trackprice=false, title="40", transp=100)
plot(slows, color=gray, trackprice=false, title="102", transp=100)

plotshape(short, "Alert Sell", shape.triangledown, location.abovebar, black, offset=0, text="sell", size=size.auto)

//Entry
entrysell = security(tickerid, "60", short)
plot(entrysell, "Sell price", style=linebr, linewidth=3, color=red, trackprice=false)

//Long
plot(tpbb, "Long Take", style=linebr, linewidth=3, color=green, trackprice=false)
plot(slbb, "Long Stop", style=linebr, linewidth=3, color=fuchsia, trackprice=false)

//Short
tpsell = short - tps/c
tpss = security(tickerid, "60", tpsell)
plot(tpss, "Short Take", style=linebr, linewidth=3, color=green, trackprice=false)
slsell = short + sls/c
slss = security(tickerid, "60", slsell)
plot(slss, "Short Stop", style=linebr, linewidth=3, color=fuchsia, trackprice=false)```
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter