Download MetaTrader 5
To add comments, please log in or register
Subscribe to signals right in MetaTrader. It is easy!
Burkster
6
Burkster 2016.09.27 14:00 

Is there a way to calculate the Average number of Pips per tick?

I am new to coding in MQL4.

I would like to check in my code if there is a sudden fast movement against my trade and close it out if true.

 Thanks for any assistance.

Paul

Fernando Carreiro
1458
Fernando Carreiro 2016.09.27 14:25  

Average number of Pips per tick? Do you perhaps mean the the average delta price change between ticks?

Each tick (quote) is a bid/ask price at a particular time. So if you want to know the average (in this case a moving average) of change in price between one tick (price quote) and the next, you could use for example an EMA (exponential moving average) at the tick level of the tick price changes/deltas.

Another way is to look at the ATR (Average True Range) of the Bars (instead of the tick price deltas) and detect when the current bar has surpassed a certain amount of range in reference to the ATR of that time-frame.

Since you have not supplied source code or sufficient details, it is difficult to provide an exact and detailed answer.

whroeder1
13610
whroeder1 2016.09.27 17:51  
Burkster: Is there a way to calculate the Average number of Pips per tick?
Yes, calculate it.
int OnTick(){
   static double ave_tick_size = 0;
   static double last_tick = Bid;
   double change = MathAbs(last_tick - Bid);
   ave_tick_size += (change - ave_tick_size) / 100;  last_tick = Bid;
   :
/
To add comments, please log in or register