BarsSince() 實際上是找出指定條件出現位距離現在位置第幾支燭, 近的數字越細, 遠的數字越大~
SYNTAX
barssince(
DATA ARRAY )
FUNCTION
Calculates the number of bars (time
periods) that have passed since DATA ARRAY was true.
Important:
When using the barssince() function in an exploration, you must
click the "Load ___ Records" button in the Exploration
Options dialog and specify a value equal to the number of bars loaded in your
chart; otherwise, the exploration results may not be accurate.
可以改一改:
nd1:=3; nd2:=17; nmov:=3; M1 := Mov(C,nd1,E); M2 := Mov(C,nd2,E); myMACD := M1 - M2; myMACDmov := Mov(myMACD,nmov,E); nBuy := Cross( myMACD , myMACDmov) AND myMACD >0; nSell:= Cross( myMACDmov , myMACD) AND myMACD >0;
tBuy := BarsSince( nBuy ) < BarsSince( nSell ) and nBuy ; tSell:= BarsSince( nSell ) < BarsSince ( nBuy) and nSell ; tBuy ;
|