强Sub ForWeekRule
dim code
dim market
dim cyctype
dim highest
dim lowest
code="RU00"
market="SQ"
cyctype=5
set historydata =marketdata.GetHistoryData(code,market,cyctype)
for i=historydata.count-22 to historydata-2
if historydata.high(i)>highest then
highest=historydata.high(i)
end if
if historydata.low(i)<lowest then
lowest=historydata.low(i)
end if
next
if historydata(historydata.count-1)>highest then
order.buyshort 1,1,0,0,code,market,0,0
order.buy 1,1,0,0,code,market,0,0
end if
if historydata(historydata.count-2)<lowest then
order.SellShort 1,1,0,0,code,market,0,0
order.sell 1,1,0,0,code,market,0,0
end if
end sub