请教 第一根k线·怎么表示

Discussion in '金字塔决策交易系统' started by rogerhylt, Apr 5, 2010.

  1. 如题 比如在tradestation中这样表示

    IF CurrentBar = 1 Then Begin ---

    在金字塔中怎么表示 好像不是这个函数 BARSTATU
    请指教
     
  2. IF Barpos = 1 Then Begin ---
     
  3. 谢谢 麻烦再问一个问题 期货的 连续 量指 仓指 等权数据 都有什么区别?
    如果做测试 哪一个更好?
     
  4. 连续---以最大成交量为主的主力合约
    量指---以成交量为权重各合约组成的指数
    仓指---以持仓量为权重各合约组成的指数
    等权---各合约等权重指数
    日内交易用连续合约最好,即交易最活跃品种,相当接近实际情况
    其它根据自己的喜好来选定
     
  5. 谢谢 不嫌麻烦的话 还有个问题

    请问如下止损 如何编写?
    Inputs: MultCloses(5);
    Variables: ProfitPrice(0), Counter(0);

    If BarsSinceEntry = 0 Then Begin
    Counter = 0;
    ProfitPrice = EntryPrice;
    End;

    If Close > ProfitPrice Then
    Counter = Counter + 1;

    If Counter = MultCloses Then
    ExitLong ("Prft") This Bar on Close;
    以上是ts 代码
    我看 意思就是从开仓算起 如果有5根k线收盘价 都大于入市价 则止盈

    我这样编写 v3:=Close > ENTERPRICE and enterbars>=0;


    if COUNT(v3 ,ENTERBARS ):= MultCloses Then
    SELL(holding>0 ,0 ,thisclose );

    但结果是 开仓当天就止盈了 请指教
     
  6. if COUNT(v3 ,ENTERBARS )= MultCloses Then
    SELL(holding>0 ,0 ,thisclose );
     
  7. 谢谢
     
  8. 以下是r-breaker 的ts 代码

    原本是用在sp指数期货上的日内交易代码

    原来在future truth 多年实时监测都是排行前几名

    那位斑竹有兴趣把它转为 金字塔代码试试

    {R-Breaker}
    {***********SystemSetup*******************
    Trading between 9:15 and 14:29 ChicagoTime only
    MMStop $1000
    Close End of Day
    10 min Time Frame
    ******************************************}


    input:notbef(715),notaft(1229);
    var:{input:}f1(.35),f2(0.07),f3(.25),reverse(2.00),
    rangemin(1.15),xdiv(3);

    var:ssetup(0),bsetup(0),senter(0),benter(0),bbreak(0),sbreak(0),
    ltoday(0),hitoday(9999),startnow(0),div(0),
    rfilter(false);


    if currentbar=1 then startnow=0;
    div=maxlist(xdiv,1);
    if d>d[1] then begin

    startnow=startnow+1;

    ssetup=hitoday[1]+f1*(c[1]-ltoday[1]);
    senter=((1+f2)/2)*(hitoday[1]+c[1])-(f2)*ltoday[1];
    benter=((1+f2)/2)*(ltoday[1]+c[1])-(f2)*hitoday[1];
    bsetup=ltoday[1]-f1*(hitoday[1]-c[1]);
    bbreak=ssetup+f3*(ssetup-bsetup){(1.3625*hitoday[1]+.45*c[1])-.8125*ltoday[1]};
    sbreak=bsetup-f3*(ssetup-bsetup){(1.3625*ltoday[1]+.45*c[1])-.8125*hitoday[1]};

    hitoday=h;
    ltoday=l;

    rfilter=hitoday[1]-ltoday[1]>=rangemin;

    end;

    if h>hitoday then hitoday=h;
    if l<ltoday then ltoday=l;

    if t>=notbef and t<notaft and startnow>=2 and rfilter and
    date>entrydate(1) then begin

    if hitoday>=ssetup and marketposition>-1 then
    SELL("Rlev SE") senter+(hitoday-ssetup)/div stop;
    if ltoday<=bsetup and marketposition<1 then
    BUY("Rlev LE") benter-(bsetup-ltoday)/div stop;

    if marketposition=-1 then
    BUY("RbUP LE") entryprice+reverse stop;
    if marketposition=1 then
    SELL("RbDN SE") entryprice-reverse stop;

    if marketposition=0 then
    BUY("Break LE") bbreak stop;
    if marketposition=0 then
    SELL("Break SE") sbreak stop;

    end;

    if t>=notaft and t<>sess1endtime then begin

    if marketposition=-1 then
    EXITSHORT("RbUP SX") entryprice+reverse stop;
    if marketposition=1 then
    EXITLONG("RbDN LX") entryprice-reverse stop;

    EXITSHORT("Late SX") h+.05 stop;
    EXITLONG("Late LX") l-.05 stop;
    END;