Importing Ichimoku for a bot

Created at 03 Nov 2017, 01:10
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!
KH

khan_tu

Joined 03.11.2017

Importing Ichimoku for a bot
03 Nov 2017, 01:10


Good day

I have been trying to design an algorithm using the built in Ichimoku indicator but have so far been unable to

I have very little programming expirience, and i cant figure out how to import the indicator into the cbot,

i just want to import it, and using its outputs to go long or short a position

basically 

long when tenken sen crosses above kujen sen and price above kumo cloud and chikou span > kumo cloud
short when tenken sen crosses below kujen sen above kumo cloud  and  chikou span < kumo cloud
ignore when price inside cloud

 


@khan_tu
Replies

PanagiotisCharalampous
03 Nov 2017, 09:11

Hi khan_tu,

Thanks for posting in our forum. You can find how to reference a custom indicator in your cBot here. Let me know if this helps you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

khan_tu
03 Nov 2017, 19:19

Thank you

I seem to be having another problem, the indicator doesnt show up in the list of custom indicators

i can overlay it on a graph and i can call it when programming but i cant reference it in the indicators page of reference manager


@khan_tu

PanagiotisCharalampous
04 Nov 2017, 09:33

Hi khan_tu,

I cannot see any problem in the process of referencing a custom indicator. Could you please send some more information to reproduce the error e.g. the code of the custom indicator, some screenshots etc?

Best Regards,

Panagiotis 


@PanagiotisCharalampous

khan_tu
05 Nov 2017, 23:40 ( Updated at: 21 Dec 2023, 09:20 )

what i mean is that it doesnt show up in the reference manager


@khan_tu

khan_tu
05 Nov 2017, 23:43

im thinking itd be easier just to manually put in the logic needed for the indicator and going from there instead of importing it


@khan_tu

PanagiotisCharalampous
06 Nov 2017, 09:07

Hi khan_tu,

Apologies, I just noticed that you needed an in-build indicator. In the case of in-build indicators, you do not need to reference them. You can access them directly from the API. See below a code sample

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Price { get; set; }

        protected override void OnStart()
        {

        }

        protected override void OnTick()
        {
           var ichimokuInd = Indicators.IchimokuKinkoHyo(9, 26, 52);
        }

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

Best Regards,

Panagiotis


@PanagiotisCharalampous