Calculating Spread

Back to topics list To post a new topic, please log in or register
avatar
15
lovromirnik 2015.02.15 12:16
 

Hello fellow Traders,

would this be the correct way to calculate spread?

double BidPN; //Bid Price New
double AskPN; //Ask Price New
double SpreadC;

void OnTick()
   {
      BidPN = Bid;
      AskPN = Ask;
      SpreadC = MathAbs(AskPN - BidPN);
   }
avatar
2017
gooly 2015.02.15 13:20 #
 
You don't need MathAbs(Ask-Bid) as some brokers proudly presents their occasionally appearing negative spreads.
avatar
Moderator
3206
angevoyageur 2015.02.15 15:30 #
 
lovromirnik:

Hello fellow Traders,

would this be the correct way to calculate spread?

Or

SymbolInfoInteger(_Symbol,SYMBOL_SPREAD);

or

MarketInfo(_Symbol,MODE_SPREAD);
avatar
15
lovromirnik 2015.02.15 21:41 #
 
Thank you both for replying and confirming my code.
Back to topics list  

To add comments, please log in or register