There should be three properties visible, mapping to the BarsPeriod properties as:
Brick Size ==> Value
Open Percentage ==> Value2 (Range from 0 to 100)
Reversal Percentage ==> BaseBarsPeriodValue (Range from 100 to int.MaxValue)
NT8 provides a SetPropertyName method to change the display name of the properties, which is helpful, but I also need to adjust the display order of the properties and enforce the range limits.
To achieve this, I wrote the following code in the BarsType:
Well, that code's pretty readable, but obviously, it makes use of some extension methods. I've attached the extension methods in a .cs file to this post.
And ... it works beautifully!!!
BUT ... there's an issue ... my property descriptor changes "stick" when the user switches the data series to another bars type. For example, if the user tries to switch to Minute bars, the "Brick Size", "Open Percentage", and "Reversal Percentage" properties will still be visible when editing minute bars.
Obviously, my code has gone a bit "deeper inside" than intended. That seems like an NT8 bug to me, as I would have expected NT8 to properly refresh the property descriptor collection from scratch when the user changed to a different bars type such as minute bars. But I'm not hung up on getting NT8 changed over this, I just want to be able to set the order and min/max range for the properties.
What is your advise on the matter?
Comment