Thanks.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Strategy shows I'm in a position but I shouldn't be
Collapse
X
-
Hello elcowen,
Thank you for your post.
When a strategy is yellow (or orange) in the Strategies tab of the Control Center, this means that the strategy entered a historical (virtual) position in the historical data that has been loaded and that you have "Wait until flat" selected for the 'Start behavior' option in the strategy parameters.
When a strategy is enabled, it processes historical data to determine trades that the strategy would have made on the data that is already on the PC/chart and to determine what position the strategy is in. (Strategy positions are separate from actual Account positions).
Once the strategy has finished processing the historical data and has transitioned to real-time, 'Wait Until Flat' will wait until there is a real-time order submission that will cause the strategy to become flat. All positions must be flat before real-time orders will begin.
If you do not want the strategy to calculate a position from processing historical data, you could add if (State == State.Historical) return; to the top of your strategy logic so historical processing is skipped. The strategy will then always start from a flat position because it has not calculated any orders.
Please see the help guide links below for more information about Start Behavior and Strategy vs Account Position.
Strategy vs. Account Position — https://ninjatrader.com/support/help..._account_p.htm
Start Behaviors — https://ninjatrader.com/support/help..._positions.htm
Let us know if we may assist further.Brandon H.NinjaTrader Customer Service
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by junkone, 04-21-2024, 07:17 AM
|
10 responses
148 views
0 likes
|
Last Post Today, 09:03 AM | ||
Started by tsantospinto, 04-12-2024, 07:04 PM
|
6 responses
101 views
0 likes
|
Last Post
by tsantospinto
Today, 08:57 AM
|
||
Started by rocketman7, Today, 02:12 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 08:56 AM | ||
Started by ZenCortexReal, Today, 08:54 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 08:54 AM | ||
Started by ZenCortexReal, Today, 08:52 AM
|
0 responses
0 views
0 likes
|
Last Post Today, 08:52 AM |
Comment