Point Value on GBPUSD vs Bid Ask price stream.

 

To understand the POINT, Digits and NormalizeDouble better, I tried to print these values along with Bid and Ask variables.

Print("Point Digits BidPrice AskPrice Bid & AskNormalizedValues POINTnormalizedValue and Bid PLUS POINT*PIPS- ",Point," ",Digits," ",Bid," ",Ask," ",NormalizeDouble(Bid,Digits)," ",NormalizeDouble(Ask,Digits)," ",NormalizeDouble(30*Point,Digits)," ",NormalizeDouble(Bid+30*Point,Digits));

GBPUSD,M5: Point Digits BidPrice AskPrice Bid & AskNormalizedValues POINTnormalizedValue and Bid PLUS POINT*PIPS- 0 5 1.639 1.6393 1.639 1.6393 0.0003 1.6393

Now My question

1. Why does it show Point as 0 ?

I thought if the SPREAD is a static value of 3 PIPS we will have

2. BID + SPREAD * POINT = ASK --- IS THIS CORRECT AT ALL ?

3. How do we write generic code that fits across currency pairs based on above predefined variables ?

This equation doesn't hold in the above printed example. because although it says DIGITS value is 5 and we know spread value is 3 PIPS but I need to use 30 as a multiplier with POINT because the Bid and Ask are quoted in 4 digits.

regards

skt

 

Hello skt

.

GBPUSD,M5: Point Digits BidPrice AskPrice Bid & AskNormalizedValues POINTnormalizedValue and Bid PLUS POINT*PIPS- 0 5 1.639 1.6393 1.639 1.6393 0.0003 1.6393

.

A suggestion for you:

What o/p do you prefer? above or below... (sure I did log copy then had to add newlines but nevertheless... ;)

It is easy to confuse self much by having ones eyes bounce left/right continuously from text/output

Errors easily made.

.

1. Why does it show Point as 0 ?

Read Print() docs again please. You will notice Print's default o/p width is ???

This 'issue' has come about due to 3,5 subpip pricing by some Brokers. Print() is pre... so 4 digits was ok...

of course norm'ing point is pointless! just did it for heck of it...

Please study DoubleToStr() for resolution - this catches out many and is massive headache until realize!

.

2. BID + SPREAD * POINT = ASK --- IS THIS CORRECT AT ALL ?

your answers will change IF you program generically.

.

3. How do we write generic code that fits across currency pairs based on above predefined variables ?

Suggest you do not assume symbol/broker values ie, SPREAD.

Use MarketInfo() - is what it's for, and that is also good clue to HowTo deal with generics...

.

hth

.

.

int start()
{
  Print("MarketInfo(Symbol(),MODE_SPREAD)=",MarketInfo(Symbol(),MODE_SPREAD));
  Print("Point=",Point,", NormalizeDouble(Point,Digits)=",NormalizeDouble(Point,Digits)
       ,", Digits=",Digits,", Bid=",Bid,", Ask=",Ask
       ,", NormalizeDouble(Bid,Digits)=",NormalizeDouble(Bid,Digits)
       ,", NormalizeDouble(Ask,Digits)=",NormalizeDouble(Ask,Digits)
       ,", NormalizeDouble(30*Point,Digits)=",NormalizeDouble(30*Point,Digits)
       ,", NormalizeDouble(Bid+30*Point,Digits)=",NormalizeDouble(Bid+30*Point,Digits));

return;
}

/*
2009.07.02 14:49:10 fred EURUSD,M30: 
Point=0, NormalizeDouble(Point,Digits)=0, Digits=5, Bid=1.4035, Ask=1.4037
, NormalizeDouble(Bid,Digits)=1.4035
, NormalizeDouble(Ask,Digits)=1.4037
, NormalizeDouble(30*Point,Digits)=0.0003
, NormalizeDouble(Bid+30*Point,Digits)=1.4038

2009.07.02 14:49:10 fred EURUSD,M30: MarketInfo(Symbol(),MODE_SPREAD)=18
*/
 
, NormalizeDouble(30*Point,Digits)=0.0003
, NormalizeDouble(Bid+30*Point,Digits)=1.4038
This is wrong on a 5 digit broker. What was meant was 30 pips.
It should have printed 0.0030 and 1.4065 or
It should have printed 0.00300 and 1.40650.
double pips2dbl = Point, pips2points=1;
if (Digits == 3 || Digits == 5) {pips2dbl *= 10.0; pips2points*=10;}
// NormalizeDouble(30*pips2dbl,Digits) should print 0.00300 (30 pips)
// NormalizeDouble(Bid+30*pips2dbl,Digits) should print 1.4065 (bid + 30 pips)
pips2dbl is used as max_spread
OrderClose(ticket, OrderLots(), Ask, 3*pips2points, Red);