Topics
18 Jun 2014, 01:54
 3028
 5
26 Mar 2014, 18:55
 7818
 13
26 Feb 2014, 19:39
 0
 2664
 2
21 Jan 2014, 20:33
 0
 2764
 2
31 Dec 2013, 03:17
 3373
 6
13 Nov 2013, 20:58
 2997
 3
15 Oct 2013, 20:13
 2732
 3
Replies

Old Account
26 Jan 2014, 01:34

I would be happy to help you, but i don't have much experience whit  Ichimoku so you are going to have to explainit a bit more for me. You can contact me at MrSvesli@hotmail.no if you to. 


@Old Account

Old Account
23 Jan 2014, 18:49

RE:

StBechstedt said:

Can you explain that a little bit further please???

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------
 
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
 
namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)]
    public class DrawSpread : Indicator
    {
 
        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }
 
        public override void Calculate(int index)
        {
            // Calculate value at specified index            
            DisplaySpreadOnChart();            
        }
 
 
 
        private void DisplaySpreadOnChart()
        {
            var spread = Math.Round(Symbol.Spread/Symbol.PipSize, 2);
            string text = string.Format("{0}", spread);
            ChartObjects.DrawText("Label", "Spread:", StaticPosition.TopLeft, Colors.Yellow);
            ChartObjects.DrawText("spread", text.PadLeft(12), StaticPosition.TopLeft, Colors.White);
        }
    }
}

If to look where it says: [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)]

if it is true it's on the chart, if it's false it won't be on the chart


@Old Account

Old Account
23 Jan 2014, 09:52

[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)]

 


@Old Account

Old Account
21 Jan 2014, 10:46

RE:

MRSV said:

if (_ExpTime == Server.Time.Hour && !_PosOpend)
        _Counter = 0;
    else
        _Counter = _Counter + 1;

Should be:

if (_ExpTime == Server.Time.Hour && !_PosOpend)
        _Counter = 0;

