NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 08-03-2012, 07:04 PM   #1
Spiderbird
Member
 
Join Date: Apr 2012
Posts: 67
Thanks: 27
Thanked 8 times in 7 posts
Question Interactive Brokers - How to handle orders on reversals

Hi all,

This might not be the right place to post this. Apologies in advance if that's the case.

I'm putting the fInishing touches on an automated strategy that sends two seperate orders on trade reversals. For example, if I'm long SPY 50 shares and my stop price is hit, my strategy sends one order to close the existing trade, waits till that order is filled, and then places a second order to short SPY for 50 shares at market.

I originally coded my strategy this way to ensure proper order fills and market management at the cost of multiple broker fees (one for entry, one for exit).

However, could the above be achieved by simply sending a 100 share SPY short order to IB? It would, in theory, sell the existing 50 share SPY order, and leave the remaining 50 shares in the order for shorting.

Outside of Ninjatrader, this can be done in IB, and I *believe* the above example (selling 100 shares short) results in a single transaction fee in IB.

Can anyone at NT or another forum poster confirm this?
Thanks in advance as always for your time!

- SpIder
Spiderbird is offline  
Reply With Quote
Old 08-04-2012, 11:18 AM   #2
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Spiderbird,

This wouldn't be possible with the managed approach, however you might be able to do so with the unmanaged approach.

http://www.ninjatrader.com/support/h...d_approach.htm
NinjaTrader_AdamP is offline  
Reply With Quote
Old 08-04-2012, 01:33 PM   #3
Spiderbird
Member
 
Join Date: Apr 2012
Posts: 67
Thanks: 27
Thanked 8 times in 7 posts
Default

Hi Adam,

I forgot to mention in my original post that I'm currently using an unmanaged approach to send orders to IB. What I'm trying to do is confirm that the scenario I described in my original post was possible (i.e. has anyone had experience doing this).

The only other example I've seen of it being done is referenced on another website:
http://www.onestepremoved.com/category/ninjatrader/
Spiderbird is offline  
Reply With Quote
Old 08-05-2012, 11:06 AM   #4
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Spiderbird,

Yes, this appears to verify it is possible. I would assume so as well just judging by what I know of the unmanaged approach. You should be able to test it with the SIM101 account with commissions.
NinjaTrader_AdamP is offline  
Reply With Quote
The following user says thank you to NinjaTrader_AdamP for this post:
Old 08-06-2012, 02:27 AM   #5
Spiderbird
Member
 
Join Date: Apr 2012
Posts: 67
Thanks: 27
Thanked 8 times in 7 posts
Default

Hi Adam,

Yep, I've tried this in the Sim101 environment, and am going to test drive it tomorrow in the AM on the market open. Thanks for your input!

- Spider
Spiderbird is offline  
Reply With Quote
Old 08-06-2012, 03:29 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
Default

Should be working as intendend Spider, at least from your reading your implementation in unmanaged. Please let us know should you see any issues and a good start into the week.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Tags
automated trading, interactive brokers, multiple orders

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Interactive Brokers not receiveing Orders maxmaxwell Automated Trading 1 03-01-2012 01:24 AM
server side OCO orders when using interactive brokers RayQQ Connecting 1 12-28-2011 09:12 AM
Extended Orders to Interactive Brokers (IB) BillCh General Programming 3 09-03-2009 12:30 PM
Interactive brokers help for stop market orders clam61 Strategy Development 5 04-03-2009 02:25 PM
can NT handle advanced TS orders? DoveforUsAll Automated Trading 9 02-13-2006 01:23 PM


All times are GMT -6. The time now is 06:34 PM.