Ejemplo n.º 1
0
    public StochasticTrade(string name, StartProgram startProgram)
        : base(name, startProgram)
    {
        TabCreate(BotTabType.Simple);
        _tab = TabsSimple[0];

        _stoch = IndicatorsFactory.CreateIndicatorByName("Stochastic", name + "Stochastic", false);
        _stoch = (Aindicator)_tab.CreateCandleIndicator(_stoch, "StochasticArea");

        Upline = new LineHorisontal("upline", "StochasticArea", false)
        {
            Color = Color.Green,
            Value = 0,
        };
        _tab.SetChartElement(Upline);

        Downline = new LineHorisontal("downline", "StochasticArea", false)
        {
            Color = Color.Yellow,
            Value = 0
        };
        _tab.SetChartElement(Downline);

        Regime   = CreateParameter("Regime", "Off", new[] { "Off", "On", "OnlyLong", "OnlyShort", "OnlyClosePosition" });
        Volume   = CreateParameter("Volume", 3, 1.0m, 50, 4);
        Slippage = CreateParameter("Slippage", 0, 0, 20, 1);

        UpLineValue   = CreateParameter("Up Line Value", 80, 60.0m, 90, 0.5m);
        DownLineValue = CreateParameter("Down Line Value", 20, 10.0m, 40, 0.5m);

        StochPeriod1 = CreateParameter("Stoch Period 1", 5, 3, 40, 1);
        StochPeriod2 = CreateParameter("Stoch Period 2", 3, 2, 40, 1);
        StochPeriod3 = CreateParameter("Stoch Period 3", 3, 2, 40, 1);

        Upline.Value   = UpLineValue.ValueDecimal;
        Downline.Value = DownLineValue.ValueDecimal;

        _stoch.ParametersDigit[0].Value = StochPeriod1.ValueInt;
        _stoch.ParametersDigit[1].Value = StochPeriod2.ValueInt;
        _stoch.ParametersDigit[2].Value = StochPeriod3.ValueInt;

        _stoch.Save();

        _tab.CandleFinishedEvent += Strateg_CandleFinishedEvent;



        Upline.TimeEnd   = DateTime.Now;
        Downline.TimeEnd = DateTime.Now;

        ParametrsChangeByUser += RviTrade_ParametrsChangeByUser;
    }
Ejemplo n.º 2
0
        public RsiContrtrend(string name, StartProgram startProgram)
            : base(name, startProgram)
        {
            TabCreate(BotTabType.Simple);
            _tab = TabsSimple[0];

            _ma = new MovingAverage(name + "MA", false)
            {
                Lenght = 50, ColorBase = Color.CornflowerBlue,
            };
            _ma = (MovingAverage)_tab.CreateCandleIndicator(_ma, "Prime");

            _rsi = new Rsi(name + "RSI", false)
            {
                Lenght = 20, ColorBase = Color.Gold,
            };
            _rsi = (Rsi)_tab.CreateCandleIndicator(_rsi, "RsiArea");

            Upline = new LineHorisontal("upline", "RsiArea", false)
            {
                Color = Color.Green,
                Value = 0,
            };
            _tab.SetChartElement(Upline);

            Downline = new LineHorisontal("downline", "RsiArea", false)
            {
                Color = Color.Yellow,
                Value = 0
            };
            _tab.SetChartElement(Downline);

            _rsi.Save();
            _ma.Save();

            _tab.CandleFinishedEvent += Strateg_CandleFinishedEvent;

            Slipage        = 0;
            VolumeFix      = 1;
            Upline.Value   = 65;
            Downline.Value = 35;


            Load();

            Upline.TimeEnd   = DateTime.Now;
            Downline.TimeEnd = DateTime.Now;

            DeleteEvent += Strategy_DeleteEvent;
        }
