Currently the exits are perfect but getting the entries around the same price doesn't work using default coding from strategy builder
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
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.Brandon H.NinjaTrader Customer Service
- Likes 1
-
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 benmarkal, Yesterday, 12:52 PM
|
3 responses
23 views
0 likes
|
Last Post Today, 05:22 AM | ||
Started by helpwanted, Today, 03:06 AM
|
1 response
19 views
0 likes
|
Last Post Today, 03:35 AM | ||
Started by Brevo, Today, 01:45 AM
|
0 responses
11 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
244 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
388 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
Comment