人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者公式>>正文內(nèi)容

K線追蹤_1Hour交易策略[開拓者公式]

此模型收益不高,盈虧比還可以,但是,模型包含了,止損,浮動(dòng)階段回撤止盈。此模型沒有包含資金開倉(cāng)管理,下一個(gè)公開的將包含,加倉(cāng)、減倉(cāng),止盈、止損等內(nèi)容,等下一篇再細(xì)說吧,廢話不多說,源碼如下:
源碼后有模型設(shè)置方法,不過,有些圖線可以去掉,自行處理吧

希望轉(zhuǎn)載引用此文的童鞋們將此文的鏈接一并復(fù)制,并記住新浪上有一個(gè)叫“金融瘋子”的王童鞋

 

//------------------------------------------------------------------------
// 簡(jiǎn)稱: Sanxian2  金融瘋子 分享
// 名稱: 三線2
// 類別: 公式應(yīng)用
// 類型: 用戶應(yīng)用
// 輸出: 代編模型QQ 1145508240
//------------------------------------------------------------------------

Params
    Numeric TakePoint0(62);
Vars
    Numeric Lots(1);
 Numeric LossPoint;
    NumericSeries times;
    Numeric ZSPrice;
    NumericSeries BasedpriceUp;
 NumericSeries Basedpricedown;
 NumericSeries Basedprice;
 Numeric HighDDPrice;
 Numeric LowDprice;
 NumericSeries DownLineK;
 NumericSeries UpLineK;
 NumericSeries KZhu;
 NumericSeries KZhu0;
 Numeric EndTime;
    Numeric BarsSToday;
 NumericSeries RedK;
 NumericSeries GreenK;
 NumericSeries YellowK;
 NumericSeries BuyHighAfterEntry;
 NumericSeries SellHighAfterEntry;
 NumericSeries LowAfterEntry;
 NumericSeries HighAfterEntry;
 Numeric BuyHighestPosiPro;
 Numeric SellHighestPosiPro;
 Numeric BuyReverseHighestPosiPro;
 Numeric SellReverseHighestPosiPro;
 Numeric ZYPrice;
 Numeric retrdpiont0;
 Numeric retrdpiont1;
 Numeric retrdpiont2;
 Numeric retrdpiont3;
 Numeric retrdpiont4;
 Numeric retrdpiont5;
    Numeric TakePoint1;
    Numeric TakePoint2;
    Numeric TakePoint3;
    Numeric TakePoint4;
    Numeric TakePoint5;
 Numeric K(3);
 Numeric TODAYBARS;
    Numeric DateDay(20131211);
Begin
    TODAYBARS=BarsSinceToday+1;
     If(TODAYBARS==1)
      {
         PlotString("周期提醒:",SymbolName+":1H");
      }
   If(TODAYBARS==1&&Date>=DateDay&&Date<=DateDay+5)
 {
  PlotString("授權(quán)","授權(quán)時(shí)間即將過期",0);
 }
    If(TODAYBARS==1&&Date>DateDay+3)
 {
  PlotString("授權(quán)","授權(quán)時(shí)間已經(jīng)過期",0);
 }
 If(Date>DateDay+5)
 {
  Return;
 }
        If(BarType == 1)
    {
       If(Left(Symbol,2) == "IF")
       {
             EndTime = 0.1515 - 0.0001*BarInterval;
    }Else
       {
             EndTime = 0.1460 - 0.0001*BarInterval;
    }
    }
    If(Time>=EndTime&&MarketPosition<>0)
    {
     BuyToCover(0,o);
     Sell(0,o);
     //PlotString("平倉(cāng)","平倉(cāng)"+Text(ExitPrice),Low,Yellow);
     Return;
    }// 代編模型QQ 1145508240
 LossPoint=TakePoint0/5;
    TakePoint1=TakePoint0+LossPoint;
    TakePoint2=TakePoint1+LossPoint;
    TakePoint3=TakePoint2+LossPoint;
    TakePoint4=TakePoint3+LossPoint;
    TakePoint5=TakePoint4+LossPoint;

    retrdpiont0=LossPoint/2;
    retrdpiont1=retrdpiont0+LossPoint/2;
    retrdpiont2=retrdpiont1+LossPoint/2;
    retrdpiont3=retrdpiont2+LossPoint/2;
    retrdpiont4=retrdpiont3+LossPoint/2;
    retrdpiont5=retrdpiont4+LossPoint/2;
