為什么不能在tick圖里面止損
作者:開拓者 TB 來源:cxh99.com 發(fā)布時間:2019年06月08日
-
咨詢內(nèi)容:
為什么不能在tick圖里面止損
//------------------------------------------------------------------------
// 簡稱: DUANXIAN
// 名稱: DUANXIAN
// 類別: 公式應(yīng)用
// 類型: 用戶應(yīng)用
// 輸出: Void
//------------------------------------------------------------------------
Params
? ?? ?? ?//此處添加參數(shù)
Vars
? ?? ?? ?//此處添加變量
Begin
? ?? ?? ?//此處添加代碼正文
? ?? ???If(!CallAuctionFilter()) Return;
? ?? ?? ?? ? if(barstatus==0)setglobalvar(0,0);
if(barstatus==0)setglobalvar(1,0);
? ?? ?? ?if(barstatus==2)
{
? ?? ?? ?//多開
if(Q_OutsideVol>GetGlobalVar(0) and (Q_LastVol()>1000 and??Q_OpenIntFlag>0) and (Q_Last==GetGlobalVar(2)))
? ?? ???{
? ???
? ?? ?? ?? ???A_SendOrder(Enum_Buy,Enum_Entry,1,Q_Last);
? ?? ? }
? ?? ? //空開
? ?? ???
if(Q_InsideVol>GetGlobalVar(1) and (Q_LastVol()>1000 and??Q_OpenIntFlag>0) and??(Q_Last==GetGlobalVar(3)))
? ?{
? ?? ?? ? A_SendOrder(Enum_Sell,Enum_Entry,1,Q_Last);
? ?? ???}
? ?? ?
? ?? ?? ?
? ?? ?? ? //平多
? ?? ?? ?if(A_BuyPosition()>0)
? ?? ?? ? {
? ?? ?? ?? ?? ?? ?A_SendOrder(Enum_Sell,Enum_Exit,1,A_BuyAvgPrice+2);
? ?? ?? ?}? ?? ???
//平空
? ?? ?? ?if(A_SellPosition>0 )
? ?? ?? ? {
? ?? ?? ?
? ?? ?? ?A_SendOrder(Enum_Buy,Enum_Exit,1,A_SellAvgPrice-2);
? ?? ?? ?? ?? ? }
? ?? ?
? ?? ?? ?
? ?? ???//止損
? ?? ?//空止損
? ?? ?
? ?? ?? ? if(A_SellPosition>0 )
? ?? ?? ? {??
? ?? ?? ? if(Q_InsideVol>GetGlobalVar(1) and (Q_LastVol()>1000 and??Q_OpenIntFlag>0) and??(Q_Last==GetGlobalVar(3)))
? ?? ?? ? {??
A_DeleteOrder(A_OpenOrderContractNo(0));
A_SendOrder(Enum_Buy,Enum_Exit,1,Q_Last);
? ?? ? }
? ? }
? ? //多止損
if(A_BuyPosition()>0 )
? ?? ?? ? {
? ?? ?? ?? ?? ?? ?if(Q_InsideVol>GetGlobalVar(1) and (Q_LastVol()>1000 and??Q_OpenIntFlag>0) and??(Q_Last==GetGlobalVar(3)))
? ?? ?? ?{
? ?? ?? ?A_DeleteOrder(A_OpenOrderContractNo(0));
? ?? ?? ?? ?? ???A_SendOrder(Enum_Sell,Enum_Exit,1,Q_Last);
? ?? ?? ?? ?? ?? ?? ?
? ?? ?? ?}
? ?? ?? ?
? ?? ?? ?}
}
? ?? ???setglobalvar(0,Q_OutsideVol);
? ?? ?? ? setglobalvar(1,Q_InsideVol);
? ?? ?? ? SetGlobalVar(2,Q_AskPrice);
? ?? ?? ? SetGlobalVar(3,Q_BidPrice);
? ?? ?? ?
End
//------------------------------------------------------------------------
// 編譯版本:? ?? ???2018/09/25 122512
// 內(nèi)核版本:? ?? ???V2.8.2.14
// 版權(quán)所有? ?? ???kingofdragon1
// 更改聲明? ?? ???TradeBlazer Software保留對TradeBlazer平臺
//? ?? ?? ?? ?? ?? ?? ?? ?每一版本的TradeBlazer公式修改和重寫的權(quán)利
//------------------------------------------------------------------------