讓指標(biāo)符合條件時(shí),發(fā)出警告 [MC]
- 咨詢(xún)內(nèi)容:
原文參考:Ray's Blog
Multicharts/Tradestation 的Alerts/警示功能,蠻常用的..
看盤(pán)時(shí)當(dāng)條件符合時(shí),可發(fā)出聲音來(lái)提示.
使用RSI 來(lái)舉例,當(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 ) ;//這里提一下,這是讓線(xiàn)變色的寫(xiě)法.
//==到這里都是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)然也可以自己錄音效來(lái)玩..
如果要跳出警示畫(huà)面
則在條件成立時(shí)再加入:
Alert( "Bullish alert" ); //上引號(hào)內(nèi)的文字可以自行變動(dòng).
執(zhí)行指標(biāo)后要記得這里要勾選才會(huì)有作用.
本帖子中包含更多資源
您需要 登錄 才可以下載或查看,沒(méi)有帳號(hào)?立即注冊(cè)
有思路,想編寫(xiě)各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 1145508240 進(jìn)行 有償 編寫(xiě)!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容