Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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
-
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 pechtri, 06-22-2023, 02:31 AM
|
9 responses
122 views
0 likes
|
Last Post Today, 02:31 PM | ||
Started by frankthearm, 04-18-2024, 09:08 AM
|
16 responses
66 views
0 likes
|
Last Post Today, 02:17 PM | ||
Started by habeebft, Today, 01:18 PM
|
1 response
5 views
0 likes
|
Last Post Today, 02:03 PM | ||
Started by benmarkal, Today, 12:52 PM
|
2 responses
14 views
0 likes
|
Last Post
by benmarkal
Today, 02:00 PM
|
||
Started by f.saeidi, Today, 01:38 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:45 PM |
Comment