Topics
05 Dec 2012, 10:51
 5010
 6
30 Nov 2012, 16:19
 3033
 2
22 Oct 2012, 15:56
 3082
 5
Replies

adaled
30 Jan 2014, 15:26

look into the WebRequest Class http://msdn.microsoft.com/en-us/library/system.net.webrequest(v=vs.110).aspx


@adaled

adaled
27 Jan 2014, 12:22

remove these lines also:

xClose = CreateDataSeries();
xHigh = CreateDataSeries();
xLow = CreateDataSeries();
xOpen = CreateDataSeries();

 


@adaled

adaled
27 Jan 2014, 09:36

They need to be output:

e.g.

        [Output("xClose")]
        public IndicatorDataSeries xClose { get; set; }

etc.


@adaled

adaled
24 Jan 2014, 14:37

I think it's probably the indicator. Post the code of that.


@adaled

adaled
16 Jan 2014, 10:16

RE: RE:

raulbeni said:

Spotware said:

Custom Fibonacci levels are currently under implementation.

 

When will be this implemented? 1 week, 1 month, 1 year?

http://www.youtube.com/watch?v=xOs6zu35ifQ&feature=youtu.be


@adaled

adaled
16 Jan 2014, 09:40

RE:

citikot said:

Why not simply to connect desktop application to the cloud as web cTrader does? I don't think it's too difficult technically. There is at least one trading application which connects desktop to cloud with all templates, files and workspaces. It's realy really convenient!

They are adding workspaces to cTrader: /forum/suggestions/1967


@adaled

adaled
19 Dec 2013, 16:28

I found this: http://www.greattradingsystems.com/Get+News+FF-metatraderindicator

see of 2calgo.com converts it or anyone else.

Otherwise check back on the indicators here, I'll try. It looks like a good one.


@adaled

adaled
18 Dec 2013, 10:40

Yes you are right. I'm going to check it. What middle points? 


@adaled

adaled
17 Dec 2013, 09:43

RE:

armando_archundia said:

I can't see the s3 and r3, and i like to add the middle points. I'll appreciate the help Tank you very much in advance.

This only works for less than H12 timeframe. Is that the reason?


@adaled

adaled
13 Dec 2013, 16:47

You can read and write to/from files using c#. Do you need help with reading and writing to files?


@adaled

adaled
13 Dec 2013, 16:39

Hi you can start with this

 

using cAlgo.API;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC)]
    public class StarterRobot : Robot
    {
        [Parameter(DefaultValue = 50.0)]
        public double PipsDistance { get; set; }

        [Parameter(DefaultValue = true)]
        public bool TradeTypeBuy { get; set; }

        [Parameter(DefaultValue = "111")]
        public string Label { get; set; }

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

        [Parameter(DefaultValue = 100)]
        public double StopLossPips { get; set; }

        protected TradeType TradeType
        {
            get { return TradeTypeBuy ? TradeType.Buy : TradeType.Sell; }
        }

        protected override void OnStart()
        {
            // Put your initialization logic here
            var result = ExecuteMarketOrder(TradeType, Symbol, Volume, Label, StopLossPips, null);
            if (!result.IsSuccessful)
            {
                Print("Error {0} Stopping Robot", result.Error);
                Stop();
            }
        }

        protected override void OnTick()
        {
            // Put your core logic here
            var positions = Positions.FindAll(Label, Symbol, TradeType);
            if (positions.Length == 0)
                return;

            var position = positions[positions.Length - 1];
            if ((position.TradeType == TradeType.Buy && Symbol.Bid - position.EntryPrice >= PipsDistance * Symbol.PipSize)
                || (position.TradeType == TradeType.Sell && position.EntryPrice - Symbol.Ask >= PipsDistance * Symbol.PipSize))
            {
                TradeResult result = ExecuteMarketOrder(TradeType, Symbol, Volume, Label, StopLossPips, null);
                if (!result.IsSuccessful)
                {
                    Print("Error {0} Stopping Robot", result.Error);
                    Stop();
                }
            }
        }

    }
}

 


@adaled

adaled
05 Dec 2013, 09:33

You have to remove the for (int i = 0; i > 1; i--). It doesn't have any meaning, it is formulated wrong. Maybe read a little tutorial on programming.

The foreach statement is a loop. It will go through all elements in the list. You don't need another loop inside that.

Also, the if(Account.Equity >=0) doesn't make sense to be inside the foreach loop, since it will be the same in each iteration. it should be outside to reduce extra steps.

 


@adaled

adaled
06 Nov 2013, 17:42

Maybe this helps for the first request: /forum/calgo-reference-samples/499

Check the forum there should be more code examples.

ten losing trades that the same robot opened? You can use the OnPositionClosed method increase a global variable if the position has a loss and decrease it otherwise. If that variable reaches 10 it means there were 10 consecutive losses. then call the method Stop();

        protected override void OnPositionClosed(Position position)
        {
            if (position.GrossProfit < position.Commissions)
                _loss++;
            else
                _loss--;

            if(_loss == 10)
                Stop();
        }

 


@adaled

adaled
04 Nov 2013, 17:40

RE:

adaled said:

Hello,

I would like to apply List methods, like FindIndex, to the MarketSeries.OpenTime for example. Is it possible?

I tried to do a cast and it didn't work.

Thanks.

Sorry, I meant IEnumerable like this:

  var openTimes = new List<DateTime>((IEnumerable<DateTime>) series.OpenTime);

 


@adaled

adaled
03 Oct 2013, 16:10

RE:

We do need more robots. Can you propose a strategy and see if anyone is willing to code it? Robots uploaded are usually the collaborative work of this community. 

Mocean said:

3 months....still waiting?

How much longer?

ZZZzzzzzz - back to MT4 for another 6 months.

Since I was last checking on your progress 6 months ago there have been practically no more Robots added on this site. I think you are losing the "new toy" momentum as traders get frustrated by your prolonged roll-out and development.

Surely you would have thought about these important features for traders 18months ago!

 


@adaled

adaled
09 Sep 2013, 11:57

RE:

sim_trader said:

I want to get the value of the zigzag indicator for X bars ago, where X is an external integer.

var lastValue = _zigZag.Result.Result[index - backstep_bars];
 


@adaled

adaled
06 Aug 2013, 14:33

RE:
Lgon said:

Hello,

I need to calculate a pivot but using a close time of 5pm EST (NY "close"). Is it possible? 

Can someone help with some base code?

Thanks

You can set the timezone to EST.

 [Indicator(IsOverlay = false, TimeZone = TimeZones.EasternStandardTime)]




@adaled

adaled
19 Jul 2013, 14:37

What is it that you are trying to accomplish? Drawing Lines is easy with cAlgo.
Furthermore you can declare enum types with c#, e.g.

private enum MyLineStyles
{
    HorizontalLine,
    VerticalLine
}




@adaled