Replies

cAlgo_Development
07 Jun 2013, 11:39

On your chart daily bars are still aggregated starting from UTC 00:00 (like IC Markets does, we have not changed aggregation rules yet), so each bar starts at 00:00 UTC. There are bars for "31 May Fr" and "2 May Su" (two-hours bar), there is no "1 May Sa" bar.

In your selected timezone (UTC-4) daily bar start time is displayed like 20:00 of previous dat, i.e "31 May Fr" is displayed as "30 May Th 20:00", "2 May Su" bar is displayed as "1 May Sa 20:00" and monday bar is displayed as "2 May Su 20:00". Since there was no "1 May Sa" bar you do not see bar that opens in "31 May Fr 20:00" in you local timezone.


@cAlgo_Development

cAlgo_Development
06 Jun 2013, 17:30

We have investigated this issue and most probable answer is that bars are a bit different because you use live and demo accounts. Theoretically prices are supposed to be the same or very-very close, but on practice prices for different types of accounts are processed on different physical servers. Although server settings are the same sometimes prices can differ. If you try to use the same account type (do not switch, or completly refresh charts after you switched account) prices will be the same.


@cAlgo_Development

cAlgo_Development
06 Jun 2013, 17:12

Before the update all times and dates was in broker's server time. After the update all dates and times are presented in UTC. So you should change your indicator: convert time from UTC to needed timezone, instead of converting it from your broker's (Cyprus) timezone.


@cAlgo_Development

cAlgo_Development
04 Jun 2013, 09:32

Can you tell us the name of broker, exact symbol and bar time where such diiference appears.


@cAlgo_Development

cAlgo_Development
03 Jun 2013, 15:46

If you move to UTC time instead of the week starting on monday it will start on Sunday @21:00 then create a new day in 2 hours.  So it will look like there is 6 trading days instead of 5!  This screws up volume and Daily candles because you get one day at the start of the week that is bogus.

For the forex symbols daily bars will start at 17:00 New York time when Forex market is open. For all brokers this time will be the same. So there will be five complete dailty bars.


@cAlgo_Development

cAlgo_Development
31 May 2013, 18:00

Platform reconnects automatically in a several seconds after disconnection, but we will test all cases one more time.

For now it's not possible to access connection events from robots.


@cAlgo_Development

cAlgo_Development
31 May 2013, 17:34

 

Is this feature already released? Can you please post a video on how to adjust time?

 

This feature will be released next week.


@cAlgo_Development

cAlgo_Development
29 May 2013, 09:35

OK, we got it. Than you for this feedback. We'll discuss what to do with daily trend-bar aggregation. This decision will affect only second stage of migration, next release we will migrate to UTC time but aggregation periods will stay the same.


@cAlgo_Development

cAlgo_Development
28 May 2013, 09:21

Thank you for the feedback. We will change backtesting options window to avoid such misunderstandings.


@cAlgo_Development

cAlgo_Development
23 May 2013, 12:20

This is very strange. I have several questions:

 

Does issue appear in backtesting or on a live chart?

Do you use cAlgo and cTrader of the same broker?


@cAlgo_Development

cAlgo_Development
23 May 2013, 12:14

Thanks, but where do you suggest to use this ccolor? On a chart?

We do not plan to implement something like this in the nearest future,


@cAlgo_Development

cAlgo_Development
23 May 2013, 12:12

No, it's not possible and we do not plan such feature right now.


@cAlgo_Development

cAlgo_Development
20 May 2013, 17:18

We've found the bug. The problem is that leading spaces are ignored when we align text now. It will be fixed in the next release. Temporary solution you can apply without dramatic changes in your indicator is following:

Add point or another small symbol to the end to get string like "London                              ." instead of "London                              ", this is not so nice but it works:

 

        string strLondonLabel = string.Format("{0,-60}.", "London");
        string strNYLabel = string.Format("{0,-20}.", "NY");
        string strSydneyLabel = string.Format(".{0,25}", "Sydney");
        string strTokyoLabel = string.Format(".{0,60}", "Tokyo");
        
        string format = paramFormat24HR == 1 ? "H:mm" : "h:mmtt";
      
        string strLondonTime = string.Format("\n{0,-60}.", LondonTime.ToString(format));
        string strNYTime = string.Format("\n{0,-25}.", NYTime.ToString(format));
        string strSydneyTime = string.Format("\n.{0,25}", SydneyTime.ToString(format));
        string strTokyoTime = string.Format("\n.{0,60}", TokyoTime.ToString(format)); 




