Thanks again for your help!
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Multiple IDataSeries input for indicator
Collapse
X
-
Originally posted by NinjaTrader_Lance View Post
Thanks again for your help!
-
Originally posted by FireFly View PostI have a new question related to this. Suppose that in TestA I want to use not Close[0] but (Close[0]-Close[1]). How can I do that?
Of course I could do this in TestC:
Plot0.Set( TestA( TestB(Close,2),Close[0] - Close[0])[0] );
But can I do the calculation ( Close[0]-Close[1] ) inside TestA by passing Close as a DataSeries? How can I do that?
So basically I want to have multiple DataSeries as inputs where normally an indicator works on only one.
Just some suggestions that I have never tried myself in your exact setup.- Have you tried using a PriceType variable for input, and a switch statement to branch depending on such input value? ref: my response in this thread: http://www.ninjatrader.com/support/f...ad.php?t=44605
- Have you tried using the BarsArray Get functions?
Code:BarsArray[0].GetClose(CurrentBar); BarsArray[0].GetLow(CurrentBar); //et.c.,
Comment
-
Originally posted by koganam View Post[*]Have you tried using the BarsArray Get functions?
Code:BarsArray[0].GetClose(CurrentBar); BarsArray[0].GetLow(CurrentBar); //et.c.,
Btw, I found that there was also an unpleasant side effect to the previous method (passing Close[0] and Close[1] through the "normal" parameters): I noticed that for every bar the whole indicator gets re-calculated for all previous historical bars, so a big hit on performance. Using BarsArray doesn't have that issue.
My indicator works smoothly now and the solution with BarsArray is very elegant.Last edited by FireFly; 03-07-2013, 01:13 PM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, 04-17-2024, 06:40 PM
|
6 responses
48 views
0 likes
|
Last Post
by algospoke
Today, 06:18 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
4 responses
11 views
0 likes
|
Last Post Today, 04:08 PM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
61 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by jordanq2, Today, 03:10 PM
|
2 responses
9 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
21 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
Comment