讓指標(biāo)符合條件時,發(fā)出警告 [MC]
- 咨詢內(nèi)容:
原文參考:Ray's Blog
Multicharts/Tradestation 的Alerts/警示功能,蠻常用的..
看盤時當(dāng)條件符合時,可發(fā)出聲音來提示.
使用RSI 來舉例,當(dāng)大于70,及小于30要發(fā)出聲音做警示
程序?qū)懛ㄈ缦?
//==從這里=============inputs:Price( Close ),Length( 14 ),OverSold( 30 ),OverBought( 70 ),OverSColor( Cyan ),OverBColor( Red ) ;
variables: var0( 0 ) ;
var0 = RSI( Price, Length ) ;
Plot1( var0, "RSI" ) ;Plot2( OverBought, "OverBot" ) ;Plot3( OverSold, "OverSld" ) ;
if var0 > OverBought thenSetPlotColor( 1, OverBColor )else if var0 < OverSold thenSetPlotColor( 1, OverSColor ) ;//這里提一下,這是讓線變色的寫法.
//==到這里都是RSI 指標(biāo)
condition1 = var0 crosses over OverSold ;if condition1 then PlaySound("C:\Windows\Media\WindowsBalloon.wav") //填上音效的檔案路徑elsebegincondition1 = var0 crosses under OverBought;if condition1 then PlaySound("C:\Windows\Media\ring.wav");//填上音效的檔案路徑end;
當(dāng)然也可以自己錄音效來玩..
如果要跳出警示畫面
則在條件成立時再加入:
Alert( "Bullish alert" ); //上引號內(nèi)的文字可以自行變動.
執(zhí)行指標(biāo)后要記得這里要勾選才會有作用.
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒有帳號?立即注冊
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容