跨商品.跨週期 用 symbol 的限制.
且用 GetField 取代 getsymbolField 來用.
不知可否.程式碼比較好維護.感恩回覆!
var: a1(0),a2(0),a3(0), a_max(0) ;
var: b1("1513.TW"), b2("1519.TW"), b3("1795.TW") ;
Value1= GetField("估計量") * C / 100000 ; // > 1 (億)
if symbol=b1 and GetSymbolInfo("買賣現沖")=true and Value1 > 1 then
a1= GetField("C","1")/average(GetField("C","d")[1],5) ;
if symbol=b2 and GetSymbolInfo("買賣現沖")=true and Value1 > 1 then
a2= GetField("C","1")/average(GetField("C","d")[1],5) ;
if symbol=b3 and GetSymbolInfo("買賣現沖")=true and Value1 > 1 then
a3= GetField("C","1")/average(GetField("C","d")[1],5) ;
a_max = maxList(a1,a2,a3) ;
if a_max=a1 and symbol=b1 then setposition(1,market);
1 評論