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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 07-25-2008, 06:53 AM   #1
Ninja B
Member
 
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
Question Displacement does not exist in current context errors?

I'm trying to get the displaced EMA and SMA to use in a strategy. Plot a couple of bars ahead and behind using displacement. I write the code fine in the strategy wizard and then go in manually and enter this

// Initialize method of a custom indicator
protected override void Initialize()
{
Add(new Plot(Color.Orange, "SMA"));
Displacement = 2; // Plots the indicator value from 2 bars ago on the current bar
}
http://www.ninjatrader-support.com/H...HistoricalData

I get the following: The name 'Displacement' does not exist in current context


Ninja B is offline  
Reply With Quote
Old 07-25-2008, 07:13 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Displacement exists on indicators but not on strategies.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-25-2008, 07:18 AM   #3
Ninja B
Member
 
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
Displacement exists on indicators but not on strategies.

I could just make a displaced EMA and SMA and then use it in the strategy right?
Ninja B is offline  
Reply With Quote
Old 07-25-2008, 07:20 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

That should work
NinjaTrader_Dierk 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
Indicator Displacement FatCanary Charting 2 06-15-2008 05:31 PM
Displacement Issue PrTester Indicator Development 1 08-17-2007 10:52 PM
Kentler Swing using displacement field in strategy richa61416 Strategy Development 3 07-04-2007 04:02 PM
Not able to access WoodiesCCI ; The name WoodiesCCI does not exist in the current context Obi Strategy Development 4 03-27-2007 08:22 AM
strategy id ' ' does not exist highflyer Automated Trading 4 12-08-2005 04:43 AM


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