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 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 01-31-2011, 12:38 PM   #1
mcxr7
Junior Member
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 times in 0 posts
Default Reference variable Historically

Hi, I am writing a strategy and want to reference a variable that I am calculating historically.

For Example:
int variable1 = {MyCalculation}

Strategy Entry
if (
variable1[0] > variable1[1]
)
EnterLong....

I am not sure if this is the best way of doing it, or if in fact it can be done.
Thanks
mcxr7 is offline  
Reply With Quote
Old 01-31-2011, 12:46 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

You would need to work with a DataSeries object to be able to reference historical values, an intSeries in your case here - http://www.ninjatrader.com/support/h...ries_class.htm
NinjaTrader_Bertrand 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
SetProfitTarget not filling when touched historically terabyte Strategy Development 10 08-19-2010 12:48 PM
Variable reference problem rhbishop5 General Programming 6 01-17-2010 09:40 PM
How to use GetMinMaxValues(), reference available? Stone General Programming 2 03-22-2009 08:20 AM
reference stochastic d and k? suedeuno General Programming 1 01-09-2009 08:40 PM
Reference guide for system variable toyogo00 General Programming 7 06-13-2008 12:25 PM


All times are GMT -6. The time now is 12:00 AM.