Dr.Pip

Simple Moving Average Strategy

This is a modification of MOVINGAVG CROSS with different inputs of bar lengths that work with a great average percentage with not much drawdown. I ran the strategy tester with GBPUSD on 1 hour time frame.
從喜愛的腳本中移除 添加到喜愛的腳本
strategy(title="Mbit Moving Average",overlay=true)

length = input(520)
confirmBars = input(27)
price = close
ma = sma(price, length)

bcond = price > ma

bcount = bcond ? nz(bcount[1]) + 1 : 0

scond = price < ma

scount = scond ? nz(scount[1]) + 1 : 0

long =  scount == confirmBars

short = bcount == confirmBars


//Strategy

strategy.entry("long", strategy.long, when=long)

strategy.entry("short",strategy.short, when=short)
How to add alert ? Thanks
回覆
Can I ask, what does repain mean??
回覆
does it repaints?
回覆
I think it doesn't repaint because it doesn't use future data for calculation.
回覆
Sorry... It repaints... any strategy that uses renko in a backtest isn't tradable because it uses future data
回覆
mykb Speed123
Thank you for the reply.
回覆
Dr.Pip Speed123
No renko is used for this strategy, you can absolutely change it if you want. This strategy only uses a simple moving average to take trades and it does not repaint, it just sometimes has really long trades and can sometimes lead to large drawdown just look at the list of trades on the strategy tester. The last trade placed as of today was on 6/27/16
回覆
Speed123 Dr.Pip
Thanks for the clarification. Good to know that it doesn't repaint.
回覆
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 節目 如何運作 圖表功能 價格 網站規則 版主 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 幫助中心 推薦朋友 功能請求 部落格 & 新聞 常見問題 維基 推特
概述 個人資料設定 賬戶和賬單 推薦朋友 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出