거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Twitter에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

Simple moving average - MetaTrader 5용 지표

조회수:
23466
평가:
(29)
게시됨:
2019.03.17 20:01
sma.mq5 (7.82 KB) 조회
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

Back to the basics :

One might ask : "Why do we need the simple moving average when it is published already"?

There are multiple reasons :

  • existing sma calculations tend to have one of two issues (or both in some cases) :
    • when you increase the calculating period, they are slowing down - due to constant repeated usage of loops
    • if they do not use loops all the time, the, sometimes, the apply a "shortcut" that is simply an approximation when the exact simple moving average is never calculated. that can be frustrating at times 
  • they are rather complicated to use
So here is one version that is not an approximation, that does not slow down for longer periods and is easy to use (from code too)
PS: it could be made to run even faster (migrating the code from the class to main loop would do that), but that would make the whole code less flexible and the speed-up would be marginal compared to lack of flexibility / reusability


















































































































































Vortex 2 Vortex 2

Vortex 2

TradeTransaction Class TradeTransaction Class

A base class to simplify analyzing trade transactions in MQL5.

Explosion5 Explosion5

Advisor scalper. Trading algorithm: Candle[0]> Candle[1] * 2. Taimeframe - 4H && Day.

Linear Weighted Moving Average Linear Weighted Moving Average

Linear Weighted Moving Average