Ninja Trader Fix code strategy is enable showing up yellow in control center
Budget: $10 – $50 USD
when i enable my strategy the strategy shows up yellow instead of green.
Ninja trader forum:
Yellow status indicates the strategy has not yet completed a historical trade (a trade made before live data). Once the trade completes (according to your coding logic) the status would change to green and live trades would then occur.
You may not have observed this in market replay.
According to the helpguide:
Green highlighted "Strategy" cell indicates a currently running strategy.
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.
I need this fix
Ninja trader forum:
Yellow status indicates the strategy has not yet completed a historical trade (a trade made before live data). Once the trade completes (according to your coding logic) the status would change to green and live trades would then occur.
You may not have observed this in market replay.
According to the helpguide:
Green highlighted "Strategy" cell indicates a currently running strategy.
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.
I need this fix