If(_ExpTime == Server.Time.Hour &&_PosOpend

 I think

if (_ExpTime == Server.Time.Hour && !_PosOpend)
        _Counter = 0;

If(_ExpTime == Server.Time.Hour &&_PosOpend)
_Counter = _Counter + 1;

*


@Old Account

Old Account
21 Jan 2014, 10:44

if (_ExpTime == Server.Time.Hour && !_PosOpend)
        _Counter = 0;
    else
        _Counter = _Counter + 1;

Should be:

if (_ExpTime == Server.Time.Hour && !_PosOpend)
        _Counter = 0;

If(_ExpTime == Server.Time.Hour &&_PosOpend

 I think


@Old Account

Old Account
21 Jan 2014, 09:56

RE:

The if should be if(....)

if (Symbol.Ask == Symbol.Bid)

You think somethin like this would work?

        private int _ExpTime;
        private int _Counter;
        private bool _PosOpend;

        protected override void OnStart()
        {
            Positions.Opened += OnPositionsOpened;
        }

        protected override void OnTick()
        {
            if (Symbol.Ask == Symbol.Bid)
            {
                PlaceStopOrder(TradeType.Sell, Symbol, 1000, Symbol.Ask, "Lable", 10, 10, DateTime.Now.AddHours(2));
                _ExpTime = Server.Time.Hour + 2;
                _PosOpend = false;
            }

            if (_ExpTime == Server.Time.Hour && !_PosOpend)
                _Counter = 0;
            else
                _Counter = _Counter + 1;


        }
        private void OnPositionsOpened(PositionOpenedEventArgs args)
        {
            _PosOpend = true;
        }

 

 


@Old Account

Old Account
21 Jan 2014, 09:51

You think somethin like this would work?

        private int _ExpTime;
        private int _Counter;
        private bool _PosOpend;

        protected override void OnStart()
        {
            Positions.Opened += OnPositionsOpened;
        }

        protected override void OnTick()
        {
            if (Symbol.Ask == Symbol.Bid)
            {
                PlaceStopOrder(TradeType.Sell, Symbol, 1000, Symbol.Ask, "Lable", 10, 10, DateTime.Now.AddHours(2));
                _ExpTime = Server.Time.Hour + 2;
                _PosOpend = false;
            }

            if (_ExpTime == Server.Time.Hour && !_PosOpend)
                _Counter = 0;
            else
                _Counter = _Counter + 1;


        }
        private void OnPositionsOpened(PositionOpenedEventArgs args)
        {
            _PosOpend = true;
        }

 


@Old Account

Old Account
19 Jan 2014, 18:07

Something like this?

 

private int _TradeCount;
        private int _TradeDay;

        protected override void OnStart()
        {
            _TradeCount = 0;
        }

        protected override void OnTick()
        {

            bool _TradeOk = _TradeCount <= 2;

            if (Server.Time.Day == _TradeDay + 1)
                _TradeCount = 0;

            if (......&& _TradeOk)
            {
                _TradeDay = Server.Time.Day;
                ExecuteMarketOrder(TradeType.Buy, Symbol, 1000);
                _TradeCount = _TradeCount + 1;

            }


        }

 


@Old Account

Old Account
18 Jan 2014, 14:43

RE: RE: RE: RE: Delta

oktrader said:

jeex said:

Nope. Robots cannot make decisions. Unless you want to lose money of course. The best robot i've seen so far with the best results, was one that opened trades fully and completely at random and had TP = SL * 4. So no robots for me. At least not when you want to double your balance every month.

I'm not talking about the perfect robot. I don't know if it does exist or not. But humans are like robots: we are not perfect at taking decisions. The only diference is that we can change our strategy while we are trading and a robot always does the same thing. And because the market conditions changes, robots fail.

But you will agree that humans fail for the same reason: because we tend to change too much and we don't follow a strong strategy. 

And here's the paradox: we want to be more like robots, but we want robots to be more like humans.

Sure, random is our enemy. But how can you assure that your pesonal decisions aren't random? Neither robots nor humans can't see the future. The only thing a human could do is to get a strategy and following it without any exceptions. But that's what a robot does. So, I encourage you to code every step, even step 2.

I think jeex is right. I think the dream robot for me would be the one you describe jeex. And when it got to step 2 you would get a image of the chart a option to take the trade or not on you phone. Only problemis that you can't trade when you sleep :/


@Old Account

Old Account
05 Jan 2014, 22:22

Thank you !


@Old Account

Old Account
01 Jan 2014, 15:35

Ok, thanks


@Old Account

Old Account
31 Dec 2013, 17:46

I got it to work when i started the robut using the code below, but I still can get it to work when backtesting, is it not supported?

double y = Symbol.Bid;
ChartObjects.DrawHorizontalLine("hLine", y,         
       Colors.Yellow, 2, LineStyle.Lines);

@Old Account

Old Account
31 Dec 2013, 17:25

Thanks, but I can't get it to work. I tryed plasing it under OnStart() just to test, but nothing happened.

Happy New Year BTW


@Old Account

Old Account
02 Dec 2013, 23:37

RE: RE: RE: RE: Exit strategy

getbuen said:

MRSV said:

I would be happy to help you as much i a can getbuen.

Here is my e-mail : MrSvensli@hotmail.no

thanks my friend 

1 we will use simple movingaverage  period 20

2 macd croosover 

How it works 

When the macdis below  0 and the the macd cross below the signal and the market is below the 20 moving average we sell on the second closing bar

Also we buy if the macd cross above the signal above the 0  we buy in the second green closing bar 

 

the most impotent thing in this strategy is the second closing bar  if the first bar went below the 20 moving average we will wait for the second bar to enter and most likely that bar will be the one to close the profit on  if you are scalper.

if you did not understand this I will try to provide you with pictures :) 

 

sorry for my bad English 

I will try to code it, send me an email, so i get your email. I wil send you the finished code there


@Old Account

Old Account
02 Dec 2013, 23:20

RE: RE: Exit strategy

I would be happy to help you as much i a can getbuen.

Here is my e-mail : MrSvensli@hotmail.no


@Old Account

Old Account
02 Dec 2013, 23:11 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE: RE: Exit strategy

getbuen said:

 

 

Could you share you parameters whit me ?

 


@Old Account

Old Account
02 Dec 2013, 19:50

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.API.Requests;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot()]
    public class MacdBot : Robot
    {
        private MacdHistogram _macd;
        private Position _position;
        private SimpleMovingAverage SMA;

        [Parameter(DefaultValue = 10000, MinValue = 0)]
        public int Volume { get; set; }

        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter("SMA Period", DefaultValue = 20)]
        public int Periods { get; set; }

        [Parameter("Period", DefaultValue = 9)]
        public int Period { get; set; }



        [Parameter("Long Cycle", DefaultValue = 26)]
        public int LongCycle { get; set; }

        [Parameter("Short Cycle", DefaultValue = 12)]
        public int ShortCycle { get; set; }


        protected override void OnStart()
        {
            SMA = Indicators.SimpleMovingAverage(Source, Periods);
            _macd = Indicators.MacdHistogram(LongCycle, ShortCycle, Period);

        }

        protected override void OnBar()
        {
            if (Trade.IsExecuting)
                return;

            bool isLongPositionOpen = _position != null && _position.TradeType == TradeType.Buy;
            bool isShortPositionOpen = _position != null && _position.TradeType == TradeType.Sell;
            if (SMA.Result.LastValue < Symbol.Ask)
                if (_macd.Histogram.LastValue > 0.0 && _macd.Signal.IsRising() && !isLongPositionOpen)
                {
                    ClosePosition();
                    Buy();
                }
            if (SMA.Result.LastValue > Symbol.Ask)
                if (_macd.Histogram.LastValue < 0.0 && _macd.Signal.IsFalling() && !isShortPositionOpen)
                {
                    ClosePosition();
                    Sell();
                }
        }
        private void ClosePosition()
        {
            if (_position != null)
            {
                Trade.Close(_position);
                _position = null;
            }
        }

        private void Buy()
        {
            Trade.CreateBuyMarketOrder(Symbol, Volume);
        }

        private void Sell()
        {
            Trade.CreateSellMarketOrder(Symbol, Volume);
        }

        protected override void OnPositionOpened(Position openedPosition)
        {
            _position = openedPosition;
        }

    }
}

 

