Using downloaded indicator
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
Replies
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
Old Account
28 Nov 2013, 21:19
RE:
To add a downloaded indicator to your cTrader platform, follow the steps below:
The Indicator will now be available in your cTrader platform.
@Old Account