Thank you for your post.
Debugging steps should be taken to monitor the strategy as it is executing to determine why the SetStopLoss order was ignored.
In order to better understand how the code is working, I recommend adding some debugging prints to your strategy. By adding debugging prints for the values used to evaluate your conditions, outside of those conditions you can observe if the strategy's logic is allowing your order submission methods to fire.
If you are seeing your order submission being reached, but it is not executing, there may be an issue where the strategy is hitting an internal rule that is not allowing you to re-enter. TraceOrders can be used in the strategy (set in State.SetDefaults or in the Strategy Builder under Default Properties) so it prints its order feedback, and you may also observe the log tab of the Control Center for additional information.
Some items to check when you are taking debugging steps:
- Are your strategy's conditions allowing your order submission methods to be reached?
- Is the strategy currently in a position that is preventing it from submitting another entry order?
- Do you see any errors in the log tab of the Control Center or do Trace Orders give you any feedback?
Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm
TraceOrders - https://ninjatrader.com/support/help...aceorders2.htm
Debugging in the Strategy Builder - https://drive.google.com/file/d/1mTq...w?usp=drivesdk
Debugging Demo - https://drive.google.com/file/d/1rOz...w?usp=drivesdk
Please let us know if we may assist further.
Leave a comment: