Programmatically change visibility of output

Created at 09 Nov 2020, 09:54
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!
lec0456's avatar

lec0456

Joined 14.11.2012

Programmatically change visibility of output
09 Nov 2020, 09:54


Is there a way to change the visibility of an output? it can be done through the interface but i don't see how to do it otherwise. See below.


@lec0456
Replies

PanagiotisCharalampous
09 Nov 2020, 10:15

Hi lec0456,

If you mean to uncheck the box from the code, then no this is not possible. You can program such behavior yourself using custom parameters.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

lec0456
09 Nov 2020, 20:27

RE:

PanagiotisCharalampous said:

Hi lec0456,

If you mean to uncheck the box from the code, then no this is not possible. You can program such behavior yourself using custom parameters.

Best Regards,

Panagiotis 

Join us on Telegram

Custom Parameters?  How so? The parameter looks like this:

        [Output("LstPkMo", PlotType = PlotType.Histogram, Thickness = 1, LineColor = "Purple")]
        public IndicatorDataSeries LstPkMo { get; set; }

is there an output attribute I can set like visibility? or disabled? Or can I refer to the chart object in some way?  Maybe you can provide an example of using a custom parameter? Thanks

 

 

 


@lec0456

lec0456
09 Nov 2020, 20:39

RE:

PanagiotisCharalampous said:

Hi lec0456,

If you mean to uncheck the box from the code, then no this is not possible. You can program such behavior yourself using custom parameters.

Best Regards,

Panagiotis 

Join us on Telegram

Also, it doesn't appear from a search that the forum has much info about custom parameters. See here:

 


@lec0456

PanagiotisCharalampous
10 Nov 2020, 08:19

Hi lec0456,

What I meant is to have a boolean parameter and use it to determine if these data series will be assigned values

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = true)]
        public bool ShowResult { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }


        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            if (ShowResult)
                Result[index] = 1;
        }
    }
}

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

lec0456
13 Nov 2020, 03:51

RE:

Ah, ok, didn't think of that. But wasn't sure if I needed a workaround of if it could be done by setting an attribute

 


@lec0456

Shares4UsDevelopment
13 Nov 2020, 08:14

RE: RE:

and if you want to fill the result but not display it, set the color to transparent. ("00000000")

 

 


@Shares4UsDevelopment