It seems you are not the first (see below) but your post stood out more (for me at least):
Forum on trading, automated trading systems and testing trading strategies
Ahmad Mehdiyev, 2014.03.22 12:13
1. You cannot open opposite positions at the same time if your broker is in US. That is true. With other brokers it is possible.
2. The way you get opposite positions (if they are allowed by your broker) is quite simple :). You buy and then sell, or vice versa.
3. The difference in lot size or the time at which each order was opened does not matter as far as OrderCloseBy is concerned.
4. OrderCloseBy is ment to substitute the use of OrderSend, so submitting OrderSend is not required. Simpy use "Close By" or "Multiple Close By" from within the Order Entry window, or use a script if you have one.
5. You do save a spread. But once! Here how it works. When you buy you pay a spread. When you sell you pay a spread. If you close them separately you loose both of those spreads (well they are in your P&L already), but if you do OrderCloseBy you are able to get one of those spreads back since it matches the closing price with opening price of the second trade. Simply put it assumes that when you opened the opposite trade you closed out the first one at the price at the opening price of the matching order.
They way I use OrderCloseBy is when I have a multiple one-sided positions and need to close them all quick I just lock the complete position with one trade, and then OrderCloseBy them with that new matching order. Obviously if you don't have an ability to lock the position you must close the initial multiple positions one-by-one which in a fast market could be quite damaging.
Hope this helps, and I did not simply repeat the things you know already.
I have just realised that all the posts by @nicholishen with regards to OrderSendBy() implementation have been removed!
Why? I don't believe it was by the moderators, but instead by the poster himself!
Was his ego bruised for not being the first one to discover or implement that method of closing out a batch of orders?
Well, then, in that case, I do have to say that the attitude was somewhat infantile and egotistical for having resorted to taking such an action!
EDIT: It was wrong of me to pass judgement!
The reason I noticed the missing posts, was because there is another new thread asking about the OrderCloseBy() function and I was also going to "pocket" link his posts for that OP, so I ended up only providing one "pocket" link.
Thank you for the link. I will "pocket" your post on the other thread as well!
Then why was it a "group" effort? A say this because a few other posters also deleted their posts that were in reply to your posts.
EDIT: No need to answer. It really does not matter. What is done is done! It is best to just move on and not have this escalate any further.
Anyway, your posts, even thought it seems it was a very old topic, did help me learn something new.
So thank for that info, but take some advice and tone down the attitude!
Please enable the necessary setting in your browser, otherwise you will not be able to log in.