adaptive macd (a000000bbm) - 財經

Frederica avatar
By Frederica
at 2015-07-10T15:38

Table of Contents

原論壇標題:Improving MACD Indicator

大意:把原內建 MACD 指標內的 EMA 改為 Adaptive Moving Average 就是 Adaptive
Moving Average "MACD"。原內建指標修改的部分改為註解,請自行比較。

Easy Language Code:
{ Forum 110183 }

inputs:
Price( Close ),
FastLength( 12 ),
SlowLength( 26 ),
EffRatioLength( 10 ),
MACDLength( 9 ),
Paint_Level( 0.5 ),
HistThickness( 1 ) ;

variables:
MyMACD( 0 ),
MyAdaptive( 0 ),
MACDAvg( 0 ),
MACDDiff( 0 ) ;

//MyMACD = MACD( Close, FastLength, SlowLength ) ; // comment out
standard MACD calculation

// Change MACD calculation to take the difference between the slow and fast
moving averages
// using Adaptive Moving Averages with the "fast" moving average having half
the
// EffRatioLength as the "slow" moving average
MyMACD = AdaptiveMovAvg( Price, EffRatioLength / 2, FastLength, SlowLength )
- // Fast Adapative
AdaptiveMovAvg( Price, EffRatioLength, FastLength, SlowLength )
; // Slow Adaptive


MACDAvg = XAverage( MyMACD, MACDLength ) ;
MACDDiff = MyMACD - MACDAvg ;

Plot1( MyMACD, "MACD" ) ;
Plot2( MACDAvg, "MACDAvg" ) ;
Plot3( MACDDiff, "MACDDiff", Yellow, 0, 0 ) ;
Plot4( 0, "ZeroLine" ) ;
Plot5( Paint_Level ) ;
Plot6( -Paint_Level ) ;

if MACDDiff > Paint_Level then
Plot3( MACDDiff, "MACDDiff", Green, Default, HistThickness ) ;
if MACDDiff <-Paint_Level then
Plot3( MACDDiff, "MACDDiff", Red, Default, HistThickness ) ;

跑出的圖如下:
http://i.imgur.com/aV5mnQf.png

--
Tags: 財經

All Comments

Harry avatar
By Harry
at 2015-07-10T18:41
感動 謝謝你

來討論一下Sinewave指標

Mary avatar
By Mary
at 2015-07-06T23:41
更新 TS Forum 的連結,原連結已失效。 Home andgt; All Forums andgt; EasyLanguage Library andgt; Indicators (Charting, RadarScreen) andgt; Oscillators by John Ehlers h ...

2015/07/06 贏家通通來論壇

Zora avatar
By Zora
at 2015-07-06T21:52
希臘真是個無賴國家...號稱最早民主的國家,民眾素質也不過如此... 台灣比一下,好像也沒那麼爛了... 大家來Trade台指,賺爆它~ - ...

I B api 和下單問題請教

John avatar
By John
at 2015-07-03T12:33
大家好,小弟在數年前,因朋友是金融資訊公司,利用他給的 realtime data, 我用 per l 在 linux +MySql 寫了一個可以接收資訊源和下單到國內券商的小program, 現在想試 試 IB ,不知版上有無高手試過 IB api (or eSignal) 接收 realtime data ...

中央再保險徵計量策略研究員

Vanessa avatar
By Vanessa
at 2015-07-02T16:43
公司: 中央再保險 職稱: 計量策略研究員 內容: 1.開發計量選股交易策略模組,主要以股權型商品為主,範圍為大中華股市、美股 、日股 2.支援部分日常行政業務運作 備註: 1.至少熟悉下列語法之一: VBA、C++、Java,且有自行開發過交易策略的經驗- Must ...

關於期交所期貨成交簡檔 RPT資料

Annie avatar
By Annie
at 2015-06-30T15:10
期交所給的簡檔資料時間精確度只有到秒 例: 8450000 8450100 8450200 . . . 8455900 8460000 實際上 8450000到8450100 ...