Ejemplo n.º 3
0
    public RsiTrade(string name, StartProgram startProgram)
        : base(name, startProgram)
    {
        TabCreate(BotTabType.Simple);
        _tab = TabsSimple[0];

        _rsi = IndicatorsFactory.CreateIndicatorByName("RSI", name + "RSI", false);
        _rsi = (Aindicator)_tab.CreateCandleIndicator(_rsi, "RsiArea");

        Upline = new LineHorisontal("upline", "RsiArea", false)
        {
            Color = Color.Green,
            Value = 0,
        };
        _tab.SetChartElement(Upline);

        Downline = new LineHorisontal("downline", "RsiArea", false)
        {
            Color = Color.Yellow,
            Value = 0
        };
        _tab.SetChartElement(Downline);

        Regime        = CreateParameter("Regime", "Off", new[] { "Off", "On", "OnlyLong", "OnlyShort", "OnlyClosePosition" });
        Volume        = CreateParameter("Volume", 1, 1.0m, 50, 4);
        Slippage      = CreateParameter("Slippage", 0, 0, 20, 1);
        RsiLength     = CreateParameter("Rsi Length", 20, 10, 40, 2);
        UpLineValue   = CreateParameter("Up Line Value", 65, 60.0m, 90, 0.5m);
        DownLineValue = CreateParameter("Down Line Value", 35, 10.0m, 40, 0.5m);

        _rsi.ParametersDigit[0].Value = RsiLength.ValueInt;

        _rsi.Save();

        Upline.Value   = UpLineValue.ValueDecimal;
        Downline.Value = DownLineValue.ValueDecimal;

        Upline.TimeEnd   = DateTime.Now;
        Downline.TimeEnd = DateTime.Now;

        _tab.CandleFinishedEvent += Strateg_CandleFinishedEvent;
        DeleteEvent           += Strategy_DeleteEvent;
        ParametrsChangeByUser += Event_ParametrsChangeByUser;
    }
Ejemplo n.º 4
0
        public WilliamsRangeTrade(string name, StartProgram startProgram)
            : base(name, startProgram)
        {
            TabCreate(BotTabType.Simple);
            _tab = TabsSimple[0];

            _wr = new WilliamsRange(name + "WillamsRange", false);
            _wr = (WilliamsRange)_tab.CreateCandleIndicator(_wr, "WilliamsArea");

            Upline = new LineHorisontal("upline", "WilliamsArea", false)
            {
                Color = Color.Green,
                Value = 0,
            };
            _tab.SetChartElement(Upline);

            Downline = new LineHorisontal("downline", "WilliamsArea", false)
            {
                Color = Color.Yellow,
                Value = 0
            };
            _tab.SetChartElement(Downline);

            _wr.Save();

            _tab.CandleFinishedEvent += Strateg_CandleFinishedEvent;

            Slipage        = 0;
            VolumeFix      = 1;
            Upline.Value   = -20;
            Downline.Value = -80;

            Load();

            Upline.TimeEnd   = DateTime.Now;
            Downline.TimeEnd = DateTime.Now;

            DeleteEvent += Strategy_DeleteEvent;
        }
Ejemplo n.º 5
0
    public CciTrade(string name, StartProgram startProgram)
        : base(name, startProgram)
    {
        TabCreate(BotTabType.Simple);
        _tab = TabsSimple[0];

        Regime        = CreateParameter("Regime", "Off", new[] { "Off", "On", "OnlyLong", "OnlyShort", "OnlyClosePosition" });
        Volume        = CreateParameter("Volume", 3, 1.0m, 50, 4);
        Slippage      = CreateParameter("Slippage", 0, 0, 20, 1);
        CciLength     = CreateParameter("Cci Length", 20, 10, 40, 2);
        UpLineValue   = CreateParameter("Up Line Value", 150, 50.0m, 300, 20m);
        DownLineValue = CreateParameter("Down Line Value", -150, -300.0m, -50, 20);

        _cci = IndicatorsFactory.CreateIndicatorByName("CCI", name + "Cci", false);
        _cci.ParametersDigit[0].Value = CciLength.ValueInt;
        _cci = (Aindicator)_tab.CreateCandleIndicator(_cci, "CciArea");
        _cci.Save();

        Upline = new LineHorisontal("upline", "CciArea", false)
        {
            Color = Color.Green,
            Value = 0,
        };
        _tab.SetChartElement(Upline);

        Downline = new LineHorisontal("downline", "CciArea", false)
        {
            Color = Color.Yellow,
            Value = 0
        };
        _tab.SetChartElement(Downline);

        Upline.Value   = UpLineValue.ValueDecimal;
        Downline.Value = DownLineValue.ValueDecimal;

        _tab.CandleFinishedEvent += Strateg_CandleFinishedEvent;
        ParametrsChangeByUser    += Event_ParametrsChangeByUser;
    }
Ejemplo n.º 6
0
 public void PaintHorisiontalLineOnArea(LineHorisontal lineElement)
 {
     throw new NotImplementedException();
 }