//初始化數(shù)據(jù) www.kzuj.com.cn
    Basedprice=CloseD(1);
    HighDDPrice=HighD(0);
 LowDprice=LowD(0);
//繪制第一根線
If(Date!=Date[1])
  {
    If(Close>Basedprice&&Low>=BasedpriceDown)
  {
         PlotNumeric("漲版:",Basedprice,Close,Red);
   RedK=RedK+1;
   GreenK=0;
   YellowK=0;
   Return;
     }
    If(Close<=BasedpriceUp)
      {
         PlotNumeric("跌版:",Close,Basedprice,Green);
   GreenK=GreenK+1;
   RedK=0;
   YellowK=0;
   Return;
      }
    If(Close==Basedprice)
      {
        UnPlot("漲版:");
     UnPlot("跌版:");
      }
  }
//繪制第二根線
 If(Date!=Date[1])
   {
     times=0;
     YellowK=0;
     RedK=0;
     GreenK=0;
  BasedpriceUp=HighDDPrice;
  Basedpricedown=LowDprice;
  UpLineK=0;
  DownLineK=0;
  KZhu=0;
  KZhu0=1;
   }Else
   {
  times=times[1];
     UpLineK=UpLineK[1];
  DownLineK=DownLineK[1];
  KZhu=KZhu[1];
  KZhu0=KZhu0[1];
  YellowK=YellowK[1];
  RedK=RedK[1];
  GreenK=GreenK[1];
   }
If(BarStatus>0)
  {
//記錄上漲數(shù)據(jù)
 If(Close[1]>BasedpriceUp)
   {
      BasedpriceUp=Close[1];
   Basedpricedown=Low[1];
   UpLineK=UpLineK+1;
   RedK=RedK+1;
   GreenK=0;
   YellowK=0;
   DownLineK=0;
   KZhu=1;
   PlotNumeric("紅版:",Open[1],BasedpriceUp,Red);
   }
//記錄下跌數(shù)據(jù)
 If(Close[1]<Basedpricedown[1])
   {
      BasedpriceUp=High[1];
   Basedpricedown=Close[1];
   DownLineK=DownLineK+1;
   GreenK=GreenK+1;
   YellowK=0;
   RedK=0;
   UpLineK=0;
   KZhu=1;
   PlotNumeric("綠版:",BasedpriceUp,Open[1],Green);
   }
 }
    If(Close[1]>Basedpricedown&&Close[1]<BasedpriceUp[1])
   {
      BasedpriceUp=BasedpriceUp[1];
   Basedpricedown=Basedpricedown[1];
   KZhu=0;
   PlotNumeric("平版:",Close[1],Open[1],Yellow);
   YellowK=YellowK+1;
   GreenK=0;
   RedK=0;
   }
 If(KZhu==1)
   {
      KZhu0=1;
   }Else
   {
      KZhu0=0;
   }
 
    If(KZhu0==0&&BarsSToday>1)
      {
        PlotNumeric("平版:",Close[1],Open[1],Yellow);
  GreenK=0;
  RedK=0;
      }

 if(RedK<>0)
   {
     PlotString("RedK:",Text(RedK),o);
   }
 if(YellowK<>0)
   {
     PlotString("YellowK:",Text(YellowK),o);
   }
if(GreenK<>0)
   {
     PlotString("GreenK:",Text(GreenK),o);
   }
