I have a little problem. I've got a strategy, and its great, but there's a hitch. For some reason the position and acct position wont remain synced. I'm not doing any discretionary trading, so its not getting thrown off there. Basically if Im long 2 lots, and the signal is given to go short 2 lots, then it will close the 2 long and short 4 more lots, or vice versa. Does anyone have any ideas? I have the order management set to default quantity so the order quantities should be the same across the board, right?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy wont remain synced.
Collapse
X
-
Strategy wont remain synced.
Hey everybody,
I have a little problem. I've got a strategy, and its great, but there's a hitch. For some reason the position and acct position wont remain synced. I'm not doing any discretionary trading, so its not getting thrown off there. Basically if Im long 2 lots, and the signal is given to go short 2 lots, then it will close the 2 long and short 4 more lots, or vice versa. Does anyone have any ideas? I have the order management set to default quantity so the order quantities should be the same across the board, right? -
Hello,
Thank you for the post.
I wanted to check, are you both Exiting and Entering in the same condition?
What this sounds like to me is that you are Exiting but also Entering which is calling a Reversal.
Essentially you exit bringing you flat but because the Entry is reading that the position is still short, it exits by 4 to exit and enter 2 in the opposite direction. This brings you to 4 in the opposite direction.
Without seeing the code this is only a speculation.
If this is what is happening, the solution could be to only Exit, then wait for the bar to close and then enter on the next bar. Or you could not exit and call the opposite entry if you are trying to Reverse the position which will both exit and enter.
If you can provide the script that would be helpful to see how the logic is currently set up to better understand what may be happening.
I look forward to being of further assistance.
-
Hey Jesse,
Thank you for the reply. Yes it is entering and exiting on the same condition. So I need to remove the exit order? Right now I have code like this :
// Set 1
if ((Close[0] > Close[1])
&& (Close[1] > Close[2]))
{
EnterShort(Convert.ToInt32(DefaultQuantity), "");
ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
}
// Set 2
if ((Close[0] < Close[1])
&& (Close[1] < Close[2]))
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
ExitShort(Convert.ToInt32(DefaultQuantity), "", "");
}
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
20 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
119 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
63 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
45 views
0 likes
|
Last Post
|

Comment