COCO研究院

 找回密碼
 註冊
搜索
查看: 10174|回復: 0

免費台指策略分享

[複製鏈接]
發表於 23-7-3 21:09 | 顯示全部樓層 |閱讀模式
價差策略
data2為台指日K
input:bull(1);
var:pDiff(20),pdff(-40);
vars:vMP(0),vDiff(0);
var:long_switch(0),short_switch(0);
////////////////////////////////////////////////////////////////////////////////
vDiff=C - C Data2;
vMP=marketposition;
////////////////////////////////////////////////////////////////////////////////
//Original in-out
if t>0900 and t<1300
then begin         
          if vDiff>pDiff and vMP>=0 and entryname<>"Short-Backhand"                 
          then sellshort("Short Trigger") bull contract next bar market;

          if vDiff<pdff and vMP<=0 and entryname<>"Long-Backhand"         
          then buy("Long Trigger") bull contract  next bar market;   
     end;      
////////////////////////////////////////////////////////////////////////////////
//Short-Backhand
var:Short_BH_pts(120),Short_BH_Profittarget(180),Short_BH_Stoploss(180);

if vMP<0 and entryname="Short Trigger"
then buy("Short-Backhand") bull contract  next bar entryprice+Short_BH_pts stop;

if vMP>0
then begin
          sell("Profit target") bull contract  from entry("Short-Backhand") next bar entryprice+Short_BH_Profittarget limit;
          sell("Stop loss") bull contract  from entry("Short-Backhand") next bar entryprice-Short_BH_Stoploss stop;
     end;
////////////////////////////////////////////////////////////////////////////////
//Long-Backhand
var:Long_BH_pts(300),Long_BH_Profittarget(160),Long_BH_Stoploss(120);

if vMP>0 and entryname="Long Trigger"
then sellshort("Long-Backhand") bull contract  next bar entryprice-Long_BH_pts stop;

if vMP<0
then begin
          buytocover("Profit target ")bull contract  from entry("Long-Backhand") next bar entryprice-Long_BH_Profittarget limit;
          buytocover("Stop loss ") bull contract from entry("Long-Backhand") next bar entryprice+Long_BH_Stoploss stop;
     end;
////////////////////////////////////////////////////////////////////////////////
if _IsSettlementDay=True
then setexitonclose;


另外可分享最近團到的策略
有興趣可以+我賴 wangjei1025





您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-4-28 03:52

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook