Replies

PanagiotisCharalampous
21 Sep 2017, 09:37

Hi hungtonydang,

A NullReferenceException makes me suspect that it is something in the code. Can you post some code, at least the part where the exception is thrown so that we can try to guess what the problem might be? Else, we will need the source code and starting parameters for both cBots to try to reproduce the exception.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2017, 09:31

Hi hungtonydang,

MarketSeries.Close.Last() will return a value using the index passed as parameter and counting backwards. For example

MarketSeries.Close.Last(0)

will return the last value of the series and the following

MarketSeries.Close.Last(1)

will return the penultimate value.

On the other hand GetIndexByExactTime() uses forward counting, meaning that 

indexSeries2.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime.LastValue);

will return an index based on the number of values loaded on the chart e.g. 6213. You can verify this if you print the value in the Log using the Print() function.

If you want to combine the two functions, you can try something like the following

 MarketSeries.Close.Last(MarketSeries.OpenTime.Count - (MarketSeries.OpenTime.GetIndexByExactTime(MarketSeries.OpenTime.LastValue) + 1));

I hope the above clarifies the situation for you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Sep 2017, 16:37

Hi ogima.515@gmail.com,

The Supertrend indicator has not been added yet to cTrader Desktop Indicators. You can find a supertrend indicator provided by the community here

/algos/indicators/show/136

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Sep 2017, 10:37

Hi irmscher9,

In the HasCrossedAbove() function you should pass as parameter _rsi.Result and not _rsi.Result.Value. See example below

        protected override void OnTick()
        {
            if (_ema17rsi.Result.HasCrossedAbove(_rsi.Result, 0))
            {             
            }
        }

Let me know if this is what you are looking for

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Sep 2017, 09:47

Hi hungtonydang,

It is possible to run more than two cBots on the same symbol. The crash you experience is probably related to the cBot itself. When you run two cBots on the same account, you should be very careful so that the one does not interfere with the activities of the other.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
20 Sep 2017, 09:41

Hi danblackadder,

In order to see the DoM, you need to right click on the symbol in MarketWatch and then click on "i Information". Let me know if this is what you are looking for.

Best Regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
06 Mar 2017, 14:47

Symbol name is the same but in such cases you will need to encode your url https://www.w3schools.com/tags/ref_urlencode.asp

In this case # should become %23


@PanagiotisCharalampous