![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
|
I'm pretty sure there is a problem with MarketPosition.Flat
This works .. for determining if I'm not in a Long or Short ... if (Position.MarketPosition != MarketPosition.Short && Position.MarketPosition != MarketPosition.Long ) But this seems to be a no-op if (Position.MarketPosition == MarketPosition.Flat) 6 b2 Plus Dierks mods from last week |
|
|
|
|
|
#2 | |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
I am 100% positive that it does work.
Try this: Quote:
Ray
NinjaTrader Customer Service |
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
|
Of course you are right.
I had the strategy running on two charts and I was seeing the debug output from a 'flat' strategy mixed in my long output. A second question ... Is there a method I can use to determine the active instrument? |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Do you mean printing out what Instrument the strategy is running? If yes, try this -
http://www.ninjatrader-support.com/H...tFullName.html Ray
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|