Using downloaded indicator

Created at 28 Nov 2013, 21:04
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!
SZ

szpejo

Joined 28.11.2013

Using downloaded indicator
28 Nov 2013, 21:04


Hello everyone,

I have a problem with implementing downloaded indicator in to my robot.
I tried many ways, but none results. 
I would be thankful if anyone could tell me what should I do step by step to use downloaded Indicator in my Robot in Calgo.

regards


@szpejo
Replies

Old Account
28 Nov 2013, 21:19

RE:

To add a downloaded indicator to your cTrader platform, follow the steps below:

 

  1. Download or move the Indicator to My Documents > cAlgo > Sources > Indicators.
  2. Open the cAlgo platform. If you don't already have it, you can download cAlgo from your broker's website (or download here if you're just using the demo fromSpotware.com)
  3. Click on the Indicators tab from the Robots/Indicators menu on the left.
  4. Find the Indicator you want to use.
  5. Click the Build icon Build. If the build is successful, the icon appearance will change to Successful build

 

The Indicator will now be available in your cTrader platform.


@Old Account

szpejo
28 Nov 2013, 21:26

Thanks,
but I want to know how to include it to CALGO robot.


@szpejo

Hyperloop
28 Nov 2013, 22:16

There are sample robots when you download cAlgo, there is a robot that uses a custom indicator. You can just look at that.


@Hyperloop

Old Account
29 Nov 2013, 19:10

// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Robot. 
//
// -------------------------------------------------------------------------------

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.API.Requests;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC)]
    public class RSIDrop : Robot
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter("Periods", DefaultValue = 14)]
        public int Periods { get; set; }


        private RelativeStrengthIndex rsi;
          
        protected override void OnStart()
        {         
            rsi = Indicators.RelativeStrengthIndex(Source, Periods);
        }

        protected override void OnTick()
        {
                if (rsi.Result.LastValue < 30)
 Trade.CreateSellMarketOrder(Symbol, 10000);

        }
  
        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Here is a simple robot using RSI. If you want to use another indecator change the part after indicators to the indecator you want to use. Remember to add the parameaters the robut use like (source and periods)

If you want to use a indecator you cahe downloaded use Indicators.GetIndicator<// the name of the indecator>(// the parameters the indecator use);
You wil also have to refrense the robot by clicking the Add Refrens butten and finding the idecator you are using.


@Old Account