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
TD Ameritrade and OCO's
Collapse
X
-
TD Ameritrade and OCO's
Hi, I have multiple open positions and at the end of the day if they don't hit their respective Target/Stop, I would like cancel the linked OCO's and close the positions. I know TD Ameritrade makes things difficult, what would be the best way to do this? I've tried various ways but cant seem to get it to work. Any help would be great, thank you!Tags: None
-
Hello gupagoer,
Thanks for your post.
You could cancel the orders with Account.Cancel and then look for the cancellation of these orders in OnOrderUpdate before attempting to close the position, and this should work well with TDA.
Please see the example I have attached.Attached FilesJimNinjaTrader Customer Service
- Likes 1
-
Originally posted by NinjaTrader_Jim View PostHello gupagoer,
Thanks for your post.
You could cancel the orders with Account.Cancel and then look for the cancellation of these orders in OnOrderUpdate before attempting to close the position, and this should work well with TDA.
Please see the example I have attached.
Boxed position error:
Hi! I have a simple strategy on SPY, on a 5 minute timeframe were it Enters a Long position when MACD crosses above MACD(Avg) and Exits the position when the inverse occurs; and also Enters a Short Position when this latter occurs. Unfortunately it does the first part of the strategy, but after it has Exit the Long Position it
Comment
-
Hello rocker84,
Maybe the concept would be similar.. Instead of cancelling an order and waiting for the order to update as cancelled in OnOrderUpdate(), you would instead submit a market order to exit the position, then once the position updates in OnPositionUpdate() as flat, send the new limit or stop order in the opposite direction.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Skifree, Today, 03:41 AM
|
3 responses
12 views
0 likes
|
Last Post
by Skifree
Today, 12:03 PM
|
||
Started by traderqz, Yesterday, 09:06 AM
|
5 responses
32 views
0 likes
|
Last Post Today, 12:03 PM | ||
Started by guillembm, Today, 11:25 AM
|
1 response
6 views
0 likes
|
Last Post Today, 12:01 PM | ||
Started by owensd, 04-21-2024, 11:34 PM
|
9 responses
34 views
0 likes
|
Last Post Today, 11:59 AM | ||
Started by trilliantrader, 04-10-2024, 09:33 PM
|
7 responses
25 views
0 likes
|
Last Post Today, 11:56 AM |
Comment