Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
my acct and start position drift
Collapse
X
-
my acct and start position drift
I’m running a custom NinjaTrader 8 strategy on a combine propfirm account, and it frequently gets out of sync with the real account position.it is a renko chart i am using. Sometimes the account is flat, but the strategy still thinks it’s in a long or short, preventing new trades or causing incorrect exit signals. I’ve tried enabling “Sync Account Position,” but the mismatch persists. The only way to fix it so far is to disable and re-enable the strategy, which isn’t practical. Has anyone encountered a similar issue or found a reliable way to keep the strategy’s internal position tracking aligned with the actual account position? it works for 1 trade after i re enable it but falls out of sync after the first exit4 PhotosTags: None
-
Yes, I am running a single strategy, and I am using the built-in strategy methods like EnterLong and ExitLong to submit orders. The exits are also handled by the strategy using ExitLong and ExitShort. However, the issue is that sometimes the strategy thinks it is in a position when the account is actually flat, or vice versa. This prevents new trades from being taken or causes incorrect exit signals. I have “Sync Account Position” enabled, but the issue persists. Do you have any recommendations on how to ensure the strategy stays in sync with the actual account position?
Here is the relevant code for entries and exits:
// Entry logic: Only enter if flat
if (Position.MarketPosition == MarketPosition.Flat)
{
if (longCond)
EnterLong(1, "Long");
else if (shortCond)
EnterShort(1, "Short");
}
// Exit logic: Send an exit order if conditions are no longer met
if (Position.MarketPosition == MarketPosition.Long && !longCond)
ExitLong("ExitLong", "Long");
if (Position.MarketPosition == MarketPosition.Short && !shortCond)
ExitShort("ExitShort", "Short");
Given that I am using NinjaTrader’s built-in strategy execution methods (EnterLong, EnterShort, ExitLong, ExitShort), is there a known issue with position desynchronization in live trading
Last edited by ronniecorrigan; 03-18-2025, 02:17 AM.
Comment
-
Hello ronniecorrigan,
In that case you would need to look at the executions to get a better idea of what is differing. The sync simply shows if the strategy position is the same as the accounts but you would only be able to tell how its falling out of sync by comparing the account executions vs the strategies.
Comment
-
hi there so that is the chart when the exit was triggred as you can seee it just closes the posistion
Comment
-
then here are the corresponding logs, the top 2 are when i turned the strat on and off so it re syncs at this point the strat was flat but the posistion was showing short 1 even tho the account was flat
Comment
-
Comment
-
-
hi so in the excutions tab they match however it is in the stratergys tab where the strat window thinks the account is out of sync
Comment
-
Hello ronniecorrigan,
You can look in the trade performance window to see the executions on the account which will include that strategies executions. You can then compare that to the strategies performance report by right clicking on the strategy in the strategies tab and viewing its report. For the account to be in sync the account needs to see the same executions that the strategy did for the period of time the strategy was running. For example if the strategy is enabled and is flat, the the account is flat they will be in sync. If the strategy is trading and any manual trades happen it will be out of sync.
Comment
-
Comment
-
-
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
62 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
134 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
50 views
0 likes
|
Last Post
|

Comment