1min MA 問題
大家好, 小弟是來自香港的amibroker新手 , 禮貌上打聲招呼 !我剛開始學習AFL , 主要用來炒港期 , 在AB我們可以用MA 來做simple average , 但我發覺MA好像只限day , 沒有intraday ? eg. 在1-min chart , 我想弄一個10min simple average , 在exploration window顯示出來
pricerising=C>MA(C,10);
Volumerising=V>MA(V,10);
Filter=C>MA(C,10) OR V>MA(V,10);
AddColumn(C,"Close",1.2);
AddColumn(MA(C,10),"MA(C,10)",1.2);
AddColumn(V,"volume",1.0);
AddColumn(MA(V,10),"MA(V,10)",1.2);
chart 已經是1min圖了 , 但exploration window的結果是10 day average的計算 , 然而圖上的MA卻是10分鐘MA來的 , 請問MA function是否只能用日計? 想用分鐘計應如何做? 謝謝
請參考 Multiple time-frame indicators Amibroker
http://www.amibroker.com/docs/MTFIndicators.html 本帖最後由 joshsmi 於 13-7-20 23:01 編輯
In Analysis you have to choose the periodicity!
The analysis peridocity is independent from chart timeframe setting!
And lowest available periodicity depends on File>Data base settings>Base time interval setting
http://img96.imageshack.us/img96/2195/p47.png 感謝moneymaker和joshsmi 的指導 , 我加了timeframeset也是不行 , 在periodicity改回1minute就ok了 ! 看來真的如joshsmi所說 timeframe 和 analysis periodicity 是 independent.
其實我又想問 timeframeset 是有什麼用? 因為我發覺就算不用timeframeset, plot 出來的圖也是正確的
//This is a simple test program
//TimeFrameSet (in1Minute);
MA1_10=MA(C,10);
//TimeFrameRestore();
Plot (MA1_10,"ma1_10",colorRed);
上面有一個plot指令, 不論用不用timeframeset , plot 出來的圖也是一樣的
1min
if i change to daily , the MA1_10 will follow to change.
根據上圖, 看來沒有timeframeset 也好像ok , 請問timeframeset 用在什麼地方上?
TimeFrameSet( in5Minute ); // switch to 5 minute frame
/* MA now operates on 5 minute data, ma5_13 holds time-compressed 13 bar MA of 5min bars */
ma5_13 = MA( C, 13 );
TimeFrameRestore(); // restore time frame to original
TimeFrameSet( inHourly ); // switch now to hourly
mah_9 = EMA( C, 9 ); // 9 bar moving average from hourly data
TimeFrameRestore(); // restore time frame to original
Plot( Close, "Price", colorWhite, styleCandle );
// plot expanded average
Plot( TimeFrameExpand( ma5_13, in5Minute), "13 bar moving average from 5 min bars", colorRed );
Plot( TimeFrameExpand( mah_9, inHourly), "9 bar moving average from hourly bars", colorRed );
大概就這樣用吧!!! @Winson, do yourself a big favor and read the manual. There is nothing incorrect. You use it incorrectly. AmiBroker is bug free. Don't try to be smarter than the developer. I guarantee you willl fail. :p
其實我也看了help manual ,裡面有說明但是看不明白, hitrader那些code是help manual的example , 因為不明白所以我就把timeframeset 「comment 掉」看看有什麼變化, 發現竟然是無變化 , 所以才有此一問, 不過我現在知道為什麼了 , 感謝hitrader和joshsmi耐心教導{:4_82:}
(在香港很多人就連amibroker也未聽過, 真是無從問起>~<) 不會的, 香港很多人用Amibroker 真的嗎,論壇之類一個也找不到,在網上見有人說「amibroker 只能做最傳統的指標(e.g. MACD, RSI, BB),。但如果做一點變化,或寫一些獨創的方法,就不太可行了。再者Amibroker的測試報告和自動交易,就十分有限了。」,然後他極力推薦multichart。
但我最近奮力研究卻發現ami會令初學者難上手,但明白了後發覺它的彈性是可以很高,之前joshsmi大大的範例有幾句令我開竅,完來就是全array概念,就算我跑去學vb.net相信都要跟著ami的概念來寫,雖然我未用過MC, 但感覺ami更適合小弟^.^ lol
Are you kidding? Multicharts is a total joke of software that for example can't even do portfolio trading and can not dynamically convert currencies during backtest. Amibroker can do both examples since forever.
The one and only limited software is overpriced Multicharts that has more bugs than useful features.
頁:
[1]