-
Notifications
You must be signed in to change notification settings - Fork 0
/
Relax.mq5
104 lines (83 loc) · 3.49 KB
/
Relax.mq5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//+------------------------------------------------------------------+
//| Relax.mq5 |
//| Copyright 2023, davdcsam |
//| https://github.com/davdcsam |
//+------------------------------------------------------------------+
#property copyright "Copyright 2023, DavdCsam"
#property link "https://github.com/davdcsam"
#property version "1.0"
#include "features\\timer.mqh"
#include "features\\send_order.mqh"
#include "features\\enum.mqh"
#include "features\\supertrend.mqh"
#include "features\\last_error.mqh"
void operation_module()
{
switch(st_count)
{
case 1:
if(st_color[2] == st_contrast_select_color && st_color[1] == st_select_color && st_color[0] == st_select_color)
{
trade_state = ON;
}
break;
case 2:
if(st_color[3] == st_contrast_select_color && st_color[2] == st_select_color && st_color[1] == st_select_color && st_color[0] == st_select_color)
{
trade_state = ON;
}
break;
case 3:
if(st_color[4] == st_contrast_select_color && st_color[3] == st_select_color && st_color[2] == st_select_color && st_color[1] == st_select_color && st_color[0] == st_select_color)
{
trade_state = ON;
}
break;
case 4:
if(st_color[5] == st_contrast_select_color && st_color[4] == st_select_color && st_color[3] == st_select_color && st_color[2] == st_select_color && st_color[1] == st_select_color && st_color[0] == st_select_color)
{
trade_state = ON;
}
break;
case 5:
if(st_color[6] == st_contrast_select_color && st_color[5] == st_select_color && st_color[4] == st_select_color && st_color[3] == st_select_color && st_color[2] == st_select_color && st_color[1] == st_select_color && st_color[0] == st_select_color)
{
trade_state = ON;
}
break;
default:
last_error = "Out Range in Swicth Operator / Operation Module [Max allowed 1-5]";
break;
}
if(trade_state == ON)
{
type_operation_function();
trade_state = OFF;
}
}
int OnInit()
{
supertrend_onint();
last_error_oninit();
return( INIT_SUCCEEDED );
}
void OnDeinit( const int reason )
{
}
void OnTick(void)
{
timer_ontick();
supertrend_ontick();
send_order_ontick();
if(remain_time == current_period)
{
operation_module();
}
Comment(
timer_string,
send_order_string,
st_string,
"\n",
" Last Error [ ", last_error, " ]"
);
}