NexusFi: Find Your Edge


Home Menu

 





Need some help referencing a value of a secondary Time Series....


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one forrestang with 4 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 dlatbm with 1 posts (0 thanks)
    4. looks_4 cory with 1 posts (0 thanks)
    1. trending_up 3,493 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 3 attachments




 
Search this Thread
  #1 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
Legendary Urban Samurai
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,345 since Jun 2010
Thanks Given: 357
Thanks Received: 1,060

Howdy. I have been bashing my brains in trying to get this to work.

I simply want to create an indie that adds a secondary dataSeries to whatever chart the indie is added to. So say I have a 4r chart, I would like to add a secondary series in the indie of say 240 minutes, and plot the open of that 240min Data Series to the chart.

So what it would look like is shown in the picture below. Where each red line plotted is the Open of the new 4 hour bar that opens.

I have tried many things, I have tried to use the "Opens[0][0]" WITHIN the barsInProgress ==1. I have tried using a negative index in the barsinprogress==1.

This seems to be something simple that I am overlooking.

Also in the code, above I have added the the 240 minute dataSeries above.
 
Code
        protected override void OnBarUpdate()
        {	
			
			if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired )
        		return;

		
			if (secondaryOpen == null)
			{
				secondaryOpen = new DataSeries(SMA(BarsArray[1], 50));

			}
			
			// Executed on secondary bar updates only
			if (BarsInProgress == 1)
			{
				secondaryOpen.Set(Open[-1]);		//To Line bars up using -1 not 0?
				//return;
			}	
			
			// Executed on primary bar updates only
			if (BarsInProgress == 0)
			{
				
			}
			AnchorLine.Set(secondaryOpen[0]);

        }


Attached Thumbnails
Click image for larger version

Name:	Prime2011-10-20_103850.jpg
Views:	216
Size:	69.6 KB
ID:	52694  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Kalshi Rockets to $22B, Passes Polymarket in Volume -- B …
Prediction Markets & Event Contracts
$134M Ground Entry Contract in Disputed Final Review Aft …
Prediction Markets & Event Contracts
Al Arabiya: US-Iran Draft Deal Within Hours Contains Hor …
Prediction Markets & Event Contracts
Prop Firms Are Banning Gold Trading as Record Prices Mak …
Funded Trading Evaluation Firms
SEC Advisory Committee Backs Tokenized Securities Exempt …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Algo automated / semi-automated trading anyone?
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 dlatbm 
Sydney Australia
 
Experience: Advanced
Platform: SierraCharts, NT
Trading: ES,TF,CL, SPI,
Posts: 73 since Nov 2010
Thanks Given: 6
Thanks Received: 23


"
"Opens[0][0]" WITHIN the barsInProgress ==1
"
I hope that the "Opens" is a spelling mistake
Shouldn't be that "Close[0][0]"
Good Luck


Reply With Quote
  #4 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
Legendary Urban Samurai
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,345 since Jun 2010
Thanks Given: 357
Thanks Received: 1,060


dlatbm View Post
"
"Opens[0][0]" WITHIN the barsInProgress ==1
"
I hope that the "Opens" is a spelling mistake
Shouldn't be that "Close[0][0]"
Good Luck

Hehe, I thought that was an error the first time I saw it too.

That feature is HERE. There is also a Lows, Highs and Closes as well. I think its the 'preferred' method of reference when working with multi-timeframe series.


Started this thread Reply With Quote
  #5 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093

spread indicator works with 2 series have you check it out?


Attached Files
Elite Membership required to download: Spread.zip
Reply With Quote
  #6 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
Legendary Urban Samurai
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,345 since Jun 2010
Thanks Given: 357
Thanks Received: 1,060


cory View Post
spread indicator works with 2 series have you check it out?

I just tried this, tried using it on both the primary and secondary series on a chart, not sure what it does?


Started this thread Reply With Quote
  #7 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
Legendary Urban Samurai
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,345 since Jun 2010
Thanks Given: 357
Thanks Received: 1,060

I have something workable. It seems to be off by a tic or two in certain places though.

But what I did was create a simple indicator that does nothing but capture the Open/HIgh/Low values and stores them as an exposed dataSeries. Why I have to do this I don't understand as those values should be readily available?

But then from my main script, passed the secondary DataSeries I have added to that simple indicator mentioned above, and capture that open value and plot it on a chart.

ugh.


Attached Thumbnails
Click image for larger version

Name:	Prime2011-10-20_115959.jpg
Views:	232
Size:	176.2 KB
ID:	52701  
Started this thread Reply With Quote




Last Updated on October 20, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts