ktpromail 發表於 21-3-15 16:25

新手請教 macd買入 語法

inputs:FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ) ;
variables:var0( 0 ), var1( 0 ), var2( 0 ) ;

var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;

condition1 = var0 > var1 and var0 > 0;


condition8 = var0 cross under var0;
condition9 = var0 cross under var1;

if condition1 then Buy ( "buy" ) next bar at market ;

if condition8 or condition9 then sell ( "sell" ) next bar at market ;

新手請教
想寫 var2(macd柱)0軸以上大過前一支(發散),(雙牛)0軸以上金叉應該點寫?

現在好似是 var0 > 0軸 就會買入...........

jason680 發表於 21-3-16 01:54

供參考...
http://www.coco-in.net/thread-150407-1-1.html
頁: [1]
查看完整版本: 新手請教 macd買入 語法