![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2011
Posts: 45
Thanks: 11
Thanked 0 times in 0 posts
|
Hello NT Support (or anyone else please).
I have an indicator, in this case named KayButtons. I have "private IntSeries buttonCode;" in variables, have "buttonCode = new IntSeries(this);" in protected override void Initialize(), and in protected override void OnBarUpdate(), have "buttonCode.Set(1) or buttonCode.Set(2) or buttonCode.Set(3), depending on certain conditions. I also have the code below in properties: [Browsable(false)] [XmlIgnore()] public IntSeries ButtonCode { get { return buttonCode; } } By the way, I am still a novice in NTScripts / C#. I just make do by nicking and amending snippets of codes here and there. What I wanted to do was access the value of buttonCode.Set from another of my indicators, in this case named KayStopLines3. So in KayStopLines3, I have the following code in protected override void OnStartUp(), if (KayButtons.ButtonCode == 1) Unfortunately, I get the following error when I try to compile it: 'NinjaTrader.Indicator.Indicator.KayButtons()' is a 'method' which is not valid in this given context Could I please request your assistance in resolving this error please? Many thanks Dan |
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#3 | |
|
Member
Join Date: Aug 2011
Posts: 45
Thanks: 11
Thanked 0 times in 0 posts
|
Quote:
Thanks for your reply. I tried your suggestion above - if (KayButtons.ButtonCode[0] == 1), but I still get the same error message when I tried to compile it. Thanks Dan |
|
|
|
|
|
|
#4 | |
|
Senior Member
|
Quote:
if (KayButtons(string[] Parameters).ButtonCode[0] == 1) i.e, the calling convention is always Class(parameter list).TypeOfSeries[int index]
Last edited by koganam; 04-01-2012 at 04:31 PM.
|
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#5 | |
|
Member
Join Date: Aug 2011
Posts: 45
Thanks: 11
Thanked 0 times in 0 posts
|
Quote:
What will be the calling parameters, i.e. what should I put inside (string[] Parameters) ? Thanks Dan |
|
|
|
|
|
|
#6 |
|
Senior Member
|
The calling parameters are the inputs that you have specified in the public properties for the indicator, when you coded the indicator. (i.e., any property that has a setter). Intellisense should be able to help you, if you cannot determine the correct order.
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#7 | |
|
Member
Join Date: Aug 2011
Posts: 45
Thanks: 11
Thanked 0 times in 0 posts
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Accessing other indicator boolean values | tacticaltrader | General Programming | 3 | 09-26-2011 04:28 AM |
| Accessing indicator values without plots | suprsnipes | Indicator Development | 1 | 08-25-2010 05:23 AM |
| Accessing Personal Indicator Values (How To) | rhbishop5 | Indicator Development | 2 | 04-12-2010 05:06 AM |
| Accessing Custom Indicator Values | murfinp | Indicator Development | 2 | 08-25-2009 02:11 PM |
| Accessing Multi Timeframe Indicator Values | TAJTrades | Indicator Development | 11 | 03-02-2009 07:11 AM |