if(MarketPosition==0&&Time<0.1450)
{
if(RedK>=K)
  {
     Buy(Lots,o);
  times=times[1]+1;
  HighAfterEntry=High;
  LowAfterEntry=Low;
  Return;
  }
if(GreenK>=K)
  {
     SellShort(Lots,o);
  times=times[1]+1;
  HighAfterEntry=High;
  LowAfterEntry=Low;
  Return;
  }
}
    If(MarketPosition==1&&(LastEntryPrice-Low>=LossPoint))
  {
   ZSPrice=Min(open,LastEntryPrice-LossPoint);
   Sell(0,ZSPrice);
   Return;
  }
 
 If(MarketPosition==-1&&(High-LastEntryPrice>=LossPoint))
  {
     ZSPrice=Max(open,LastEntryPrice+LossPoint);
     BuyToCover(0,ZSPrice);
     Return;   
  }

   //止盈止損計(jì)算 ww.cxh99.com

  If(BarsSinceEntry>=1)
 {
    If(High>HighAfterEntry[1])
       {
       HighAfterEntry=High;
    }else
    {
      HighAfterEntry=HighAfterEntry[1];
    }
    If(Low<LowAfterEntry[1])
       {
       LowAfterEntry=Low;
    }else
    {
       LowAfterEntry=LowAfterEntry[1];
    }
  }

     BuyHighestPosiPro=HighAfterEntry[1]-EntryPrice;
     SellHighestPosiPro=EntryPrice-LowAfterEntry[1];

     BuyReverseHighestPosiPro=HighAfterEntry[1]-Low;
     SellReverseHighestPosiPro=High-LowAfterEntry[1];
If(MarketPosition==1 and BarsSinceLastEntry>1)
  {
      If(BuyHighestPosiPro>=TakePoint0&&SellHighestPosiPro>=retrdpiont0)
        {
           ZYPrice=Min(open,HighAfterEntry[1]-retrdpiont0);
     SellShort(Lots,ZYPrice);
     //PlotString("多止贏","多止贏"+Text(ExitPrice),Low,Yellow);
     Return;
  }// www.kzuj.com.cn
      If(BuyHighestPosiPro>=TakePoint1&&SellHighestPosiPro>=retrdpiont1)
        {
           ZYPrice=Min(open,HighAfterEntry[1]-retrdpiont1);
     SellShort(Lots,ZYPrice);
     //PlotString("多止贏","多止贏"+Text(ExitPrice),Low,Yellow);
     Return;
  }
   If(BuyHighestPosiPro>=TakePoint2&&SellHighestPosiPro>=retrdpiont2)
        {
           ZYPrice=Min(open,HighAfterEntry[1]-retrdpiont2);
     SellShort(Lots,ZYPrice);
     //PlotString("多止贏","多止贏"+Text(ExitPrice),Low,Yellow);
     Return;
  }
   If(BuyHighestPosiPro>=TakePoint3&&SellHighestPosiPro>=retrdpiont3)
        {
           ZYPrice=Min(open,HighAfterEntry[1]-retrdpiont3);
     SellShort(Lots,ZYPrice);
     //PlotString("多止贏","多止贏"+Text(ExitPrice),Low,Yellow);
     Return;
  }
   If(BuyHighestPosiPro>=TakePoint4&&SellHighestPosiPro>=retrdpiont4)
        {
           ZYPrice=Min(open,HighAfterEntry[1]-retrdpiont4);
     SellShort(Lots,ZYPrice);
     //PlotString("多止贏","多止贏"+Text(ExitPrice),Low,Yellow);
     Return;
  }
   If(BuyHighestPosiPro>=TakePoint5&&BuyReverseHighestPosiPro>retrdpiont5)
        {
           ZYPrice=Min(open,HighAfterEntry[1]-retrdpiont5);
     SellShort(Lots,ZYPrice);
     //PlotString("多止贏","多止贏"+Text(ExitPrice),Low,Yellow);
     Return;
  }
  }
