protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = Custom.Resource.NinjaScriptBarsTypeSTRType3D;
BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 14, BarsPeriodTypeName = "STR SBars(14)", Value = 1 };
BuiltFrom = BarsPeriodType.Tick;
DaysToLoad = 10;
IsIntraday = true;
}
else if (State == State.Configure)
{
Name = string.Format(Core.Globals.GeneralOptions.CurrentC ulture, Custom.Resource.DataBarsTypeSTRType3D, BarsPeriod.Value, (BarsPeriod.MarketDataType != MarketDataType.Last ? string.Format(" - {0}", Core.Globals.ToLocalizedObject(BarsPeriod.MarketDa taType, Core.Globals.GeneralOptions.CurrentUICulture)) : string.Empty));
Properties.Remove(Properties.Find("BasePeriodType" ,true));
Properties.Remove(Properties.Find("PointAndFigureP riceType",true));
Properties.Remove(Properties.Find("ReversalType",t rue));
SetPropertyName("Value", Custom.Resource.NinjaScriptBarsTypSTRTypeBias);
SetPropertyName("Value2", Custom.Resource.NinjaScriptBarsTypeSTRTypeCuttingE dge);
SetPropertyName("BaseBarsPeriodValue", Custom.Resource.NinjaScriptBarsTypeSTRTypeHarmoniz er);
}
}
Suppose If I use 15 or another number, the code compile but then I have an unhandled exception. Why this..? and what is the maximum BarsPeriodType value.. below is the code
BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 15, BarsPeriodTypeName = "STR SBars(15)", Value = 1 };
and also how can i remove "Base Period Type = Tick" from the Bar type DataSeries user Input screen ? (see the screen shot) .I am not required this input on this Bar Type.(from the above code)
Comment