Types of Variables – MQL4 for Complete Beginners Tutorial Part 2

In this second tutorial I will show you what variables look like in MT4. We will understand the concept of a variable being a box, where data is kept. Different types of boxes (variables) have the capacity to store different data. This notion is also discussed in the tutorial. We will look at the following types of variables:

  • int
  • double
  • string
  • bool
  • color
  • datetime

Get the full course here: https://www.forexboat.com/learn-mql4

Code For This Tutorial

Tutorial2.mq4:
//+------------------------------------------------------------------+
//| Tutorial2.mq4 |
//| Copyright 2014, ForexBoat |
//| http://www.forexboat.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, ForexBoat"
#property link "http://www.forexboat.com"
#property version "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
int myInteger1;
double myDouble1;
string myString1;
bool myBoolean1;
// color myColor1;
// datetime myDatetime1;

myInteger1 = 5;
myDouble1 = 10.56;
myString1 = "My name is Kirill";
myBoolean1 = True;

Alert(myInteger1);
Alert(myDouble1);
Alert(myString1);
Alert(myBoolean1);

// Alert("Hello World!");
}

 

What are you waiting for?

START LEARNING FOREX TODAY!

Tags:
share This:
Avatar
Muhammad Awais

Leave a Reply

Your email address will not be published. Required fields are marked *

What are you waiting for?

START LEARNING FOREX TODAY!

as seen on: