65 lines
2.7 KiB
MQL5
65 lines
2.7 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| Multiplicator.mq5 |
|
|
//| Copyright 2020, Thomas Schwabhaeuser |
|
|
//| schwabts@gmail.com |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Copyright 2020, Thomas Schwabhaeuser"
|
|
#property link "schwabts@gmail.com"
|
|
#define VERSION "0.5"
|
|
#property version VERSION
|
|
#property description "Multiplicator"
|
|
//--- input parameters
|
|
input int InpTopUps=1;
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
#include "Multiplicator.mqh"
|
|
//+------------------------------------------------------------------+
|
|
//| Global Variables |
|
|
//+------------------------------------------------------------------+
|
|
CMultiplicator calculator;
|
|
//+------------------------------------------------------------------+
|
|
//| Expert initialization function |
|
|
//+------------------------------------------------------------------+
|
|
int OnInit()
|
|
{
|
|
Print(MQLInfoString(MQL_PROGRAM_NAME)+" v"+VERSION);
|
|
//---
|
|
ResetLastError();
|
|
int x1=20;
|
|
int y1=20;
|
|
int x2=366; // width == 346 == GRID_COLS *86.5
|
|
int y2=166+InpTopUps*29; // height == 145 == (GRID_ROWS+1)*29
|
|
calculator.TopUpLevels(InpTopUps);
|
|
if(!calculator.Create(0, "Multiplicator", 0, x1, y1, x2, y2))
|
|
{
|
|
Print("Creating calculator failed. Error #", GetLastError());
|
|
return(-1);
|
|
}
|
|
calculator.Run();
|
|
//---
|
|
return(0);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| Expert deinitialization function |
|
|
//+------------------------------------------------------------------+
|
|
void OnDeinit(const int reason)
|
|
{
|
|
//---
|
|
calculator.Destroy(reason);
|
|
//---
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| ChartEvent function |
|
|
//+------------------------------------------------------------------+
|
|
void OnChartEvent(const int id,
|
|
const long &lparam,
|
|
const double &dparam,
|
|
const string &sparam)
|
|
{
|
|
//---
|
|
calculator.ChartEvent(id, lparam, dparam, sparam);
|
|
calculator.OnEventLine(id, lparam, dparam, sparam);
|
|
//---
|
|
}
|
|
//+------------------------------------------------------------------+
|