|
inputs: Price( Close ), Length( 14 ), OverSold( 0 ), OverSold2( 0 ) , OverSold3( 0 ), OverSold4( 0 ) ;
variables: var0( 0 ), var1(0), var2(0), var3(0) ;
var0 = RSI( Price, Length ) ;
condition1 = Currentbar > 1 and var0 cross over OverSold ;
condition2 = Currentbar > 1 and var0 cross over OverSold2 ;
condition3 = Currentbar > 1 and var0 cross over OverSold3 ;
condition4 = Currentbar > 1 and var0 cross over OverSold4 ;
if condition1 or condition2 or condition3 or condition4 then Buy ( "buy" ) next bar at market ;
if var0 < var0[2] then sell ( "sell" ) next bar at market ;
想加個條件 是 (XAverage(c,20) 在c,50以上 , c,50在c,100以上) 才執行condition1-4
我用if xxx then begin做不到 請教一下 (上網也看過 寫不出來....)
|
|