Update: Okay created a simplified strategy, and it still wont execute a buy order. So I am assuming I am creating a long position in strategy builder wrong?
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 Will not buy but will short only
Collapse
X
-
Strategy Will not buy but will short only
I built a strategy and for the likes of me, the strategy will not buy but would only short. I have looked through the code, looked through the strategy, edited, removed conditions, rebuilt the sets, and still nothing. Yes I could rebuild the darn thing but that doesn't solve my problem and it will take a few hours. What troubleshooting techniques can I use to figure out why I can not buy but only short?
Update: Okay created a simplified strategy, and it still wont execute a buy order. So I am assuming I am creating a long position in strategy builder wrong?Tags: None
-
Hello w0lverine,
Thanks for your question.
When debugging strategy logic, we recommend the following process:
1. Test to reproduce the issue in the Playback Connection.
2. Once you can reproduce, test the strategy with prints added so you can confirm your logic is allowing your order submission methods to be reached
3. If the order submission method is reached but is not allowing order submissions, test again with Trace Orders enabled and check to see if the order method is getting ignored due to the internal rules of the Managed Approach.
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
Playback Connection - https://ninjatrader.com/support/help...connection.htm
Debugging Demo - https://drive.google.com/file/d/1rOz...w?usp=drivesdk
Please also note that 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.) If the strategy calculates that is in a virtual position when it transitions to processing realtime data, the strategy's Start Behavior may waiting until this position becomes flat before orders are allowed to submit with realtime data. (Wait Until Flat.) You can observe the Strategies tab of the Control Center if the strategy is in a virtual position waiting to become flat. The strategy will be orange/yellow when waiting to for the historical position to be closed, and will be green when allowed to trade live.
ImmediatelySubmit is used when we know the strategy position is where we want it and we want the strategy to resume this position. There can be cases where a strategy is enabled with ImmediatelySubmit and the strategy/account position are not in sync. In such a case the strategy may be closing open positions on the account when it is trying to open its own position.
Synchronize Account is an additional function that will have NinjaTrader submit an order to sync the account to the strategy (not vice-versa.)
If you would not like the strategy to start with a historical position, you can add the following to an unlocked strategy at the top of the OnBarUpdate method:
if (State == State.Historical) return;
Strategy Position vs. Account Position - https://ninjatrader.com/support/help..._account_p.htm
Start Behaviors - https://ninjatrader.com/support/help..._positions.htm
Managed Approach (Internal Rules) - https://ninjatrader.com/support/helpGuides/nt8/en-us/index.html?
We look forward to being of further assistance.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by chbruno, Today, 04:10 PM
|
0 responses
3 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
436 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
6 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
19 views
0 likes
|
Last Post Today, 03:33 PM | ||
Started by frslvr, 04-11-2024, 07:26 AM
|
9 responses
127 views
1 like
|
Last Post
by caryc123
Today, 03:12 PM
|
Comment