@cAlgo_Development

cAlgo_Development
17 May 2013, 11:46

We will consider this change, but not now. Right now client application does not have data on closing order commisions. Server just do not send it. Morover, broker can change commisions or some other settings while your trade is open.


@cAlgo_Development

cAlgo_Development
14 May 2013, 16:11

Indicator drawing trend-lines automatically using specified period (minimum distance between high and low extremums):

 

Source code:

using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true)]
    public class TrendLines : Indicator
    {
    	[Parameter(DefaultValue = 30, MinValue = 1)]
        public int Period { get; set; }	
    
        protected override void Initialize()
        {
            RedrawLines();
        }
    
        public override void Calculate(int index)
        {
            if (IsRealTime)
                RedrawLines();
        }
        
        private void RedrawLines()
        {
            int count = MarketSeries.Close.Count;
        
            int maxIndex1 = FindNextLocalExtremum(MarketSeries.High, count - 1, true);
            int maxIndex2 = FindNextLocalExtremum(MarketSeries.High, maxIndex1 - Period, true);
        	
            int minIndex1 = FindNextLocalExtremum(MarketSeries.Low, count - 1, false);
            int minIndex2 = FindNextLocalExtremum(MarketSeries.Low, minIndex1 - Period, false);
            
            int startIndex = Math.Min(maxIndex2, minIndex2) - 100;
            int endIndex = count + 100;
            
            DrawTrendLine("high", startIndex, endIndex, maxIndex1, MarketSeries.High[maxIndex1], 
                maxIndex2, MarketSeries.High[maxIndex2]);

            DrawTrendLine("low", startIndex, endIndex, minIndex1, MarketSeries.Low[minIndex1], 
                minIndex2, MarketSeries.Low[minIndex2]);
        }
        
        private void DrawTrendLine(string lineName, int startIndex, 
            int endIndex, int index1, double value1, int index2, double value2)
        {
            double gradient = (value2 - value1) / (index2 - index1);
            
            double startValue = value1 + (startIndex - index1) * gradient;
            double endValue = value1 + (endIndex - index1) * gradient;
            
            ChartObjects.DrawLine(lineName, startIndex, startValue, endIndex, endValue, Colors.Gray);
            ChartObjects.DrawLine(lineName+"_red", index1, value1, index2, value2, Colors.Red);
        }
        
        private int FindNextLocalExtremum(DataSeries series, int maxIndex, bool findMax)
        {
            for (int index = maxIndex; index >= 0; index --)
            {
                if (IsLocalExtremum(series, index, findMax))
                {
                    return index;
                }
            }
            return 0;
        }
        
        private bool IsLocalExtremum(DataSeries series, int index, bool findMax)
        {	
        	int end = Math.Min(index + Period, series.Count - 1);
        	int start = Math.Max(index - Period, 0);
        	
        	double value = series[index];
        
        	for (int i = start; i < end; i++)
        	{
        		if (findMax && value < series[i])
        			return false;
        			
    			if (!findMax && value > series[i])
        			return false;
        	}
        	return true;
        }
    }
}

@cAlgo_Development

cAlgo_Development
10 May 2013, 12:34

Thank you for the suggestions

We will release an ability to draw lines from robots and indicators next release, but these lines will not be adjustable by user. Only robot / indicator created the line can change it.


Interacting with trader using chart objects and hot keys is very nice idea. We will consider implementing it in future. We also plan to introduce an ability to run robots (scripts) in cTrader.


@cAlgo_Development

cAlgo_Development
08 May 2013, 17:46

Right now it's impossible to do this. The only solution is not to run robots / indicators with infinite loops.


@cAlgo_Development

cAlgo_Development
30 Apr 2013, 16:53

Right now such painting is not supported in cAlgo. The only way you can color series like this is to use PlotType.Points or PlotType.Histogram. Try this in your example:

 

[Output("Dn", Color = Colors.Magenta, PlotType = PlotType.Points)]


You will get points colored correctly. You can also draw line and that draw points on top of it to indicate up or down trend.


@cAlgo_Development

cAlgo_Development
30 Apr 2013, 13:01

For now this is not supported, but we will implement it in the nearest future.


@cAlgo_Development

cAlgo_Development
30 Apr 2013, 13:00

Thank you. We will think about it.


@cAlgo_Development