![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#16 |
|
Senior Member
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 13
Thanked 24 times in 18 posts
|
Explain what it is you are trying to do again.
Maybe I'm the one who isn't understanding. |
|
|
|
|
|
#17 |
|
Senior Member
Join Date: Nov 2004
Location: UK
Posts: 236
Thanks: 1
Thanked 0 times in 0 posts
|
I have an indicator, lets call it MyIndi, that needs to access the value of T3. Both T3 and MyIndi are on the same chart.
Currently I have T3 parameters as (34, 3, 0.01). In MyIndi I am accessing T3 with: if(High[0] > T3(34,3,0.01)[0]) do something... This works fine but if I changed T3 (on the chart) to, say, (21, 3, 0.5) MyIndi would still be accessing T3(34,3,0.01)[0]. I would like MyIndi to access whatever parameters T3 is currently set to. So if T3 is changed I would not have to change MyIndi. I hope this is a bit clearer :-) Also, thanks for your patience. |
|
|
|
|
|
#18 | |
|
Senior Member
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 13
Thanked 24 times in 18 posts
|
Quote:
This should be quite simple. save T3 under a new name. (No editing NT stock indicators) add the following code line in onBarUpdate. if(High[0] > T3(period, tCount, vFactor)[0]) // Do Something!!! Now your parameters in this indicator will control your new T3 version as well as the parameters to the original T3 feeding into your indicator. Only use the new indicator. T3 does not need to be on the chart. The only thing left is the "do something ". ![]() RJay P.S. this can also be done without the T3 feed. Simply compare the Value[0] to Open[0] .
Last edited by RJay; 07-23-2010 at 02:16 PM.
|
|
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Nov 2004
Location: UK
Posts: 236
Thanks: 1
Thanked 0 times in 0 posts
|
Aha!! Never thought of doing it like that, it works great.
Many, many thanks. Can I push my luck with your generosity just a little further? :-) You mention: P.S. this can also be done without the T3 feed. Simply compare the Value[0] to Open[0] Could you explain 'simply compare the Value[0] to Open[0]' a bit further please. |
|
|
|
|
|
#20 | |
|
Senior Member
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 13
Thanked 24 times in 18 posts
|
Quote:
OK, Temporarily, comment out the input feed from T3 and add this if statement at this location in the code. CalculateGD((DataSeries) seriesCollection[seriesCollection.Count - 1], Values[0]); if(High[0] > Values[0]) // Do Something } RJay |
|
|
|
|
|
|
#21 |
|
Senior Member
Join Date: Nov 2004
Location: UK
Posts: 236
Thanks: 1
Thanked 0 times in 0 posts
|
Hi RJay
Right, got it. Although I had to change Values[0] to Value[0]. Values[0] was giving a compile error saying 'Operator '>' cannot be applied to operands type 'double' and DataSeries'. Once again many thanks for the help. I won't take up any more of your time! |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy Analyzer + Varying Tick Timeframe | cgeorgan | Version 7 Beta General Questions & Bug Reports | 1 | 07-01-2010 09:08 AM |
| Indicator Accessing Indicator Where User Has Set Parameters | dkrumholz | Indicator Development | 1 | 04-27-2010 02:56 PM |
| Indicator Parameters in a Strategy | laocoon | Strategy Development | 1 | 10-08-2009 04:11 AM |
| How to add additional/optional parameters to an indicator? | isitpossible | Indicator Development | 2 | 08-11-2009 06:42 AM |
| Indicator parameters from within a strategy | astrolobe | Indicator Development | 1 | 06-20-2009 11:05 PM |