NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-17-2008, 01:37 PM   #1
altrader
Member
 
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
Post Accessing 5 min indicator on close of 1 min bar

Hey Guys, hope this makes sense ...

I would like to get a general setup condition from my 5 min series and then check for exact entry conditions from the 1 minute bar i.e. on close of 5min bar I determine that my general entry conditions exist. Can I then continue to monitor the same indicator (based on 5 min bar) on close of the 1 min bar? Essentially I would just like a little more granularity for entering on the 5 min chart, rather than waiting for bar close.

So I guess it would look like this
Primary series=5 min
Secondary=1 min

myValue=ANIndicator(1,2,3);
if MyValue==4) //entry conditons met
{ enter=true; }
if (BarsInProgress == 1 && enter)
{
finalValue=ANIndicator(1,2,3); // But i want the ANIndicator to be using the data from the 5 min chart, not the 1. Is this possible?
if (finalValue==5)
{EnterLong();}
}
altrader is offline  
Reply With Quote
Old 04-17-2008, 01:42 PM   #2
altrader
Member
 
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
Default

Is it as easy as this?

if (BarsInProgress == 1)
{ value=ANIndicator(1,2,3)[0][0]; }
altrader is offline  
Reply With Quote
Old 04-17-2008, 01:43 PM   #3
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

if (BarsInProgress == 1)
finalValue = ANIndicator(BarsArray[0], 1, 2, 3)[0];
NinjaTrader_Ray is offline  
Reply With Quote
Old 04-17-2008, 01:47 PM   #4
altrader
Member
 
Join Date: Mar 2008
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
Thumbs up

Quote:
Originally Posted by NinjaTrader_Ray View Post
if (BarsInProgress == 1)
finalValue = ANIndicator(BarsArray[0], 1, 2, 3)[0];
Perfect.

Many thanks Ray.
altrader is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Multiple Custom Indicator Plots within a Strategy whitmark Strategy Development 15 03-28-2009 04:21 PM
Accessing Multi Timeframe Indicator Values TAJTrades Indicator Development 11 03-02-2009 07:11 AM
Accessing value from custom indicator from strategy funk101 Strategy Development 12 08-19-2008 08:41 AM
Accessing the user defined plot color parameter from within an indicator. Elliott Wave Indicator Development 1 04-15-2008 11:29 PM
Accessing Custom Indicator Functions in Strategies ThePatientOne Strategy Development 1 05-29-2007 01:29 PM


All times are GMT -6. The time now is 06:13 PM.