ShamusArnesen

SMA Strategy

Just trying out the strategy tester with something simple.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
strategy("SMA Strategy", overlay=true)

SMALength = input(10)
price=close

SMA=sma(price, SMALength)

if (crossover(SMA, price))
    strategy.entry("SimpleMovAvgLE", strategy.long, comment="SimpleMovAvgLE")

if (crossunder(SMA, price))
    strategy.entry("SimpleMovAvgSE", strategy.short, comment="SimpleMovAvgSE")

//plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr)
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体
台灣
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
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out