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 set to enter with 1 order quantity but sometimes it enters with 2
Collapse
X
-
Strategy set to enter with 1 order quantity but sometimes it enters with 2
I set up a strategy to enter a trade with 1 order quantity. It does what it’s supposed to do but when I enable the strategy again, it will enter with 2 orders. Not sure what is going on…. I always check the order quantity option on Builder and also before enabling a strategy but that still happensTags: None
-
Hello rafael_delima86,
Thanks for your post.
Before you start-up the strategy for the 2nd time, please check the "Positons" tab of the NinjaTrader control center and verify there are no existing positions.
What is the start-up behavior of the strategy? By default, it would be "Wait until flat".
In your strategy do you have conditions that enter long AND exit short as well as enter Short and exit long?
Are you manually trading on the same instrument and account as the strategy?
Paul H.NinjaTrader Customer Service
-
Hello Paul,
So my strategy consists of entering a position on Macd crossover, and exit when another crossover occurs.
Comment
-
Hello rafael_delima86,
Thanks for your reply.
What is the start-up behavior of the strategy? By default, it would be "Wait until flat", can you confirm?
Are you manually trading (at the same time) on the same instrument and account as the strategy?
Do you have any other exit orders besides the exit on MACD crossover?
Are you testing on live data, playback with market replay data, or in the strategy analyzer?
What is the Calculate setting of the strategy?
Can you provide further information we can assist?Paul H.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_PaulH View PostHello rafael_delima86,
Thanks for your reply.
What is the start-up behavior of the strategy? By default, it would be "Wait until flat", can you confirm?
Are you manually trading (at the same time) on the same instrument and account as the strategy?
Do you have any other exit orders besides the exit on MACD crossover?
Are you testing on live data, playback with market replay data, or in the strategy analyzer?
What is the Calculate setting of the strategy?
Can you provide further information we can assist?
Yes Wait Until Flat is on.
I do not place any orders manually.
Aside from ENTER and EXIT on macd crossover, I only have STOP LOSS and Profit Target placed on each entry.
I am testing on LIVE data.
Calculate ON BAR CLOSE
Comment
-
Hello rafael_delima86,
Thanks for your reply.
Do you have conditions that enter long on a macd cross and exit short on a macd cross, and then enter short on a macd cross and exitlong on a macd cross?
Can you post a screenshot of your entry and exit sets?
To get a screenshot with Windows 7 or newer I would recommend using the Windows Snipping Tool.
Click here for instructions
Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.
Click here for detailed instruction
Paul H.NinjaTrader Customer Service
Comment
-
This is what I came up with...However, on the ENTRIES condition, I believe I am missing a Position.Market Position=Market Position.Flat right?2 Photos
Comment
-
Hello rafael_delima86,
Thanks for your reply.
I was hoping to see all of the entry and exit sets but I think what you are showing is the issue. When you place an entry order, if there is already a position in the opposite direction, the entry method will automatically issue a market order called "Close Position" and then a second order to leave you in the intended position. If however an Exit order is called at the same time then it too will issue an order in that same direction leaving you with 2 positions.
Yes, in your entry sets you can add a condition to check that the market position is flat and that will prevent additional orders by the entry.Paul H.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_PaulH View PostHello rafael_delima86,
Thanks for your reply.
I was hoping to see all of the entry and exit sets but I think what you are showing is the issue. When you place an entry order, if there is already a position in the opposite direction, the entry method will automatically issue a market order called "Close Position" and then a second order to leave you in the intended position. If however an Exit order is called at the same time then it too will issue an order in that same direction leaving you with 2 positions.
Yes, in your entry sets you can add a condition to check that the market position is flat and that will prevent additional orders by the entry.
I will add the market position flat on both entries sets, however, do I need to add market position FLAT on exits as well?
Comment
-
Hello rafael_delima86,
Thanks for your reply.
For the exits you would not want to check for a flat position. If there is no position, ExiLong and ExitShort perform no function.
You could check that for the exitlong that you are is a long market position, and the opposite for the short side.Paul H.NinjaTrader Customer Service
Comment
-
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by StockTrader88, 03-06-2021, 08:58 AM
|
45 responses
3,991 views
3 likes
|
Last Post Today, 09:51 AM | ||
Started by TAJTrades, Today, 09:46 AM
|
0 responses
7 views
0 likes
|
Last Post
by TAJTrades
Today, 09:46 AM
|
||
Started by rhyminkevin, Yesterday, 04:58 PM
|
5 responses
62 views
0 likes
|
Last Post
by dp8282
Today, 09:36 AM
|
||
Started by realblubb, Today, 09:28 AM
|
0 responses
8 views
0 likes
|
Last Post
by realblubb
Today, 09:28 AM
|
||
Started by AaronKoRn, Yesterday, 09:49 PM
|
1 response
19 views
0 likes
|
Last Post
by Rikazkhan007
Today, 09:24 AM
|
Comment