Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

VATicks - MetaTrader 4 Library | MT4 EA Download - MetaTrader 4 Resources

author EAcpu | 2 reads | 0 comments |

Class for handling price movements in MetaTrader 4. It is suitable for creating EAs that make trading decisions based on price movement data analysis.

This class can calculate:

Examples of using this class in experts.

 #include

CTicks ticks; integer index; integer old index; double V0; //+------------------------------------------------------------------+
//|Expert initialization function |
//+------------------------------------------------------------------+
Integer initialization ()
{
  index = 15 ;
  old index = 0 ;
  V0= 0 ;
Return ( initialization successful );
} //+------------------------------------------------------------------+
//|Expert to initialize function |
//+------------------------------------------------------------------+
Blank solution initialization ( constant integer reason)
{

} //+------------------------------------------------------------------+
//|Expert check function |
//+------------------------------------------------------------------+
Blank check ()
{
  check.check( bid ); 
Integer count = Tick.TickCount();
if (count==index) 
  {
Integer T = Tick.TickTime(oldindex,count);
print ( "15 ticks of time = " ,T, "s" );
Double S = Tick.Length(oldindex,count);
print ( "distance of 15 ticks=" ,T, "s" );
Double V = Tick.Speed(oldindex,count);
print ( "speed of 15 ticks="" ,T, "s" );
Double A = Tick.Acceleration(oldindex,count);
print ( "Accelerate 15 ticks=" ,T, "s" );
Double Sr = Tick.EstimatedPath(oldindex,count,V0);
print ( "Still passable (estimated distance based on acceleration)" , sir, "view" );
Integer tr=Tick.Trend(oldindex,count);
if (tr==TREND_BUY) print ( "The direction of 15 basis points is up" );
if (tr==TREND_SELL) print ( "The direction of 15 basis points is down" );
if (tr==TREND_NO) print ( "The direction of 15 ticks is none" );
      oldindex = index;
      index += 16 ;
      V0=V;
  }  
 }

Attachment download

📎vaticks.mqh (6.51 KB)

Source: MQL5 #16154

Verification code Refresh