PDA

View Full Version : Displacement does not exist in current context errors?


Ninja B
07-25-2008, 06:53 AM
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/HelpGuideV6/helpguide.html?HistoricalData

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

:confused:

NinjaTrader_Dierk
07-25-2008, 07:13 AM
Displacement exists on indicators but not on strategies.

Ninja B
07-25-2008, 07:18 AM
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?

NinjaTrader_Dierk
07-25-2008, 07:20 AM
That should work