if MarketPosition > 0 then begin
SetStoploss(50 * BigpointValue) ;
SetProfitTarget(50 * BigpointValue) ;
else if MarketPosition < 0 then Begin
SetStoploss(100 * BigpointValue) ;
SetProfitTarget(50 * BigpointValue) ;
if time >= 1340 then Begin
Sell this bar on close ;
BuytoCover this bar on Close ;
end ;
如果要進場後過 N 根K棒再執行
if BarsSinceEntry > N then Begin
if MarketPosition > 0 then begin
SetStoploss(50 * BigpointValue) ;
SetProfitTarget(50 * BigpointValue) ;
else if MarketPosition < 0 then Begin
SetStoploss(100 * BigpointValue) ;
SetProfitTarget(50 * BigpointValue) ;
end;
if MarketPosition > 0 then begin
SetStoploss(50 * BigpointValue) ;
SetProfitTarget(50 * BigpointValue) ;
else if MarketPosition < 0 then Begin
SetStoploss(100 * BigpointValue) ;
SetProfitTarget(50 * BigpointValue) ;