| / | Forum |
|
PaulHister
2010.09.12 19:19
When I use MODE_SPREAD, does it count the spread to open a position or does it count the spread to open and close the position?
|
|
Enhancing the Quality of the Code with the Help of Unit Test Even simple programs may often have errors that seem to be unbelievable. "How could I create that?" is our first thought when such an error is revealed. "How can I avoid that?" is the second question which comes to our mind less frequently. It is impossible to create absolutely faultless code, especially in big projects, but it is possible to use technologies for their timely detection. The article describes how the MQL4 code quality can be enhanced with the help of the popular Unit Testing method. |
|
1005phillip
2010.09.12 19:40
It only tells you the spread to open a new long position and the spread to close an existing short position. |
|
PaulHister
2010.09.12 20:11
I'm still in trouble, not so fluent in english ;-) I mean, I open a position and I close it, Should I count: Spread = MarketInfo(sym, MODE_SPREAD); or Spread = MarketInfo(sym, MODE_SPREAD) * 2; |
|
1005phillip
2010.09.12 20:58
Spread = MarketInfo(sym, MODE_SPREAD); You only pay the spread once. Just be aware that the spread value computed with this method may not actually be the spread value you paid for your specific position (because spreads are variable, even for so-called fixed-spread brokers because they liberally take advantage of that fine print which says they will still change spreads during periods of high market volatility and/or low-liquidity)... |
|
PaulHister
2010.09.12 22:57
Thanks a lot 1005phillip for your answer! You help me a lot. Thanks again |
|
FXMan77
2010.09.13 00:04
1005phillip:
Spread = MarketInfo(sym, MODE_SPREAD); You only pay the spread once. Just be aware that the spread value computed with this method may not actually be the spread value you paid for your specific position (because spreads are variable, even for so-called fixed-spread brokers because they liberally take advantage of that fine print which says they will still change spreads during periods of high market volatility and/or low-liquidity)...
With ECN broker you are paying for spread + slippage. |
|
1005phillip
2010.09.13 00:49
FXMan77:
With ECN broker you are paying for spread + slippage. Slippage is a cost-adder, but that isn't germane to the OP. Are you inquiring as to how to determine the slippage, if any, paid on an order? If you want to start listing all the things you may end up paying for with an order then you definitely want to include slippage as well as rollover fees, swap debit or credt, and any round-trip commision/fees paid to the broker as well as fees paid to your signal provider and EA provider (when applicable) not too mention performance fees that might be assessed periodically (say monthly). And there may be some credits in there if you have referral bonuses kicking back a portion of the spread and so on. |
|
FXMan77
2010.09.13 03:28
1005phillip:
Slippage is a cost-adder, but that isn't germane to the OP. Are you inquiring as to how to determine the slippage, if any, paid on an order? If you want to start listing all the things you may end up paying for with an order then you definitely want to include slippage as well as rollover fees, swap debit or credt, and any round-trip commision/fees paid to the broker as well as fees paid to your signal provider and EA provider (when applicable) not too mention performance fees that might be assessed periodically (say monthly). And there may be some credits in there if you have referral bonuses kicking back a portion of the spread and so on.
Brokers are making money on spread Plus on Slippage, they can give you any spread and any slippage. You can start from -200pips e.g. |
|
1005phillip
2010.09.13 05:59
FXMan77:
Brokers are making money on spread Plus on Slippage, they can give you any spread and any slippage. You can start from -200pips e.g.
|
|
Viffer
2010.09.13 13:01
As phillip says, it's slightly off topic, but seeing as I think OP has
his answer... FXMan, you have asked about slippage before and I don't
think you understand it properly so let me try and explain. You are
quoted a Bid and an Ask. You want to buy so send an order to buy at the
quoted ask. But in the time it takes you to transmit and the broker to
place the order, the ask can sometimes change. So the price you were
quoted is no longer valid. You've had slippage. In ordersend the
slippage parameter gives the broker permission to go ahead and place the
trade if the slippage is less than the value you specified. Standard, I
believe, is 3 pips. If the price has slipped more than that, the broker
will not place the order and tell you re quote of invalid price.
Slippage is part of the game and is a cost you pay for being slow in a
fast market. V |
|
1005phillip
2010.09.13 15:52
In the theme of the movie pirates of the caribbean, our knowledge on what happens behind the scene regarding slippage slippage is more based on guidelines than on hard-rules per se. |