Miscellaneous
0
Views
0
Downloads
0
Favorites
MTF_SnakeForce~
/*
Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Lime
#property indicator_color4 Red
extern int TimeFrame = 0;
extern int cPeriod = 24;
double g_ibuf_84[];
double g_ibuf_88[];
double g_ibuf_92[];
double g_ibuf_96[];
int init() {
double ld_12;
string ls_28;
string ls_unused_40;
int li_0 = 3 * cPeriod;
IndicatorBuffers(5);
SetIndexBuffer(0, g_ibuf_84);
SetIndexBuffer(1, g_ibuf_88);
SetIndexBuffer(2, g_ibuf_92);
SetIndexBuffer(3, g_ibuf_96);
SetIndexStyle(0, DRAW_HISTOGRAM, EMPTY, 2);
SetIndexStyle(1, DRAW_HISTOGRAM, EMPTY, 2);
SetIndexStyle(2, DRAW_HISTOGRAM);
SetIndexStyle(3, DRAW_HISTOGRAM);
SetIndexLabel(2, NULL);
SetIndexLabel(3, NULL);
SetIndexDrawBegin(0, li_0);
SetIndexDrawBegin(1, li_0);
SetIndexDrawBegin(2, li_0);
SetIndexDrawBegin(3, li_0);
double ld_4 = 1.0 * cPeriod * Period();
if (ld_4 < 60.0) {
ls_28 = DoubleToStr(ld_4, 0);
ls_28 = " M" + ls_28 + ", FORCE UP -DOWN ";
} else {
ld_4 /= 60.0;
if (ld_4 >= 24.0) {
ld_12 = MathAbs(MathRound(ld_4 / 24.0) - ld_4 / 24.0);
if (ld_12 < 0.01) {
ls_28 = DoubleToStr(ld_4 / 24.0, 0);
ls_28 = " D" + ls_28 + ", FORCE UP -DOWN ";
} else {
ls_28 = DoubleToStr(ld_4 / 24.0, 1);
ls_28 = " D" + ls_28 + ", FORCE UP -DOWN ";
}
} else {
ld_12 = MathAbs(MathRound(ld_4) - ld_4);
if (ld_12 < 0.01) {
ls_28 = DoubleToStr(ld_4, 0);
ls_28 = " H" + ls_28 + ", FORCE UP -DOWN ";
} else {
ls_28 = DoubleToStr(ld_4, 1);
ls_28 = " H" + ls_28 + ", FORCE UP -DOWN ";
}
}
}
switch (TimeFrame) {
case 1:
ls_unused_40 = "Period_M1";
break;
case 5:
ls_unused_40 = "Period_M5";
break;
case 15:
ls_unused_40 = "Period_M15";
break;
case 30:
ls_unused_40 = "Period_M30";
break;
case 60:
ls_unused_40 = "Period_H1";
break;
case 240:
ls_unused_40 = "Period_H4";
break;
case 1440:
ls_unused_40 = "Period_D1";
break;
case 10080:
ls_unused_40 = "Period_W1";
break;
case 43200:
ls_unused_40 = "Period_MN1";
break;
default:
ls_unused_40 = "Current Timeframe";
}
IndicatorShortName("SnakeForce[" + TimeFrame + "](" + cPeriod + ")" + ls_28);
return (0);
}
int start() {
int lia_0[];
int li_24;
int lia_28[];
int l_index_16 = 0;
int l_ind_counted_20 = IndicatorCounted();
ArrayCopySeries(lia_0, 5, Symbol(), TimeFrame);
int li_12 = Bars - l_ind_counted_20 + TimeFrame / Period();
int l_index_4 = 0;
l_index_16 = 0;
while (l_index_4 < li_12) {
if (Time[l_index_4] < lia_0[l_index_16]) l_index_16++;
g_ibuf_84[l_index_4] = iCustom(NULL, TimeFrame, "SnakeForce", cPeriod, 0, l_index_16);
g_ibuf_88[l_index_4] = iCustom(NULL, TimeFrame, "SnakeForce", cPeriod, 1, l_index_16);
g_ibuf_92[l_index_4] = iCustom(NULL, TimeFrame, "SnakeForce", cPeriod, 2, l_index_16);
g_ibuf_96[l_index_4] = iCustom(NULL, TimeFrame, "SnakeForce", cPeriod, 3, l_index_16);
l_index_4++;
}
if (TimeFrame > Period()) {
li_24 = TimeFrame / Period() + 1;
ArrayResize(lia_28, li_24);
ArrayCopySeries(lia_28, 5, Symbol(), Period());
for (l_index_4 = 0; l_index_4 < li_24 + 1; l_index_4++) {
if (lia_28[l_index_4] >= lia_0[0]) {
g_ibuf_84[l_index_4] = g_ibuf_84[0];
g_ibuf_88[l_index_4] = g_ibuf_88[0];
g_ibuf_92[l_index_4] = g_ibuf_92[0];
g_ibuf_96[l_index_4] = g_ibuf_96[0];
}
}
}
return (0);
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---