★★★★如果您有策略不会编写,我们金字塔来免费帮助您编写★★★

Discussion in '金字塔决策交易系统' started by ytweiwei, Jan 26, 2012.

  1. 注意,仅接受完整的策略需求描述,例如格式:

    突破30根5分钟周期的最高价开多,
    P<突破开仓K线的最低价前,
    跌破开仓K线的最低价平仓。
    P>突破开仓K线的最低价后,
    跌破P平仓。

    突破30根5分钟周期的最低价开空,
    P>突破开仓K线的最高价前,
    涨破开仓K线的最高价平仓。
    P<突破开仓K线的最高价后,
    涨破P平仓。

    请把问题递交到金字塔论坛 http://www.weistock.com/bbs/index.asp?boardid=11
    或者海洋的金字塔板块
     
    Last edited by a moderator: Jan 30, 2012
  2. ZWS

    ZWS

    请老师把下面的改成金字塔的程序,谢谢!!

    以随机进场为基础的趋势系统

    思路:随机产生0-100的数值。数值大于49多头进场,否则空头进场。进场后,多头10新低退出,空头10新高退出。

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Drawing;
    using WealthLab;
    using WealthLab.Indicators;

    namespace WealthLab.Strategies
    {
    public class MyStrategy : WealthScript
    {
    protected override void Execute()
    {


    Random autoRand = new Random( );
    for(int bar = 20; bar < Bars.Count; bar++)
    {
    if (IsLastPositionActive)
    {



    double level = (LastPosition.PositionType == PositionType.Long) ? Lowest.Series(Low, 10)[bar] : Highest.Series(High, 10)[bar];


     
    ExitAtStop( bar+1, LastPosition,level);

    }
    else
    {
    double r=100 * autoRand.NextDouble( );
    if(r>49)

    BuyAtMarket( bar+1);
    else
    ShortAtMarket( bar+1);

     


    }
    }
    }
    }
    }