Still doesn't seem very profitable


@Old Account

Old Account
02 Dec 2013, 19:30

Add this code

protected override void OnBar()
        {
            Print("Free Margin: {0}", Account.FreeMargin);
        }

 

And check it again


@Old Account

Old Account
30 Nov 2013, 01:03

Could you show a image og your history, so I can see how much money you make?


@Old Account

Old Account
29 Nov 2013, 19:10

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.API.Requests;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC)]
    public class RSIDrop : Robot
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter("Periods", DefaultValue = 14)]
        public int Periods { get; set; }


        private RelativeStrengthIndex rsi;
          
        protected override void OnStart()
        {         
            rsi = Indicators.RelativeStrengthIndex(Source, Periods);
        }

        protected override void OnTick()
        {
                if (rsi.Result.LastValue < 30)
 Trade.CreateSellMarketOrder(Symbol, 10000);

        }
  
        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Here is a simple robot using RSI. If you want to use another indecator change the part after indicators to the indecator you want to use. Remember to add the parameaters the robut use like (source and periods)

If you want to use a indecator you cahe downloaded use Indicators.GetIndicator<// the name of the indecator>(// the parameters the indecator use);
You wil also have to refrense the robot by clicking the Add Refrens butten and finding the idecator you are using.


@Old Account