![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2007
Location: Boston
Posts: 29
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I'm working with NTv6.0.0.5 developing a custom strategy in NinjaScript. I'm getting a compile error ("The name 'MarketPosition' does not exist in the current context.") on this line in OnBarUpdate: if (Position.MarketPosition != MarketPosition.Flat) {} It's complaining about the 'MarketPosition.Flat', has something changed since the Help file was created? How can I check the current market position being long, shortor flat? Thanks. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
Can you email me your entire cs file where this problem is occuring? Email to ray at ninjatrader dot com. This should work, but need to see your code.
Ray
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Join Date: Dec 2006
Location: , ,
Posts: 6
Thanks: 0
Thanked 0 times in 0 posts
|
The exact syntax you show works fine in 6.0.0.4. Did you have this working earlier, or is this a new effort?
I'm just about to download 6.0.0.5. I'll let you know if my program using this syntax works there. Bob |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
This was a user error. User had copied indicator code to a strategy code and as a result was missing some critical "using declarations".
Ray
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|