![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2010
Posts: 125
Thanks: 18
Thanked 3 times in 3 posts
|
Hi there
I added a bool method to Parameters in my UserDefinedMethods.cs file. private bool iShowOnly = false; [Description("")] [GridCategory("Parameters")] publicbool ShowOnly { get { return iShowOnly; } set { iShowOnly = value; } } Since UserDefinedMethods.cs is public it shows in Parameters for all indicators. I only want to use it with a couple of indicators not all of them. Is there a way to restrict to which ones? Btw - I can't put the code just in the indicators I need because the methods I use are coded and referenced in the UserDefinedMethods.cs file... Thx Irvin |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
|
Are you wanting this bool to show up on the parameters grid of only some indicators not others?
Or are you just wanting some indicators to have the ability to access this bool?
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2010
Posts: 125
Thanks: 18
Thanked 3 times in 3 posts
|
The former ... Some indicators.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,770
Thanks: 158
Thanked 562 times in 553 posts
|
Unfortunately i'm not aware of away to only have these public defined parameters show up on only some indicators grid.
The only thing you would be able to do is create a public bool which could be accessed by the other indicator code directly, however you wouldn't be able to change this parameter from the Grid parameters. public bool iShowOnly = false; We will leave this thread open in the case another community member has experience in this area.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Apr 2010
Posts: 125
Thanks: 18
Thanked 3 times in 3 posts
|
Quote:
I got it to work another way. I added a boolean input into my method that is referenced from the indicators that need it. In UserDefinedMethods.cs: public bool MyMethod(bool iShowOnly) if iShowOnly = false // do something from before else // do something less Calling the method in the indicator: if MyMethod(ShowOnly) == true Thx Irvin |
|
|
|
|
|
The following user says thank you to ij001 for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UserDefinedMethods | ScottB | Automated Trading | 7 | 09-28-2010 02:34 PM |
| UserDefinedMethods | ScottB | General Programming | 2 | 09-25-2010 11:53 AM |
| UserDefinedMethods.cs | zeller4 | Indicator Development | 1 | 06-07-2010 08:51 AM |
| userdefinedmethods | 8DTK8 | Strategy Development | 4 | 02-22-2009 07:49 AM |
| Question about UserDefinedMethods | clint2008 | Strategy Development | 1 | 11-07-2008 10:37 AM |