Programmatically change visibility of output
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.
Replies
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
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
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
@PanagiotisCharalampous
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
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