PDA

View Full Version : GridCategory, design or bug?


zweistein
10-15-2009, 02:57 AM
Hello,

using sampleMACrossover strategy
I changed the Parameters Category from
[GridCategory("Parameters")] to [Category("Parameters")]

from other code I access the Edit Strategy Dialog and I use PropertyGrid.SelectedObject.Parameters.
This is the list of parameters for the strategy and there are 2 , fast and slow.

Using The "GridCategory", 2 parameters are correctly in the list.

Using "Category" however the parameters are listed double, hence I see 4 parameters, 2 with name Fast and 2 with name Slow.

It seems that your code lists the parameters two times, one time for the category "Category" and a second time for a categry "GridCategory" which seems to be generated internally.

Is this expected behaviour?

Andreas

Then in Strategy.Parameters I get

NinjaTrader_Dierk
10-15-2009, 04:14 AM
As per NT7 you only should use "GridCategory" and NOT "Category". Please let us know if there would be an issue by ONLY using "GridCategory". Thanks

Also: Not sure what you mean by "I access the Edit Strategy Dialog and I use PropertyGrid.SelectedObject.Parameters". Unfortunately we are unable to provide support code custom coding outside NinjaScript.

eDanny
10-15-2009, 08:20 AM
I have not seen what the effects are if we do not change this when moving our indicators from v6.5 to v7.

NinjaTrader_Dierk
10-15-2009, 08:33 AM
This is for clarity. Please change your implementation accordingly to make sure you or your users don't experience unwanted effects.

eDanny
10-15-2009, 08:41 AM
Again, there have been no 'unwanted' effects explained to us yet. Could we have a list of what might happen?

NinjaTrader_Dierk
10-15-2009, 08:44 AM
'GridCategory("<WhatEverText>")' explicitely marks the parameters for indicators/strategies. Formerly you had to have 'Category("Parameters")' and nothing else was supported.

-> you now can group your indicator/strategy parameters

eDanny
10-15-2009, 08:47 AM
OK thanks Dierk, this was done for the benefit of Strategies then.

NinjaTrader_Dierk
10-15-2009, 08:52 AM
As well as indicators.

eDanny
10-15-2009, 08:55 AM
So are you saying that although the settings were able to be grouped in indicators before, settings not in the Parameters section were not settable when accessing from another indicator but they are now somehow?

NinjaTrader_Dierk
10-15-2009, 09:01 AM
Here is what I'm saying:
- having anything else than 'Category("Parameters")' in NT6.5 was not supported neither on strategies nor indicators since it had some unwanted effects which you probably haven't been aware off
- I don't have a list of these issues related at hand, but that is irrelevant since they had been there which made us changing the logic
- using NT7 you should replace 'Category' by 'GridCategory'

Hope this ultimately clarifies the issue.

eDanny
10-15-2009, 09:04 AM
Thanks, I didn't know this was not previously supported in indicators since it was done all the time.

zweistein
10-15-2009, 09:46 AM
In my code I replaced

new System.ComponentModel.CategoryAttribute("Parameters")

with
new NinjaTrader.Data.GridCategoryAttribute("Parameters")

not sure yet for the double display, some mistery in the debugging, recompiling, etc. cycle. My debugger was running for several hours without exit, and there was a timing issue with a context menu which needed more time to be populated by Ninja (Edit Strategy) than I expected.