联系我们:微信:qhltcn | 微信群:点开扫码 | QQ:116589960 | QQ主群:65771077 | 量化编程群:84426168 | 外盘期货群:92869075 | 期货杂志群:15274076;
返回列表 发帖

Weekly & Daily MACD[文章与源码](2017年12月刊)

Weekly & Daily MACD[文章与源码](2017年12月刊)

原文:留空
For this month’s Traders’ Tips, the focus is Vitali Apirine’s article in this issue, “Weekly & Daily MACD.” Here, we present the December 2017 Traders’ Tips code with possible implementations in various software.

The Traders’ Tips section is provided to help the reader implement a selected technique from an article in this issue or another recent issue. The entries here are contributed by software developers or programmers for software that is capable of customization.
期货论坛管理员,官方开户、量化、广告以及合作事宜,联系微信:qhltcn  QQ:116589960

TRADESTATION
In the article “Weekly & Daily MACD” in this issue, author Vitali Apirine introduces a novel approach to using the classic MACD indicator in a way that simulates calculations based on different timeframes while using just a daily-interval chart. He describes a number of ways to use this new indicator that allows traders to adapt it to differing markets and conditions.

Here, we are providing some TradeStation EasyLanguage code for an indicator based on the author’s ideas.

Indicator: WeeklyAndDailyMACD


  1. // TASC DEC 2017
  2. // Weekly And Daily MACD
  3. // Vitali Apirine

  4. inputs:
  5.         DailyFastLength( 12 ),
  6.         DailySlowLength( 26 ),
  7.         WeeklyFastLength( 60 ),
  8.         WeeklySlowLength( 130 ) ;       

  9. variables:
  10.         DailyMACD( 0 ),
  11.         WeeklyMACD( 0 ),
  12.         RelativeDailyLine( 0 ) ;
  13.        
  14. DailyMACD = MACD( Close,
  15.         DailyFastLength, DailySlowLength ) ;
  16. WeeklyMACD = MACD( Close,
  17.         WeeklyFastLength, WeeklySlowLength ) ;       
  18. RelativeDailyLine = WeeklyMACD + DailyMACD ;

  19. if RelativeDailyLine Crosses over
  20.         WeeklyMACD then
  21.         Alert( "Relative Crossing Over Weekly" )
  22. else if RelativeDailyLine Crosses under
  23.         WeeklyMACD then
  24.         Alert( "Relative Crossing Under Weekly" ) ;

  25. Plot1( WeeklyMACD, "Weekly MACD" ) ;
  26. Plot2( RelativeDailyLine, "Relative MACD" ) ;
  27. Plot3( 0, "Zero Line" ) ;
复制代码



FIGURE 1: TRADESTATION. Here is a daily chart of Apple (AAPL) with the WeeklyAndDailyMACD indicator applied.
期货论坛管理员,官方开户、量化、广告以及合作事宜,联系微信:qhltcn  QQ:116589960

TOP

返回列表