MobinMQL/Indicators/Class/week-2-ind-2.mq5
2025-07-22 14:48:34 +03:00

67 lines
1.6 KiB
MQL5

//+------------------------------------------------------------------+
//| ProjectName |
//| Copyright 2020, CompanyName |
//| http://www.companyname.net |
//+------------------------------------------------------------------+
// struct
struct student
{
string name;
int age ;
double gpa;
};
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnInit()
{
student num_1 ;
student num_2 ;
num_1.name = "Ali";
num_1.age = 22;
num_1.gpa = 2.2 ;
num_2.name = "Taghi";
num_2.age= 30;
num_2.gpa = 3.8;
Print( " shomareye 1 , name : " , num_1.name);
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnCalculate(const int32_t rates_total,
const int32_t prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int32_t &spread[])
{
return(rates_total);
}
//+------------------------------------------------------------------+