Skip to content

Instantly share code, notes, and snippets.

@CryptoRox
Last active March 17, 2018 15:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CryptoRox/66c471bfc0d41067ba91 to your computer and use it in GitHub Desktop.
Save CryptoRox/66c471bfc0d41067ba91 to your computer and use it in GitHub Desktop.
TradingView - 1 Minute Forex Scalping Strategy
//Strategy taken from http://www.dolphintrader.com/1-min-easy-forex-scalping-strategy/
//@version=2
strategy("1 min forex scalping", shorttitle="Scalping", overlay=true)
a = ema(close, 12)
b = ema(close, 26)
c = sma(close, 55)
TP = input(0)
SL = input(0)
TS = input(0)
long = cross(a, c) and a > b
short = cross(a, c) and a < b
plot(a, title="12", color=red, linewidth=1)
plot(b, title="26", color=blue, linewidth=1)
plot(c, title="55", color=green, linewidth=1)
strategy.entry("Long", strategy.long, 1.0, when=long)
strategy.entry("Short", strategy.short, 1.0, when=short)
TPP = (TP > 0) ? TP : na
SLP = (SL > 0) ? SL : na
TSP = (TS > 0) ? TS : na
strategy.exit("Close Long", "Long", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP)
strategy.exit("Close Short", "Short", qty_percent=100, profit=TPP, loss=SLP, trail_points=TSP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment