
Multicharts關鍵字:Alerts彈出警示視窗提示
用法:alert會在K棒收棒後判斷條件是否成立
範例
開啟桌面的Multicharts Powerlanguage,點選開新檔案>>指標>>鍵入範例程式碼:
If Close > Close[1] then alert;
當根K棒收盤價大於前根K棒的收盤價時,Multicharts右下角會彈出黃底的警報視窗;
Multicharts關鍵字:AlertEnabled忘記開啟警報時發出通知
用法
AlertEnabled
範例
開啟桌面的Multicharts Powerlanguage,點選開新檔案>>指標>>鍵入範例程式碼:
var: ID(-1);
If AlertEnabled=False And LastBarOnChart_S=True Then
ID = Text_New_S(Date, Time_S, Low, "Alerts are
disabled. See Format Study > Properties > Alerts");
Multicharts關鍵字:Cancel Alert取消警報
用法
Cancel Alert
範例
開啟桌面的Multicharts Powerlanguage,點選開新檔案>>指標>>鍵入範例程式碼:
在10:00pm之後,警報不會顯示,關閉所有警報。
If Close > Close[1] Then
Alert("Price is going up");
If Volume > Volume[1] Then
Alert("Volume is increasing");
If Volatility(5) > Volatility(5)[1] Then
Alert("Volatility is rising");
If OpenInt > OpenInt[1] Then
Alert("Open interest is growing");
If Time >= 1000 Then Cancel Alert;
Multicharts關鍵字:CheckAlert
用法
CheckAlert
如果指標設定啟用警報時,則CheckAlert返回 True,True/False只在最後一根Bar返回。AlertEnabled 和 CheckAlert的不同:AlertEnabled在每一個Bar都會執行, CheckAlert 只會在最後一根Bar執行。警報只在最後一根Bar產生。
範例
If CheckAlert Then Begin
If Volume >= 2 * Average(Volume, 10) Then
Alert ("Volume is
going up");
End;
If CheckAlert Then Begin
If Volume >= 2 * Average(Volume, 10) Then
Alert ("Volume is going up");
End;
If Close > Close[1] Then
Alert("Price
is going up");
If Volume > Volume[1] Then
Alert("Volume
is increasing");
If Volatility(5) > Volatility(5)[1] Then
Alert("Volatility
is rising");
If OpenInt > OpenInt[1] Then
Alert("Open
interest is growing");
If Time >= 1000 Then Cancel Alert;
var: ID(-1);
If AlertEnabled=False And LastBarOnChart_S=True Then
ID = Text_New_S(Date, Time_S, Low, "Alerts are
disabled. See Format Study > Properties > Alerts");
0 意見:
張貼留言
Click to see the code!
To insert emoticon you must added at least one space before the code.