Why doesn't this EA only print changing Bids?

 
//+------------------------------------------------------------------+
//|                                                       Change.mq4 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

double BidPrevious;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

   if(Bid!=BidPrevious)
      Print(Bid);

   BidPrevious=Bid;

   RefreshRates(); // WHY DOESNT IT ONLY PRINT OUT CHANGING BIDS?


  }
//+------------------------------------------------------------------+

Need it to only print CHANGING BIDS; *NOT the same Bid TWICE IN A ROW*.

Tried everything from Symbol() to _Symbol to DoubleToString using BidCurrent and a couple of more variables, arrays, using || to compare to > or <, can't figure this simple thing out. It keeps printing same Bids 2 times in a row no matter what.

Any ideas? THX

 
Do you have it running on 2 charts with the same symbol?
 
Keith Watford:
Do you have it running on 2 charts with the same symbol?

Its on the strategy tester on EURUSD only

 
nadiawicket:

Its on the strategy tester on EURUSD only

Try: Print(DoubleToString(Bid));

 
iRick:

Try: Print(DoubleToString(Bid));

Had already tried this approach to no avail
 
nadiawicket:
Had already tried this approach to no avail

look for how to compare double types

 
   if(MathAbs(Bid-BidPrevious)>=_Point)
      Print(Bid);
 
Amir Yacoby:

look for how to compare double types

Many ways; what would your approach be?
 
Ernst Van Der Merwe:

Still repeats the same Bid 2 times in a row sometimes. .

Thought you had it !!

 
nadiawicket:
Many ways; what would your approach be?
Not many.
if(NormalizeDouble(Bid-BidPrevious,8)!=0)
  {
     Print(Bid);
     BidPrevious=Bid;  // only when printed
   }
* actually with _Point as suggested by Ernst might be more correct but still need to assign BidPrevious only when printed
 
Amir Yacoby:
Not many.
if(NormalizeDouble(Bid-BidPrevious,8)!=0)
  {
     Print(Bid);
     BidPrevious=Bid;  // only when printed
   }

AWESOME!!!!! That works!!!

Its all just 0 after Digits; why use 8? Working without it, but I'd like to know why you prefer 8? Much appreciated!!

Reason: