input: magic_number(2,"魔術點數");
input: profit_percent(1.5,"停利(%)");
input: loss_percent(1.5,"停損(%)");
input:last_time(123000,"最後進場時間");
input:exit_time(130000,"離場時間");
var:money(200);
var:intraBarPersist entry_price(0);
var: maV_60(0),point_buy(0);
maV_60 = average(volume[2],60);
if point_buy <= 60 then point_buy = point_buy + 1;
if
position = 0
and filled = 0
and point_buy = 60
and volume[1] > maV_60 * magic_number
and close[1] > open[1]
and currentTime <= last_time
then
Begin
setposition(money/close);
entry_price = close;
End;
if position > 0 and filled > 0
and (
close >= entry_price * (1+0.01*profit_percent)
or close < entry_price * (1-0.01*loss_percent)
or currentTime >= exit_time
)
then
begin
setposition(0,market);
end;
1 評論