Download MetaTrader 5
To add comments, please log in or register
Looking for like-minded people? You will find lots of them on the Forum!
Tony
262
Tony 2008.12.12 22:09 

Hi


I was fascinated by the discussion provoked by phy on "What is a tick?" Basically, if a tick is an event, how can it have a size? What is the difference between MODE_TICKSIZE and MODE_POINT?


I use this to calculate postiion/order size:

//--------------------------------------------------------------------
// PosSize
// Returns the maximum position size, in lots, for given risk and margin
// - Returns -1 if the position size is smaller than the minimum order size due to stop distance
//           -2 if the position size is smaller than the minimum order size due to margin
// - Lots is of the primary currency.
// - RiskAmt & MarginAmt are in the account currency.
// - Entry and StopLoss are the prices actually bougth or sold at.
//--------------------------------------------------------------------
double PosSize( string Sym, double RiskAmt, double MarginAmt, double Entry, double StopLoss )
{
   double Lots, Lots1, Lots2;
   double RiskPips;
   double RateToAcc;
   double OrderAmt;
   double LotStep;
   double LotSteps;

   // limit according to stop-loss risk
   RiskPips = MathAbs( Entry - StopLoss ) / MarketInfo( Sym, MODE_TICKSIZE ); // or should this be "/ Point"?
   RateToAcc = MarketInfo( Sym, MODE_TICKVALUE );
   Lots1 = RiskAmt / ( RiskPips * RateToAcc );

   // limit according to margin requirement
   Lots2 = MarginAmt / MarketInfo( Sym, MODE_MARGINREQUIRED );  // given margin / margin cost of one lot
   
   // the lower of the two limits
   Lots = MathMin( Lots1, Lots2 );

   // round down to the nearest lot step
   LotStep = MarketInfo( Sym, MODE_LOTSTEP );
   LotSteps = MathFloor( Lots / LotStep );
   Lots = LotSteps * LotStep;
   
   // if too small return -1
   if( Lots < MarketInfo( Sym, MODE_MINLOT ) )
      if( Lots1 < Lots2 ) Lots = -1;
      else Lots = -2;
   
   return( Lots );
}


But should I use Point instead of MarketInfo( Sym, MODE_TICKSIZE )?


Any comments would be good.


Cheers

Jellybean

Alexander
2441
Alexander 2008.12.12 22:20  

Some brokers offer GOLD with one tick=10 point, some - 5 point.

Tony
262
Tony 2008.12.13 18:00  

Hi Roger


I think of the minimum movement in price being a pip and the smallest digit of price quote being a point. In the case of Gold, I would say one pip is 10 or 5 points. I still think of a tick as the arrival of price data, etc.


Perhaps I'm being too pedantic. My code works fine with the one currency pair I've used it on. I just want to be sure I've written it to be robust.


Cheers

Tony

Alexander
2441
Alexander 2008.12.13 22:19  
IMHO TICKSIZE=1pip exactly, but generally 1 tick it's just a new price, could be from one to few pips.
Tony
262
Tony 2008.12.16 09:38  

Hi Roger


Thanks for your comment.


What I will do it make an indicator to plot the TICKSIZE and compare it with Point for a range of currencies (and demo accounts). I'm guesing that they'll be the same.


Cheers

Jellybean

Ray
2650
Ray 2008.12.16 15:46  

Ticksize varies more with CFD and Futures

Tony
262
Tony 2008.12.17 08:11  

Thanks phy


Have I got it right?


Point or POINT_SIZE is a change of 1 in the least significant digit of the price.

TICK_SIZE is the smallest movement in the price quoted by the broker, which could be several points.


In this way TICK_SIZE is always a multiple of Point.


Cheers

Jellybean

Ray
2650
Ray 2008.12.17 16:01  
That sounds about right.
whroeder1
13929
whroeder1 2014.01.09 14:38  

Don't post to 5 year old posts

In currencies ticksize and point are usually identical. In metals they are not. Prices might be quoted as ddd.cc (point=0.01) but they change by multiples of 0.25 (ddd.00, ddd.25, ddd.50, ...)

Use ticksize as a ratios only for computing DeltaPerTick (risk) and for normalizing prices for pending orders.

Use pips2dbl converting pips to/from delta prices and pips2point. On 5 digit brokers a point is 1/10 pip.

Use point only for marketInfo to delta prices.

/
To add comments, please log in or register