cAlgo Custom Indicators

Created at 18 Dec 2016, 13:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
PE

petra41@bigpond.com

Joined 14.12.2016

cAlgo Custom Indicators
18 Dec 2016, 13:26


HI All,

 

I seem to be stuck, I written a bot to use a custom indicator before.I had to add this reference line. 

//#reference: ..\Indicators\ZigZag.algo

I added private with the Indicator here in the class.

public class ZigZagCycleBot : Robot
    {

       private ZigZag _zigZag;

I added the GetIndicator and paremeters here in the code.

protected override void OnStart()

 {

 _zigZag = Indicators.GetIndicator<ZigZag>(ZzDepth, ZzDeviation, ZzBackStep);

This bot works without any issues, but I got a custom indicator PRC which runs fine on the charts, but when I try this in my code and do back testing it stops after a few days.....I'm not even referening data in the indicator this is all I've done any ideas what would cause that or how I can see the errors the bots generating?

 

Cheers


@petra41@bigpond.com
Replies

... Deleted by UFO ...

petra41@bigpond.com
19 Dec 2016, 10:02

Hi mate, i got it working by adding a bar delay on the bot. I think the indicator needed 120 bars to start or something weird. So I added.

protected override void OnTick()
        {
            if (bcount < 160)
            {
                bcount++;
                return;
            }

Once bcount was over 160 it worked fine.

 

Cheers


@petra41@bigpond.com