ubzen:
Ordercloseby() have been hunting me for a while now. [...] Can someone who is familiar with this function comment on it?Thanks JJC, I didn't know that. Well here's where the good ole telephone comes in handy :)
Thanks JJC, I didn't know that. Well here's where the good ole telephone comes in handy :)
[...] I guess what I'm asking is what is it doing?
It closes both orders while only one spread is 'payed' (one of the orders is closed with zero spread...).
How does it work?
It's a type of operation the platform supports... It's actually common to many other trading platforms.
Doesn't sound so attractive anymore. If I wanna close order A and save 1-spread. Opening order B which costs 1-spread. Then closing both orders simultaneously at a cost of only 1-spread instead of 2 doesn't sound like saving.
Now that I think about it, seem this technique was designed for someone who's hedging A & B from the very start. If this person is playing for interest rates, order A and B would be on different instruments.
Is there any good reason for someone to hedge the same instrument, starting at the same time?
Doesn't sound so attractive anymore. If I wanna close order A and save 1-spread. Opening order B which costs 1-spread. Then closing both orders simultaneously at a cost of only 1-spread instead of 2 doesn't sound like saving.
Is there any good reason for someone to hedge the same instrument,
starting at the same time?
Is there any good reason for someone to hedge the same instrument, starting at the same time?
FXCM have posted information about this (http://www.fxcm.co.uk/hedging.jsp), including a video (http://forex.acrobat.com/p82929619/).
However, you don't need the platform to support hedging in order to be able to trade this kind of strategy. It's just easier to manage (and easier to code) if the platform lets you have separate positions in opposite directions, rather than making you do the translation into a single order for your net position across the two sub-strategies. As gordon's said, it's a hornet nest, because lots of people don't seem to get the fact that it is still possible - but just more difficult and irritating - to run this kind of strategy if you can't place two separate opposing orders.
There is another reason for hedging, though it's not the good reason you asked for. If each order is treated as a separate position, instead of you simply having a single net position in an instrument at any given point in time, you can carry uncrystallised losses on your account - i.e. you can close winning trades, and leave losers running. Your account equity is unaffected by this, and remains the same in hedging and non-hedging scenarios, but your account balance is artificially inflated. Some people don't like no-hedging/MT5 because they're deluding themselves by concentrating on balance rather than equity, and no-hedging/MT5 thus suddenly makes their results appear a lot worse.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
From the book "If two market orders are opened for one symbol simultaneously, one of them being Buy and another one being Sell, they can be closed in one of two ways: you can close them consecutively, one by one, using OrderClose(); or you can close one of them by the other one using OrderCloseBy(). In terms of saving money, the second way is more preferable, because you will save one spread in closing orders by each other."
Ordercloseby() have been hunting me for a while now. I haven't had any practical examples to use it in but I'm thinking it's a nice way to save some pips. Would you need to close both orders (the buy and sell) to save the one pip? Can someone who is familiar with this function comment on it? Also, if anyone aware of a similar code or technique to save some $$ please provide as well. Thanks.