MODE_SPREAD - page 2

 
Viffer:

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


Thanks. I konw that. You slipp...

Standart is not 3 pips, depend of bid and ask EURUSD=2, USDCAD=4;

But, What about ECN brokers?

They are giving you market price. Is the slippage also there?

My EA's are working on EC broker with Slippage = 0;

 
FXMan77:

But, What about ECN brokers?

They are giving you market price. Is the slippage also there?

My EA's are working on EC broker with Slippage = 0;


The answer is that it depends on your order size at the quoted market price.

If the other side of the trade is able to accept the volume behind your position then you won't/shouldn't see slippage with an ECN.
 
1005phillip:

The answer is that it depends on your order size at the quoted market price.

If the other side of the trade is able to accept the volume behind your position then you won't/shouldn't see slippage with an ECN.


Citi Group will not offset your mini account.

Broker is cooking your account in house. Slippage is uslest in market execution, maybe, with slippage broker making more money.

 
1005phillip:

It only tells you the spread to open a new long position and the spread to close an existing short position.

You pay the spread at the time of position open for longs. For short positions you pay the spread at the time of close for the position.

Since the time of close is a time in the future, you don't know the spread you are going to pay on the short position until you actually close it.


Why if I open long I pay 2 pips, I'm starting from -2,

If I open short I'm paying 2 pips too, start from -2...

I f I clossing short I don't see that broker is taking 2 pips.

 
FXMan77:


Why if I open long I pay 2 pips, I'm starting from -2,

If I open short I'm paying 2 pips too, start from -2...

I f I clossing short I don't see that broker is taking 2 pips.


Broker price feed is Bid and spread, not ask.

When you opened your long you paid the ask price, which was the bid price plus the spread at that time. That is why it is -2 at time of open. The spread can change all it wants but you've already paid it and when you close your long you will be closing it at the bid price (which is not affected by spread)

When you opened your short you paid only the bid price, no spread, but the floating value of your short position is based on the ask price, which is dependent on the bid + spread. The spread can change, when you go to close your short position the spread could be 5, not 2, in which case the spread you pay on the short position is 5 pips, not 2. But you won't know until you close the short.
 

Sorry do I have heard that we only pay the spread when we open longs?

I though we paid the spread twice one at oppening and one at closing.

Greetings

 
BeLikeWater:

Sorry do I have heard that we only pay the spread when we open longs?

I though we paid the spread twice one at oppening and one at closing.

Asked and answered, had you bothered to read the first response.
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.

You pay the spread at the time of position open for longs. For short positions you pay the spread at the time of close for the position.

Since the time of close is a time in the future, you don't know the spread you are going to pay on the short position until you actually close it.

 

I am attempting to calculate a maximum lot size.

My initial rule is to never trade over a certain percent of my free margin. Let's say 2%. That's my capital at risk.

At this point, I want to deduct brokerage fees etc.

In the case of a LONG, I can get the spread using MODE_SPREAD.

In the case of a SHORT, it appears I do not have that luxury.


So, in this case of a SHORT, I suppose I could use an "Average Spread" that I calculate on the fly to get a sense of what my lot size should be.

Any thoughts on this?

 
ToneGarot:

I am attempting to calculate a maximum lot size.

My initial rule is to never trade over a certain percent of my free margin. Let's say 2%. That's my capital at risk.

At this point, I want to deduct brokerage fees etc.

In the case of a LONG, I can get the spread using MODE_SPREAD.

In the case of a SHORT, it appears I do not have that luxury.


So, in this case of a SHORT, I suppose I could use an "Average Spread" that I calculate on the fly to get a sense of what my lot size should be.

Any thoughts on this?

The spread does not figure in the calculations of the amount risked in a trade. You use the difference between the price that the trade is opened at and the price that it is closed at.
 
GumRai:
The spread does not figure in the calculations of the amount risked in a trade. You use the difference between the price that the trade is opened at and the price that it is closed at.


"Risked" is past tense. That's not what I seek.

I am trying to calculate the maximum allowed position size before opening a trade.

My pseudo-code:

      // For now, let's go with 2%
      input double MAX_RISK_PERCENT_OF_TRADE = 2.0;

      // Capital at risk, in dollars
      double capitalAtRisk = AccountEquity() * ( MAX_RISK_PERCENT_OF_TRADE / 100 );
    
      // Deduct brokerage on the buy and sell
      // OANDA is purely spread, no fixed fee
      double maximumPermissibleRisk = capitalAtRisk - spreadCost;

      double lotSize = maximumPermissibleRisk / valuePerPip / stopLossPips;


For opening a long position, I can determine the spreadCost, easy peasy.

For a short position, I can . . . ?

Reason: