Currently the exits are perfect but getting the entries around the same price doesn't work using default coding from strategy builder
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Entry and Exit simultaneously
Collapse
X
-
Entry and Exit simultaneously
I am running a signal to signal strategy and need knowledge on how to code the strategy that enters and exits at the same time on the candle after trigger candle. I can work in unlocked code if necessary.
Currently the exits are perfect but getting the entries around the same price doesn't work using default coding from strategy builderTags: None
-
Hello Teebone21,
Thank you for your post.
Are you trying to reverse a position?
Or, are you trying to maintain long and short positions at the same time?
If you want to reverse a position, you can call EnterLong when Position.MarketPosition == MarketPosition.Short, or EnterShort when Position.MarketPosition == MarketPosition.Long. In the managed approach NinjaTrader will automatically send a 'Close position' order to close the existing position before sending the new entry in the opposite direction.
Here is a Help Guide link about using EnterLong() - https://ninjatrader.com/support/help.../enterlong.htm
Also, here is a Help Guide link about using EnterShort() - https://ninjatrader.com/support/help...entershort.htm
If you are trying to have both long and short positions at the same time, you would need to use 2 accounts as NinjaTrader does not support having long and short positions simultaneously on the same account.
I look forward to further assisting.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
- Likes 1
-
I am trying to reverse a position using one account.. Thanks for insight!Originally posted by NinjaTrader_BrandonH View PostHello Teebone21,
Thank you for your post.
Are you trying to reverse a position?
Or, are you trying to maintain long and short positions at the same time?
If you want to reverse a position, you can call EnterLong when Position.MarketPosition == MarketPosition.Short, or EnterShort when Position.MarketPosition == MarketPosition.Long. In the managed approach NinjaTrader will automatically send a 'Close position' order to close the existing position before sending the new entry in the opposite direction.
Here is a Help Guide link about using EnterLong() - https://ninjatrader.com/support/help.../enterlong.htm
Also, here is a Help Guide link about using EnterShort() - https://ninjatrader.com/support/help...entershort.htm
If you are trying to have both long and short positions at the same time, you would need to use 2 accounts as NinjaTrader does not support having long and short positions simultaneously on the same account.
I look forward to further assisting.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
44 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
65 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment