Topics
16 Nov 2023, 07:42
 1129
 1
15 Nov 2023, 10:36
 2013
 16
Replies

Spotware
11 Nov 2013, 15:23

We've implemented new property in both Robot and Indicator classes: TimeZone. Instead of getting timezone from attribute you can use it;

        protected override void OnStart()
        {
            Print("RobotTimeZone Setting: {0}", TimeZone);
            Print("RobotTimeZone Name: {0}", TimeZone.DisplayName);
            Print("Offset: {0}", TimeZone.BaseUtcOffset);
            Print("DST: {0}", TimeZone.SupportsDaylightSavingTime);
        }

Moreover, in nested indicators that inherit timezone from robot TimeZone property returns actual inherited timezone.

Please check new release of Spotware cAlgo (1.12).


@Spotware

Spotware
11 Nov 2013, 15:22

We've implemented new property in both Robot and Indicator classes: TimeZone. Instead of getting timezone from attribute you can use it;

        protected override void OnStart()
        {
            Print("RobotTimeZone Setting: {0}", TimeZone);
            Print("RobotTimeZone Name: {0}", TimeZone.DisplayName);
            Print("Offset: {0}", TimeZone.BaseUtcOffset);
            Print("DST: {0}", TimeZone.SupportsDaylightSavingTime);
        }

Moreover, in nested indicators that inherit timezone from robot TimeZone property returns actual inherited timezone.

Please check new release of Spotware cAlgo (1.12).


@Spotware

Spotware
11 Nov 2013, 15:04

The ability to access Account object and its positions from indicators is implemented. Please check new release of Spotware cAlgo (1.12).


@Spotware

Spotware
11 Nov 2013, 15:04

The ability to access Account object and its positions from indicators is implemented. Please check new release of Spotware cAlgo (1.12).


@Spotware

Spotware
11 Nov 2013, 14:59

Fixed. Please check our Spotware build.


@Spotware

Spotware
08 Nov 2013, 11:36

One more question: Do you use separate threads or timers in your robots in indicators?


@Spotware

Spotware
07 Nov 2013, 17:40

Can you please tell us what exactly happens? 


@Spotware

Spotware
07 Nov 2013, 17:25

Partial Close is currently under implementation.


@Spotware

Spotware
07 Nov 2013, 17:22

This feature is in our plans to implement. 


@Spotware

Spotware
07 Nov 2013, 17:04

Persisting of states of an instance may be implemented in the future.


@Spotware

Spotware
06 Nov 2013, 09:10

Could you explain in details why exactly it needs to be restarted?


@Spotware

Spotware
05 Nov 2013, 17:04

If this is correct:

  • Call the method DrawText once, when the targetlevel1 is set to true
  • Set the targetlevel1 to true if it is false and equity >= Target1 
  • Do not reset targetlevel1  back to false if the equity falls below the Target1. 

Then the code should be:

if (!targetlevel1 && Account.Equity >= Target1)
{
    targetlevel1 = true;
    ChartObjects.DrawText("objectName", " Level reached: {0}" + levelreached, StaticPosition.TopLeft, Colors.Red);
}

 


@Spotware

Spotware
05 Nov 2013, 16:44

We are looking into supporting more timeframes. 

thanks


@Spotware

Spotware
05 Nov 2013, 16:44

We are looking into supporting more timeframes. 

thanks


@Spotware

Spotware
04 Nov 2013, 17:37

Right now text is drawn on top of trend bars. Is it correct that sometimes you want to draw text behind trend bars?


@Spotware

Spotware
04 Nov 2013, 17:13

RE:

bp2012 said:

Please see the code below. It seems that Notifications.PlaySound does not work if called within the initialize method. However uncommenting the code in the Calculate method results in a sound every tick. 

A recurring pattern in some of my indicators is to paint during the initialize phase and then repaint every x minutes or bars. If alert criteria is met during that first paint inside the initialize method, the notification sound does not play.

In Indicators it is only possible to call this method from the Calculate method.


@Spotware

Spotware
04 Nov 2013, 16:33

Since brokers have different liquidity providers, execution time depends on the broker as well as the symbol you trade.
In order to get information on execution delays on the LP side, you need to contact your broker.


@Spotware

Spotware
04 Nov 2013, 12:23

The property Count of any series is the total number of elements contained in it. Since series are zero based (the first index is zero), the last element index is Count - 1.
For example, series.High.Count - 1 is the last (current) index of the series. So, you do not need the GetIndexByDate method to get the last index of any series. Dido for the second to last index, that will be series.High.Count - 2.

To find the first bar of the previous day index you can use code similar to this:

        private int GetFirstIndexOfPrevousDay(MarketSeries series)
        {
            var previousDay = Server.Time.AddDays(-1).Date;

            for (int i = 0; i < series.High.Count - 1; i++)
                if ( series.OpenTime[i].Date == previousDay)
                    return i;
            return -1;
        }

Similarly you can code the last bar of the previous day:

        private int GetFirstPrevousDayIndex(MarketSeries series)
        {
            var previousDay = Server.Time.AddDays(-1).Date;

            for (int i = series.High.Count - 1; i > 0; i--)
                if ( series.OpenTime[i].Date == previousDay)
                    return i;
            return -1;
        }

 

Question 2

The method returns -1 if the series does not contain the OpenTime parameter. 


@Spotware

Spotware
04 Nov 2013, 11:14

Thank you for the suggestion. We included this to our list of features to be added in cAlgo.


@Spotware

Spotware
04 Nov 2013, 10:31

We plan to implement automated optimization in the future. Thank you for the suggestion.


@Spotware