NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Miscellaneous Support > Historical Version 7 Beta Threads > Version 7 Beta General Questions & Bug Reports

Version 7 Beta General Questions & Bug Reports Ask questions here and post bug reports.

 
 
Thread Tools Display Modes
Old 03-27-2010, 10:50 PM   #1
taotree
Junior Member
 
Join Date: May 2008
Posts: 28
Thanks: 1
Thanked 0 times in 0 posts
Default Submitting long or short, ignore whether open or close

Working with the DOM, I can enter limit orders all over the place short or long regardless of what my current position is--long, short or flat.

I'm using the SubmitOrder, Unmanaged = true; mechanism. But if my position changes from flat to long and if I have a SellShort limit order already in place, it cancels it automatically: "Cancelled pending entry order on opposite side of the market:" it says, because now my position is long and the order was created (created when my position was flat by the way) with SellShort action.

I just want to enter limit orders to go short or long and ignore what my position is. Meaning, if a short is hit, my overall position decreases by one--meaning, if I'm flat, I'm now 1 short. If I was 10 short, now I'm 11 short. If I was 10 long, now I'm 9 long. Why does it seem this is so hard to do programmatically? It works fine on the DOM.

At this point, it seems I have to track every one of my orders and manually convert them from SellShort to Sell anytime my position changes. Horrible nuisance, that.

Is there some way to submit orders more simply and ignore whether they are to open positions vs. closing positions?
Last edited by taotree; 03-27-2010 at 10:53 PM.
taotree is offline  
Old 03-29-2010, 10:58 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Quote:
Originally Posted by taotree View Post
Working with the DOM, I can enter limit orders all over the place short or long regardless of what my current position is--long, short or flat.

I'm using the SubmitOrder, Unmanaged = true; mechanism. But if my position changes from flat to long and if I have a SellShort limit order already in place, it cancels it automatically: "Cancelled pending entry order on opposite side of the market:" it says, because now my position is long and the order was created (created when my position was flat by the way) with SellShort action.

I just want to enter limit orders to go short or long and ignore what my position is. Meaning, if a short is hit, my overall position decreases by one--meaning, if I'm flat, I'm now 1 short. If I was 10 short, now I'm 11 short. If I was 10 long, now I'm 9 long. Why does it seem this is so hard to do programmatically? It works fine on the DOM.

At this point, it seems I have to track every one of my orders and manually convert them from SellShort to Sell anytime my position changes. Horrible nuisance, that.

Is there some way to submit orders more simply and ignore whether they are to open positions vs. closing positions?

taotree,

I deleted the subsequent posts since we were going down the wrong path on your original post. Sorry for the wasted time, let me try and get on track.

- Unmanaged really means unmanaged and I believe that the automatic cancelling of the entry order to go short should not occur. Give us a few days to look into this.
- Its not clear if you are trading futures or equities (I suspect futures since you mention the DOM)
- If futures, the DOM does not care about marking orders with sell vs sellshort. All orders are marked as sell since brokers either take care or don't care, not sure which one.
- Equities is a different story since regulations require that orders are correctly marked as a sell or sellshort. You would need to check/try in real-time to see how your broker behaves. I know some brokers make this transparent to the client API application and correctly mark the order if sent in incorrectly, some reject, some hold on server etc...
- So...if you are trading futures, you might even be able to just send one order to sell 2 (1 to close, 1 to open) etc...

I hope this makes sense.
NinjaTrader_Ray is offline  
Old 03-29-2010, 11:13 AM   #3
taotree
Junior Member
 
Join Date: May 2008
Posts: 28
Thanks: 1
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Ray View Post
- Unmanaged really means unmanaged and I believe that the automatic cancelling of the entry order to go short should not occur. Give us a few days to look into this.
- Its not clear if you are trading futures or equities (I suspect futures since you mention the DOM)
- If futures, the DOM does not care about marking orders with sell vs sellshort. All orders are marked as sell since brokers either take care or don't care, not sure which one.
- Equities is a different story since regulations require that orders are correctly marked as a sell or sellshort. You would need to check/try in real-time to see how your broker behaves. I know some brokers make this transparent to the client API application and correctly mark the order if sent in incorrectly, some reject, some hold on server etc...
- So...if you are trading futures, you might even be able to just send one order to sell 2 (1 to close, 1 to open) etc...

I hope this makes sense.
Thank you! Extremely helpful! Yes, I'm trading futures. So the automatic cancelling is a bug. That's a relief, it seemed so strange.

Thanks!
taotree is offline  
Old 03-30-2010, 07:00 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

This issue will be fixed for our next beta update due in a few days. Please let us know if the issue is resoved. Thanks for your patience.
NinjaTrader_Ray is offline  
 

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
Long and Short ZendoZafu SuperDOM and other Order Entry Windows 1 07-10-2009 08:38 AM
How to enter long/short on close of a candle? pbastowski Automated Trading 1 02-26-2009 02:59 PM
..."And close any open short/long position" behealed Automated Trading 11 02-23-2009 10:52 AM
Long and short on same instrument swandro Strategy Analyzer 1 11-03-2008 08:58 AM
Using a Ninjascript, I am having trouble establishing a long once I close a short suitguy1 Strategy Development 3 07-30-2008 10:09 PM


All times are GMT -6. The time now is 01:14 AM.