|
suneyes168
|
我的程式碼如下: --------------------------------------------------------------------------------------------- VALUE1 = (High[1] + Low[1] + Close[1]) / 3 VALUE2= 2*VALUE1+ High - 2* Low VALUE3= 2*VALUE1+ Low - 2* High
counter = 0 If Alert( "警示" ) = True Then counter +1 End if
if MarketPosition <> 1 then buy ("買進") value2 stop end if
If counter < = 1 And MarketPosition<> -1 then Alert( "警示" ) End if
if MarketPosition<> -1 then sell("賣出") value3 stop end if
If counter < = 1 And MarketPosition<> 1 then Alert( "警示" ) End if
If counter < > 0 Then counter = 0 Next Bar At Open end if
-------------------------------------------------------------------------------------------------- 我是想讓日盛股票看盤軟體HTS程式買賣訊號發生時能啟動「警示」以音樂告知,但「盤中」警示音樂會週而復始不斷的響。 我想以「counter」來管控只響一次,但語法不太會寫,錯誤碼顯示為:
[Line: 5,code:2010] : 'counter'是沒有定義好的indetifier [Line: 6,code:2012] : 演算錯誤(資料類型不同) [Line: 6,code:2007] : 在'if'之後需要'boolean'語法連結 [Line: 7,code:2010] : 'counter'是沒有定義好的indetifier [Line: 7,code:2007] : 在''之後需要'='語法連結 [Line: 7,code:2011] : 必須使用帶入方或呼叫函數的方式 [Line: 7,code:2005] : 無法以'+'開始新文件 [Line: 7,code:2005] : 無法以'1'開始新文件 [Line:14,code:2010] : 'counter'是沒有定義好的indetifier [Line:22,code:2010] : 'counter'是沒有定義好的indetifier [Line:26,code:2010] : 'counter'是沒有定義好的indetifier [Line:27,code:2010] : 'counter'是沒有定義好的indetifier [Line:27,code:2006] : 需要'end if' [Line:27,code:2010] : 'bar'是沒有定義好的indetifier [Line:27,code:2007] : 在''之後需要'='語法連結 [Line:27,code:2011] : 必須使用帶入方或呼叫函數的方式 [Line:27,code:2007] : 在''之後需要'='語法連結 [Line:27,code:2011] : 必須使用帶入方或呼叫函數的方式
---------------------------------------------------------------------------------------------------
能否幫我修正協助我修改程式碼讓啟動音樂只響一次不會重複響,謝謝!
|