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 cory with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 dlatbm with 1 posts (0 thanks)
    1. trending_up 2,875 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 3 attachments




 
Search this Thread

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

  #1 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

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:	164
Size:	69.6 KB
ID:	52694  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 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
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


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
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090

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
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


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
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

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:	181
Size:	176.2 KB
ID:	52701  
Started this thread Reply With Quote




Last Updated on October 20, 2011


© 2024 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 - Privacy Policy - Downloads - Top
no new posts