|
我直接把指標的程式碼加到策略後除錯,出現錯誤訊息:
如果單獨用策略也無法進出,是那裡有誤煩請大大解惑。
------ 編譯時產生錯誤: ------
Keyword "Plot**" can't been used in this type of study
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
編譯錯誤: (函數)
程式碼:
inputs: AfStep( 0.02), AfLimit( 0.2 ) ,tm(1300) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( "" ) ;
Value1 = ParabolicSAR ( AfStep, AfLimit, var0, var1, var2, var3 ) ;
Plot1( var0, "ParCl" ) ;
if var3 = 1 then
Alert( "Bullish reversal" )
else if var3 = -1 then
Alert( "Bearish reversal" ) ;
If time >= 0845 and time <= Tm
and marketposition = 0 then begin
If close cross over value1 then buy next bar at open;
If close cross under value1 then sellshort next bar at open;
End;
If marketposition > 0 then begin
If close cross under value1 then sellshort next bar at open;
End;
If marketposition < 0 then begin
If close cross over value1 then buy next bar at open;
End;
If Time > Tm then begin
sell next bar at open;
buytocover next bar at open;
end; |
|