Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multiple Strategies on the same ticker/instrument
Collapse
X
-
Multiple Strategies on the same ticker/instrument
Hello, I use ninjatrader for automated equities trading with my TDA account. I am trying to figure out what is the best way to run multiple strategies on a single instrument such as SPY. So for example let use assume I have a trend strategy and a mean reversion strategy and I would like to have both strategies running on SPY. I do not want to combine the logic of both strategies as I also run them on different tickers as well. I also do not want to create a different account as that is not feasible for the amount of strategies I run. I do not care that the strategies are in sync with my account position and should work independently of one another. Considering you can only have 1 active strategy with IsAdoptAccountPositionAware, what would be the best way to run these strategies. I do not want to wait until flat and I dont want to submit any historical orders in the queue. I just want to activate each strategy and have it enter/exit based on the rules of the respective strategy without it effecting the other strategy or my existing account position for that ticker. Hope my question makes sense...Thank you in advance for any support.
-
This will cause you problems.Originally posted by proptradingshop View PostI do not care that the strategies are in sync with my account position
-- Assuming the same account ---
Strat #1 enters SPY via BUY 100 (AcctPos is LONG 100)
Strat #2 enters SPY via SELL 100 (AcctPos is FLAT)
...
... time passes, each strategy manages their own
... position, oblivious to all other running strategies
...
Strat #1 exits SPY via SELL 100 (AcctPos is SHORT 100)
Strat #2 exits SPY via BUY 100 (AcctPos is FLAT)
You really think the amount of profit made (or lost)
by Strat #1 and #2 will be accurately reflected
in your real live account?
Maintaining that accuracy is precisely what 'keeping
your strategies in sync with your account position'
means.
Could you explain your reasons why you would choose
to not care about that?
If choose to do this anyways, each strategy's
performance will be a lie -- your real account
will most likely not reflect what the combined
strategy performances say it should.

-
And that's just two strategies!
And you want advice on running multiple
strategies on the same instrument in the
same account?
The results will be unpredictable.
Your strategy performance will be unreliable.
Your real world PnL will be hard to follow.
You'll lose faith in your strategies.
The best advice is don't do it.
But if you insist on trying ... good luck!

Comment
-
I mean, don't do it in one account.Originally posted by bltdavid View PostThe best advice is don't do it.
Don't allow one or more strategies to run
in the same account where by LONG and
SHORT positions could be entered for the
same instrument at the same time.
-=o=-
Is there an relatively easy way around that?
Yes, if you restrict all running strategy
instances to only take LONG positions,
or just SHORT positions, then you'll be
fine.
So, to do this right, you would only need
two separate accounts, one account is
dedicated to LONG positions, and the
other account is dedicated to SHORT
positions.
Then let 'em rip ... and you'll be safe,
and each strategy's performance will
be reliable.
My point is:
The best advice is to use two accounts.
Comment
-
bltdavid I do not understand your intentions in spamming this post with unsolicited advice. I have been running these strategies for close to a decade on a separate platform with no issues and expected results. Some instruments I trade have over a dozen strategies running on them simultaneously. Think of different strategies that have filters for different market regimes and different time frames can have different market structures so they are traded accordingly. I appreciate your concern with my PnL but I am not looking for advice on whether my approach is to your liking. I am looking for guidance on how to setup a similar structure within NT. The examples you gave are my exact expected behavior and I expect my account position to not be in sync with the strategies position. How can I start multiple strategies on the same instrument without trying to have the strategies sync account position?Last edited by proptradingshop; 03-07-2024, 08:08 AM.
Comment
-
Hello proptradingshop,
While you cannot prevent the strategies start behavior beng run you can add a condition to prevent the strategies from trading historically to avoid it entering into any trades before realtime. You could combine that with Immediately submit which assumes both the account and strategy position are where you want them before it starts.
Another approach would be to not use strategies and use indicators instead. Using the addon framework you can submit orders and monitor order events/account values. That would remove the strategy specific behaviors and let you work with the account directly. The downside to doing that is those would not be backtestable and you would also lose the isolated performance information that strategies have.Code:if(State == State.Historical) return;
Comment
-
NinjaTrader_Jesse Thank you for the suggestions, this is exactly what I was looking for. Appreciate the support.
Comment
-
NinjaTrader_Jesse One other related question I have is how can I make it so exit on session close only closes strategy position and not full account position?
Comment
-
Hello proptradingshop,
The strategies exit on session close should only exit positions that the individual strategy has, if you are seeing something else happening I would likely suggest to disable that feature and use time conditions instead. A time condition can be used to restrict entries to certain times of day, the same can be done to exit the strategies individual position after a certain time of day. There is a sample of limiting a window of time here: https://ninjatrader.com/support/help...ightsub=totime
You can also find a sample of creating a custom exit on session close logic in the unmanaged sample here: https://forum.ninjatrader.com/forum/...elp#post770579
Comment
-
NinjaTrader_Jesse So today one of my strategies with exit on session close marked true took on an equity position of 5L when I already had 300L. At the end of the session it closed all 305 instead of the 5L that was entered by the strategy...is this not expected behavior?
Comment
-
Hello proptradingshop,
Without knowing the strategies virtual position at that time it would be hard to say why that may have happened if you have more than 1 strategy running. For your described use case and because that goes beyond how strategies are intended to operate I would suggest to avoid the strategy based features like ExitOnClose and instead use your own logic to control exiting. That would allow you to target the individual virtual position using its Position object and quantity.
Comment
-
NinjaTrader_Jesse I only had 1 strategy running on the instrument. It was set to adopt account position...I am assuming this is the cause correct?
Comment
-
I wanted to use indiactors instead of strategies to be able to run multiple "strategies" on the same instrument. I wanted to use ATMstrategies inside the indicator. To start out I just took the SampleATM Strategy and tried to turn it into an indicator. When coding an indicator I always get the same error message: "GetAtmStrategyUniqueId does not exist in the current context." It's the same for all the AtmStrategy Methods. How can I call AtmStrategy Methods from within an indicator?Originally posted by NinjaTrader_Jesse View PostHello proptradingshop,
Another approach would be to not use strategies and use indicators instead. Using the addon framework you can submit orders and monitor order events/account values. That would remove the strategy specific behaviors and let you work with the account directly. The downside to doing that is those would not be backtestable and you would also lose the isolated performance information that strategies have.
Thanks for your help!
Comment
-
Hello HappyTrader76,
The ATM methods for strategies can only be used in a strategy, to use those methods you need to make a strategy instead of an indicator. If you want to use an indicator and ATM's you can submit them but you would not have any ability to control them or view their values like in a strategy, it would be best to maintain using a strategy for that use.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
71 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
143 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
76 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
47 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
51 views
0 likes
|
Last Post
|

Comment