API  Version 2.0.1
Low-Latency HFT API
 All Classes Functions Variables
sharedUtilities.h
1 #ifndef SHARED_UTILITIES_H
2 #define SHARED_UTILITIES_H
3 #include <sharedDefines.h>
4 #include <sharedCommands.h>
5 #include <sgSymbolDataDefines.h>
6 namespace API2
7 {
8 
13  {
14  public:
15 
22  template<class A,class B>
23  static void roundPriceToTick(A &price ,
24  CMD::OrderMode mode,
25  const B &symbolData)
26  {
27  UNSIGNED_LONG tickDeviation = price % symbolData.tickSize;
28  if( tickDeviation )
29  {
30  if( mode == CMD::OrderMode_BUY)
31  price -= tickDeviation;
32  else
33  price += (symbolData.tickSize - tickDeviation);
34  }
35 
36  }
37  };
38 
39 
40 }
41 #endif
static void roundPriceToTick(A &price, CMD::OrderMode mode, const B &symbolData)
roundPriceToTick
Definition: sharedUtilities.h:23
The SharedUtilities class.
Definition: sharedUtilities.h:12