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.JesseNinjaTrader Customer Service
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.JesseNinjaTrader Customer Service
Comment
-
Comment
-
-
Hello ronniecorrigan,
Did you check the strategies performance report specifically? You need to right click on the strategy -> strategy performance -> realtime to compare against the account performance tab. If the strategy has any different orders it will not be in sync.JesseNinjaTrader Customer Service
Comment
-
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by iantriestrading, Today, 11:55 AM
|
5 responses
12 views
0 likes
|
Last Post
|
||
Started by rexsole, 04-21-2025, 01:46 PM
|
4 responses
47 views
0 likes
|
Last Post
![]() |
||
Started by monpere, 06-20-2008, 03:11 PM
|
15 responses
2,219 views
0 likes
|
Last Post
|
||
Started by dadarara, Today, 11:44 AM
|
0 responses
8 views
0 likes
|
Last Post
![]()
by dadarara
Today, 11:44 AM
|
||
Started by g0sty, Today, 09:24 AM
|
7 responses
22 views
0 likes
|
Last Post
|
Comment