If(MarketPosition==-1 and BarsSinceLastEntry>1)
  {
      If(SellHighestPosiPro>=TakePoint0&&SellHighestPosiPro>=retrdpiont0)
        {
           ZYPrice=Max(open,LowAfterEntry[1]+retrdpiont0);
     Buy(Lots,ZYPrice);
     //PlotString("空止贏","空止贏"+Text(ExitPrice),High,Yellow);
     Return;
  }
      If(SellHighestPosiPro>=TakePoint1&&SellHighestPosiPro>=retrdpiont1)
        {
           ZYPrice=Max(open,LowAfterEntry[1]+retrdpiont1);
     Buy(Lots,ZYPrice);
     //PlotString("空止贏","空止贏"+Text(ExitPrice),High,Yellow);
     Return;
  }
   If(SellHighestPosiPro>=TakePoint2&&SellHighestPosiPro>=retrdpiont2)
        {
           ZYPrice=Max(open,LowAfterEntry[1]+retrdpiont2);
     Buy(Lots,ZYPrice);
     //PlotString("空止贏","空止贏"+Text(ExitPrice),High,Yellow);
     Return;
  } // www.kzuj.com.cn
   If(SellHighestPosiPro>=TakePoint3&&SellHighestPosiPro>=retrdpiont3)
        {
           ZYPrice=Max(open,LowAfterEntry[1]+retrdpiont3);
     Buy(Lots,ZYPrice);
     //PlotString("空止贏","空止贏"+Text(ExitPrice),High,Yellow);
     Return;
  }
   If(SellHighestPosiPro>=TakePoint4&&SellHighestPosiPro>=retrdpiont4)
        {
           ZYPrice=Max(open,LowAfterEntry[1]+retrdpiont4);
     Buy(Lots,ZYPrice);
     //PlotString("空止贏","空止贏"+Text(ExitPrice),High,Yellow);
     Return;
  }
   If(SellHighestPosiPro>=TakePoint5&&SellReverseHighestPosiPro>retrdpiont5)
        {
           ZYPrice=Max(open,LowAfterEntry[1]+retrdpiont5);
     Buy(Lots,ZYPrice);
     //PlotString("空止贏","空止贏"+Text(ExitPrice),High,Yellow);
     Return;
  }
 }
End

//------------------------------------------------------------------------
// 編譯版本 GS2010.12.08
// 用戶版本 2013/01/21 11:43
// 版權(quán)所有 baoshan6997  www.kzuj.com.cn
// 更改聲明 TradeBlazer Software保留對(duì)TradeBlazer平臺(tái)
//   每一版本的TrabeBlazer公式修改和重寫的權(quán)利
//------------------------------------------------------------------------

 

 

將最后一圖中的前7個(gè)都設(shè)置為柱線,線寬設(shè)置為最粗,OK

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 1145508240  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!

 


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
  主站蜘蛛池模板: 国产日韩亚洲不卡高清在线观看 | 日日摸人人看97人人澡 | 国产精品自在线天天看片 | 欧美日韩国产综合在线 | 污污视频网址 | 在线视频一区二区三区四区 | 一色屋精品亚洲香蕉网站 | 两性色午夜视频免费播放 | 成人福利免费观看体验区 | 欧美在线免费播放 | 欧美xxx在线观看4k | 黄乱色伦短篇小说 | 伊人影视在线观看日韩区 | 成人国产亚洲 | 手机看片日本 | 一男一女下面一进一出性视频 | 国产成人免费在线 | 伊人网2021| 欧美一级视频在线 | 午夜国产 | 久久91精品久久久久久水蜜桃 | 九九精品在线播放 | 日日摸处处碰夜夜爽视频 | 欧美日韩视频精品一区二区 | 国产日韩精品视频 | 国产一二三区在线观看 | 欧美成人香蕉网在线观看 | 污视频免费在线播放 | 国产成人在线综合 | 亚洲人成小说色在线 | 性生交大片免费一级 | m3u8久久国产精品影院 | 8844aa在线毛片 | free性欧美极度另类性性欧美 | 香蕉久久综合 | 国产精品视频免费的 | 看全色黄大色黄大片 视 | 激情五月激情综合 | 欧美 日韩 亚洲另类专区 | 天天综合天天看夜夜添狠狠玩 | 免费的黄视频 |