我想編寫一個股票交易模型
N:=INTPART((7-C)/0.05);
T=((7-C)/0.05;
買入條件:T=N,并且現(xiàn)在的價格低于上次買入的價格,買入量為10*N;
賣出條件:價格等于1.
大概是這么個意思,請老師給我?guī)蛶兔?/p>
INTPART
這個函數(shù)什么意思?
n:=round((7-c)/0.05);
T:=(7-C)/0.05;
variable:m=0;
if holding=0 and t=n and m=0 then begin
buy(1,10*n,market);
m:=1;
end
if holding=0 and m=1 and t=0 and c<enterprice then buy(1,10*n,market);
if h>=1 and l<=1 then sell(1,0,market);