您好,
此版本在「進場單」設逐筆洗價時,仍會重覆下單喔,再請小幫手協助測試以下腳本是否一樣也會。

//=========================================================================
variable: intrabarpersist _stockS2(0),intrabarpersist _costS(0);
input:_BuyOrSell(1,"1進場,0出場");
//=========================================================================
//空單進場1
if _stockS2 = 0
and ( h > l[1] or l < h[1] )
then
begin
_stockS2 = 1 ;
_costS = close;
if _BuyOrSell=1 then ret=1;
retmsg ="空單進場";
print(time,_stockS2,_costS,SymbolName,"空單進場");
end;
//空單停損1
var: IntrabarPersist _lossS(10);
If SymbolName = "小型台指近月" then _lossS = 2;
If SymbolName = "美國道瓊近月" then _lossS = 60;
print(SymbolName,_lossS);
if _stockS2 =1 and close - _costS > _lossS
//and getinfo("IsRealTime") = 1
then begin
value569 = close - _costS;
print(date,time,close,_costS ,"停損1",value569);
_stockS2 = 0 ;
_costS =0;
if _BuyOrSell=0then ret=1;
retmsg ="空單停損1";
end;
//空單停損2
var: IntrabarPersist _lossS2(5);
if _stockS2 =1 and close - _costS >= _lossS2
//and getinfo("IsRealTime") = 1
then begin
value569 = close - _costS;
print(date,time,close,_costS ,"停損2",value569);
_stockS2 = 0 ;
_costS =0;
if _BuyOrSell=0then ret=1;
retmsg ="空單停損2";
end;
6 評論