Topics
16 Nov 2023, 07:42
 1104
 1
15 Nov 2023, 10:36
 1979
 16
Replies

Spotware
03 Jul 2014, 11:46

Now you can implement by using the Timer object:

http://www.spotware.com/about/news-updates/ctrader-and-calgo-updates---july-2014/637


@Spotware

Spotware
03 Jul 2014, 11:40

Market Snapshot is a state of Market Depth at the moment of matching. It looks like your buy stop order (173.760) was triggered when price was 173.841, but when it was filled price was 173.891.


@Spotware

Spotware
03 Jul 2014, 09:15 ( Updated at: 21 Dec 2023, 09:20 )

The problem is that you use LastValue property of SenkouSpanA and SenkouSpanB dataseries. The difference between last value and current value is shown on this image:

You can use the following code snippet to access current values:


        protected override void OnTick()
        {
            var index = MarketSeries.Close.Count - 1;
            Print("Span A: ", ichimoku.SenkouSpanA[index]);
            Print("Span B: ", ichimoku.SenkouSpanB[index]);
        }

 


@Spotware

Spotware
03 Jul 2014, 08:58

cAlgo code snippet to access values of ZigZag indicator has been posted there:

/forum/cbot-support/3089?page=1#4


@Spotware

Spotware
03 Jul 2014, 08:56

Please have a look at the following code snippet:

        ZigZag zigzag;

        protected override void OnStart()
        {
            zigzag = Indicators.GetIndicator<ZigZag>(12, 5, 3);
        }

        double GetZigZagValue(DataSeries dataSeries, int indexFromEnd)
        {
            for (var i = MarketSeries.Close.Count - 1; i >= 0; i--)
            {
                if (!double.IsNaN(zigzag.Result[i]))
                {
                    if (indexFromEnd == 0)
                        return zigzag.Result[i];
                    indexFromEnd--;
                }
            }
            return double.NaN;
        }

        protected override void OnTick()
        {
            var lastValue = GetZigZagValue(zigzag.Result, 0);
            var previousValue = GetZigZagValue(zigzag.Result, 1);

            if (lastValue > previousValue)
                Print("lastValue {0} > previousValue {1}", lastValue, previousValue);
            if (lastValue < previousValue)
                Print("lastValue {0} < previousValue {1}", lastValue, previousValue);
        }

 


@Spotware

Spotware
02 Jul 2014, 14:51

Trade.IsExecuting doesn't work with new trading API since it was released:

/forum/whats-new/1937 (22 Nov 2013).

 Why do you want to check it? Do you use asynchronous trade methods? 


@Spotware

Spotware
02 Jul 2014, 14:46 ( Updated at: 21 Dec 2023, 09:20 )

You can turn off notifications in Preferences menu:


@Spotware

Spotware
02 Jul 2014, 10:22

First of all, value which you assign to the _prevValue field cannot be considered as a previous value of ZigZag. It is a last value calculated on the previous tick.

Second of all, ZigZag indicator doesn't write values to every index. Therefore in order to retrieve value which you selected on the image, you need to iterate through _zigZag.Result DataSeries and find a value which is not double.NaN.


@Spotware

Spotware
02 Jul 2014, 10:13

Regarding to our tests IchimokuKinkoHyo indicator provides correct values. Please post the code that you use to access indicator values. Probably you have a mistake in indices calculation.


@Spotware

Spotware
02 Jul 2014, 09:34

We plan to add such functionality. Additionally you can post this idea to vote.spotware.com.  


@Spotware

Spotware
01 Jul 2014, 12:39

There is no such ability in the API. You can post an idea to vote.spotware.com.


@Spotware

Spotware
30 Jun 2014, 09:07

Thank you for your idea. We will consider it. Additionally, you can post your idea to vote.spotware.com.


@Spotware

Spotware
29 Jun 2014, 13:19 ( Updated at: 21 Dec 2023, 09:20 )

I created an indicator, run it and it crashed. probably i did something wrong in the code. no doubt.

then i opened calgo again and the indicator was still running and calgo crashed again.

now i am in a crashing loop and cannot do anything cause there is no enough time to close the indicator.

tried emptying folder then starting calgo which had reset all my indicators but thats not a solution doing it every time this happens.

what do i do?

Please send the indicator that crashes cAlgo to engage@spotware.com. We will investigate the problem.

also another thing: i want to include like 10 dlls and they have to be added one by one. why? whats wrong with multiple file selection. 

We will allow multiple selection in next releases. 

finally: an annoying bug in the editor. i'm used to have comments inside methods like

but when i add them and compile or save, calgo moves them either up or down. please check it.

We will look into it. As a temporary solution you can switch off the Auto format option.

 

 


@Spotware

Spotware
25 Jun 2014, 09:17

Probably you are running your cBot in backtester. Backtester doesn't support multisymbol cBots and Indicators.


@Spotware

Spotware
25 Jun 2014, 08:58

There is no difference in execution speed between cTrader and cAlgo. We don't have any of those functions (IsConnected(), IsTradeContextBusy(), IsTradeAllowed()).


@Spotware

Spotware
24 Jun 2014, 15:12

Regarding to our logs execution time of that order was 277 ms. Probably 15 seconds was random network or VPS delay. Can you reproduce this issue?


@Spotware

Spotware
24 Jun 2014, 09:17

You need to obtain instance of market series object and pass it as first parameter to GetIndicator method:

            var anotherSeries = MarketData.GetSeries("EURGBP", TimeFrame.Minute20);
            alligator = Indicators.GetIndicator<SampleAlligator>(anotherSeries, 13, 8, 8, 5, 5, 3);

 


@Spotware