GBPJPY 4h Indicator

Strategy + Indicator (with the same name).

Make your personal E-mail Alert for the entry.
Remove from Favorite Scripts Add to Favorite Scripts
study(title="gj4h", shorttitle="gj4h", overlay=true)

fastl = security(tickerid, "240", sma(close, 8))
slowl = security(tickerid, "240", sma(close, 60))
tpl = input(title="Take profit", type=integer, defval=5450)
sll = input(title="Stop loss", type=integer, defval=2950)
fasts = security(tickerid, "240", sma(close, 9))
slows = security(tickerid, "240", sma(close, 71))
tps = input(title="Take profit", type=integer, defval=5970)
sls = input(title="Stop loss", type=integer, defval=3200)

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

plot(fastl, color=silver, trackprice=false, title="8", transp=80)
plot(slowl, color=gray, trackprice=false, title="60", transp=80)
plot(fasts, color=silver, trackprice=false, title="9", transp=80)
plot(slows, color=gray, trackprice=false, title="71", transp=80)

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

entrybuy = security(tickerid, "60", long)
plot(entrybuy, "Buy price", style=linebr, linewidth=3, color=blue, trackprice=true, offset=0)
entrysell = security(tickerid, "60", short)
plot(entrysell, "Sell price", style=linebr, linewidth=3, color=red, trackprice=true, offset=0)

tpbuy = long + tpl/100000*100
tpbb = security(tickerid, "60", tpbuy)
plot(tpbb, "Long Take", style=linebr, linewidth=3, color=green, trackprice=true, offset=0)
slbuy = long - sll/100000*100
slbb = security(tickerid, "60", slbuy)
plot(slbb, "Long Stop", style=linebr, linewidth=3, color=fuchsia, trackprice=true, offset=0)

tpsell = short - tps/100000*100
tpss = security(tickerid, "60", tpsell)
plot(tpss, "Short Take", style=linebr, linewidth=3, color=green, trackprice=true, offset=0)
slsell = short + sls/100000*100
slss = security(tickerid, "60", slsell)
plot(slss, "Short Stop", style=linebr, linewidth=3, color=fuchsia, trackprice=true, offset=0)

Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Get Help Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Get Help Ideas Published Followers Following Private Messages Chat Sign Out