Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
2 ninjascript strategies run independently?
Collapse
X
-
2 ninjascript strategies run independently?
If I have 2 scripts running one is long the other short on the same instrument, I didn`t want them to offset eachother (close out the trade), as they both have their own stop loss and targets. is this possible with scripting?Tags: None
-
Hello jitterbug,
Thank you for your post.
Basic answer would be no, this is not possible. The strategies are managing their own internal account, they would not be able to know what position is currently being managed by another strategy or the account.
However, you could use the undocumented account collection to pull information on the account the strategies are running on. For example:
Code:foreach (Account acct in Cbi.Globals.Accounts) { if (acct.Positions != null) { PositionCollection positions = acct.Positions; foreach (Position pos in positions) { Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice); } }
-
Hi Patrick, not sure if I explained it right.
basically are you saying if I have one ninjascript strategy opened long in instrument A, and open another NS strat short in instrument A that when the short is executed by the price the trade will be closed round trip and i`ll be flat?
so you cannot hedge 2 separate open positions with their own stop losses with ninjascript..
Comment
-
I get your point Sledge. Although MBtrading say they offer hedging ability where one trade doesnt offset another, and I recall being able to run concurrent trades in different directions a fair while ago either on MB`s platform as well as GCI, i`m actually surprised I cannot do this natively through ATS on NT.
GCI hedging: Clients can open positions in the same instrument in opposite directions, without the positions offsetting and without using additional margin. Clients have complete control over whether they close or hedge their positions to reduce risk.
as well as guaranteed stop executions (no slippage).
anyway i`m surprised/disappointed that I can`t run multiple ATS concurrently on NT on a single instrument like thisLast edited by jitterbug; 10-20-2015, 09:02 PM.
Comment
-
You can do it. The display position would show what you want, but of course the physical position will reflect the reality of being flat.Originally posted by jitterbug View PostI get your point Sledge. Although MBtrading say they offer hedging ability where one trade doesnt offset another, and I recall being able to run concurrent trades in different directions a fair while ago either on MB`s platform as well as GCI, i`m actually surprised I cannot do this natively through ATS on NT.
GCI hedging: Clients can open positions in the same instrument in opposite directions, without the positions offsetting and without using additional margin. Clients have complete control over whether they close or hedge their positions to reduce risk.
as well as guaranteed stop executions (no slippage).
anyway i`m surprised/disappointed that I can`t run multiple ATS concurrently on NT on a single instrument like this
Just use 2 different DOMs.
ref: http://ninjatrader.com/support/forum...ad.php?t=50500
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
333 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment