Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- strategy(title = "BackTestBug", overlay = false, pyramiding = 0, initial_capital=10000, currency=currency.USD, default_qty_type=strategy.fixed, default_qty_value=100000, calc_on_every_tick=false, max_bars_back=5000)
- GoLong=crossover(rsi(close,14),30)
- GoShort=crossunder(rsi(close,14),70)
- KillShort=cross(rsi(close,14),50)
- KillLong=cross(rsi(close,14),50)
- strategy.entry("long", strategy.long, when=GoLong)
- strategy.entry("short", strategy.short, when=GoShort)
- //strategy.close("long", when=KillLong)
- //strategy.close("short", when=KillShort)
- strategy.exit("XL", from_entry = "long", loss = 60, profit=120)
- strategy.exit("XS", from_entry = "short", loss = 60, profit=120)
- strategy.exit("XL-logical", from_entry = "long", when=KillLong)
- strategy.exit("XS-logical", from_entry = "short", when=KillShort)
- plot(rsi(close,14), color=orange)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement