MT4 Elliot Wave
MT4 Elliot Wave

MT4 Elliot Wave最新版

更新日期:
2022-03-15
分类标签:
语言:
中文
平台:
没限制

99 人已下载 手机查看

/*
Generated by EX4-TO-MQ4 decompiler ONE FILE V4.0.217.1
EX4 ID : 838AF1728B9FEA5CA5528DAD081CBC9E
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright “”
//#property link “http://www.forex.hostmain.ru”

extern string Block_1 = “吾?溧眄 潆 耔耱屐?;
extern int History = 1000;
extern string Block_2 = “理嚯桤 磬 皴牝铕?;
extern int Begin_draw_down = 5;
extern int Begin_draw_up = 5;
extern int Sektor_bar = 13;
extern int f_period_draw = 1;
extern int clear_opposite = 4;
extern string Block_3 = “理嚯桤 磬 扈牮?忸腠?;
extern int Wawe_bar = 21;
extern bool f_draw_wawe_fibo = TRUE;
extern bool f_draw_target_level = TRUE;
extern string Block_4 = “理嚯桤 磬 篑蜞眍忸黜 磬犷?;
extern int DM_sdvig = 7;
extern int DM_xvost = 10;
extern string Block_5 = “理嚯桤 磬 镳铄牿棹 鲥?;
extern bool f_draw_mini_trend = false;

int MA_Per = 55;

int gia_184[10];
int gia_188[10];
int gi_192;
int gi_196;
int gi_200;
int gi_204;
int gi_208;
int gi_212;
int gia_216[10];
int gia_220[10];
int gia_224[10];
int gia_228[10];
int gia_232[10];
int gia_236[10];
int gia_240[7];
double gda_244[7];
int gia_248[7];
double gda_252[7];
int gia_256[10][5];
int gia_260[10][30];
double gda_264[10][30];
double gda_268[10][30];
double gda_272[10][30];
int gia_276[10][30];
int gia_280[10][5];
int gia_284[10][30];
double gda_288[10][30];
double gda_292[10][30];
double gda_296[10][30];
int gia_300[10][30];
int gia_304[10];
int gia_308[10];
int gia_312[10];
int gia_316[10];
int gi_320;
int g_count_324 = 0;
double gda_unused_328[10];
int gi_332 = 0;
int gi_336 = 0;
double gd_340;
double gd_348;
int gi_unused_356 = 0;
int g_time_360 = 0;
int gi_364 = 3;
int gi_368 = 3;
int gi_372 = 3;
int gi_376 = 3;
int gia_380[10];
string gs_384;
string gs_392;
int gi_400 = 0;
int gi_404;
int gi_408;
int gi_412 = 0;
int gi_unused_416 = 0;
int gi_420 = 0;
int gi_424 = 0;
double gd_428;
int gi_436 = 0;
int gi_440 = 0;
int gi_444 = 0;
int gi_448 = 0;
int gi_unused_452 = 0;
int gi_unused_456;
int gi_460;
int gi_unused_464;
int gi_468;
int gi_472;
int gi_476;
int gi_480;
int gi_unused_484;
bool gi_488;
int gia_492[10];
int gia_496[10];
int gia_500[10];
int g_count_504;
datetime gt_unused_508;
int gi_unused_512;
int gi_unused_516;
int gia_520[5];
int gia_524[5];

int gi_532 = 0;
int gi_536;
int gi_540;
int gi_544;
int gi_548 = 0;
int gia_552[10];
int gia_556[10];
int gia_560[10];
int gia_564[10];
int gi_568 = 0;
string gs_572 = “”;
string gs_580 = “”;
string gs_unused_588 = “”;
string gs_unused_596 = “”;
string gs_unused_604 = “”;
string gs_unused_612 = “”;
int gi_76 = 5;
int gi_80 = 0;
int g_error_84;
string g_name_88;
color g_color_96;
int gi_100 = 1;
int gi_104 = 1;
int gi_108;
int gi_112 = 1;
int gi_116 = 254;
int g_x_120;
int gi_124 = 1;
//******************
int var_76 = 0;
int var_80 = 0;
int var_84 = 0;
int var_88 = 0;
int var_92 = 0;
int var_96 = 0;
int var_100 = 0;
int var_104 = 0;
int var_108 = 0;
int var_112 = 0;
int var_116 = 0;
int var_120 = 0;
int var_124;
int var_128;
int var_132;
int var_136;
int var_140;
int var_144;
int var_148 = 0;
double var_152 = 1.618;
double var_160 = 2;
double var_168 = 2.618;
double var_176 = 4.235;
int var_184 = 1;
int var_188 = 0;
int var_192 = 0;
int var_196;
int var_200;
int var_204;
int var_208;
int var_212;
int var_216;
int var_220 = 0;
double var_224 = 1.618;
double var_232 = 2;
double var_240 = 2.618;
double var_248 = 4.235;
int var_256 = 1;
int var_260 = 0;
int var_264 = 0;
int I;
int var_272;
int arr_276[9];
int var_280 = Aqua;
double var_284;
double var_292;
double var_300;
int var_308;
int var_312;
int var_316 = 0;
int var_320 = 0;
int J;
int var_328;
int arr_332[9];
int var_336 = Aqua;
double var_340;
double var_348;
double var_356;
int var_364;
int var_368;
int var_372 = 0;
int var_376 = 0;
int var_380;
int var_384;
int var_388;
int var_392;
int arr_396[3,4];
double arr_400[3,4];
double arr_404[3,4];
int var_408;
int var_412;
int var_416;
int var_420;
int arr_424[3,4];
double arr_428[3,4];
double arr_432[3,4];
string var_436;
string var_444;
string var_452;
string var_460;
double var_468;
double var_476;
double var_484;
double var_492;
double var_500;
double var_508;
double var_516;
double var_524;
int var_532;
int var_536;
int var_540;
int var_544;
int var_548;
int var_552;
int var_556;
int var_560;
int var_564;
int var_568;
//*********************
int start() {
datetime l_time_0;
double ld_unused_4;
double ld_unused_20;
double ld_unused_28;
datetime l_time_36;
double ld_unused_48;
double ld_unused_56;
double ld_unused_64;
int l_global_var_72;
double ld_84;
if (gi_336 != 0) {
GlobalVariableSet(“MT4_Ekspert_start_” + gs_392 + gs_384, 0);
GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 0);
if (gi_568 == FALSE) {
gi_568 = TRUE;
//Comment(“务蜞眍?耧屦蜞. 暑?镳梓桧?”, gi_336);
}
return (0);
}
gi_536 = GetTickCount();
if (gi_412 == FALSE) {

if (IsTesting()) {
gi_420 = TRUE;
gi_532 = 0;
gi_424 = TRUE;
//Comment(“Ekspert_start : 义耱钼 疱骅?”);
gd_340 = High[0] – Low[0] + Point;
} else {
gi_420 = FALSE;
gi_532 = gi_320;
gi_424 = FALSE;
ld_84 = 0;
for (int li_80 = gi_320; li_80 >= 1; li_80–) ld_84 = ld_84 + High[li_80] – Low[li_80];
gd_340 = ld_84 / gi_320;
}
if (gi_420 == FALSE) {
GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 0);
GlobalVariableSet(“MT4_Ekspert_load_” + gs_392 + gs_384, 1);
GlobalVariableSet(“MT4_Ekspert_start_” + gs_392 + gs_384, 1);
}
gd_348 = gd_340 / Point;
gd_428 = gd_340 / 4.0;
if (gd_428 < Point) gd_428 = Point;
GlobalVariableSet(“MT4_f_sdvig” + gs_392 + gs_384, gd_428);
//Comment(“Ekspert_start : 软桷栲腓玎鲨 溧眄. 洛腓麒磬 耩邃礤泐 徉疣=”, DoubleToStr(gd_348, 0), ” 矬黻蝾?”);
g_time_360 = Time[gi_532 + 1];
g_count_324 = 0;
}
for (int i = gi_532; i >= 0; i–)
{
l_time_0 = Time[i];
ld_unused_4 = Open[i];
ld_unused_20 = Low[i];
ld_unused_28 = Close[i];
if (g_time_360 != Time[i + 1])
{
if (g_time_360 != Time[i + 2] && gi_424 == TRUE)
{
//Comment(“Ekspert_start : 朽琊 桉蝾痂?”);
for (gi_548 = 1; gi_548 < Bars; gi_548++)
if (g_time_360 == Time[gi_548]) break;
gi_532 = gi_548;
gi_424 = FALSE;
if (gi_420 == FALSE) GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 0);
//Comment(“Ekspert : 襄疱玎矬耜 镱 疣琊? 吾疣犷蜞螯 “, gi_548, ” 徉痤? 项耠邃龛?耵铕扈痤忄眄 徉?”, TimeToStr(Time[1], TIME_SECONDS), ” 项耠邃龛?钺疣犷蜞眄 徉?”, TimeToStr(g_time_360, TIME_SECONDS));
GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 0);
return (0);
}
//*************
ld_unused_48 = High[i + 1];
ld_unused_56 = Low[i + 1];
l_time_36 = Time[i + 1];
ld_unused_64 = Close[i + 1];
g_time_360 = l_time_36;
g_count_324++;
if (gi_448 != gi_440) gi_448 = gi_440;
if (gi_444 != gi_436) gi_444 = gi_436;

gi_436 = gt_d_wawe_sell(gia_240, gda_244, gi_192, i, gd_428, Wawe_bar, gi_436, f_draw_wawe_fibo, f_draw_target_level);
gi_440 = gt_d_wawe_buy(gia_248, gda_252, gi_196, i, gd_428, Wawe_bar, gi_440, f_draw_wawe_fibo, f_draw_target_level);

gi_unused_452 = 0;
//*************
if (f_draw_mini_trend == TRUE)
{
for (int ii = 1; ii <= 3; ii++)
{
gi_400 = gia_380[ii];
gt_trend_3_5_7_down(gi_400, ii, i, gia_228, gia_232, gia_236, gia_496);
gt_trend_3_5_7_up(gi_400, ii, i, gia_216, gia_220, gia_224, gia_500);
}
}
//*************
for (ii = 4; ii <= gia_380[0]; ii++)
{
gi_400 = gia_380[ii];
gia_560[ii] = gia_552[ii];

gia_552[ii] = gt_max(gia_308, gia_304, gia_256, gia_260, gda_264, gda_272, gda_268, gia_276, ii, i, gi_400, gi_408, g_count_324);
gt_max_draw(gia_552[ii], gia_184, gia_188, gia_256, gia_260, gda_264, gda_268, gia_276, ii, gi_400, g_count_324, i);

gia_564[ii] = gia_556[ii];

gia_556[ii] = gt_min(gia_316, gia_312, gia_280, gia_284, gda_288, gda_296, gda_292, gia_300, ii, i, gi_400, gi_404, g_count_324);
gt_min_draw(gia_556[ii], gia_184, gia_188, gia_280, gia_284, gda_288, gda_296, gia_300, ii, gi_400, g_count_324, i);

if (gia_256[ii][2] == 1 && gia_280[ii][2] == 1 && gia_276[ii][0] > gia_300[ii][0])
{
gia_280[ii][0] = gia_280[ii][1];
gia_280[ii][1] = 10;
gia_280[ii][2] = 0;
gia_280[ii][3] = 0;
gia_280[ii][4] = 0;
gia_316[ii] = 0;
gia_312[ii] = 0;
gt_sektor_clear_up(gi_400);
}
if (gia_256[ii][2] == 1 && gia_280[ii][2] == 1 && gia_300[ii][0] > gia_276[ii][0]) {
gia_256[ii][0] = gia_256[ii][1];
gia_256[ii][1] = 10;
gia_256[ii][2] = 0;
gia_256[ii][3] = 0;
gia_256[ii][4] = 0;
gia_308[ii] = 0;
gia_304[ii] = 0;
gt_sektor_clear_down(gi_400);
}
if (clear_opposite > 0 && gia_492[ii] == 0) {
if (gia_280[ii][1] == clear_opposite + 10) gia_492[ii] = 1;
else
if (gia_256[ii][1] == clear_opposite + 10) gia_492[ii] = 2;
}
if (clear_opposite > 0 && gia_280[ii][1] == clear_opposite + 10 && gia_492[ii] == 1) {
if (gda_296[ii][0] < gda_296[ii][gia_280[ii][1]]) {
gia_492[ii] = 2;
gia_256[ii][0] = gia_256[ii][1];
gia_256[ii][1] = 10;
gia_256[ii][2] = 0;
gia_256[ii][3] = 0;
gia_256[ii][4] = 0;
gia_308[ii] = 0;
gia_304[ii] = 0;
}
}
if (clear_opposite > 0 && gia_256[ii][1] == clear_opposite + 10 && gia_492[ii] == 2) {
if (gda_268[ii][0] > gda_268[ii][gia_256[ii][1]]) {
gia_492[ii] = 1;
gia_280[ii][0] = gia_280[ii][1];
gia_280[ii][1] = 10;
gia_280[ii][2] = 0;
gia_280[ii][3] = 0;
gia_280[ii][4] = 0;
gia_316[ii] = 0;
gia_312[ii] = 0;
}
}
}
//*************

gi_unused_456 = gi_460;
gi_unused_464 = gi_468;
if (gi_460 == 2) gi_468 = 0;
if (gi_468 == 2) gi_460 = 0;
gi_460 = gt_dm_nabor_sell(gi_460, gi_204, gi_208, DM_sdvig, i, gd_428, gia_524, gia_520);
gi_468 = gt_dm_nabor_buy(gi_468, gi_200, gi_208, DM_sdvig, i, gd_428, gia_524, gia_520);
if (gi_460 == 2)
{
gi_480 = 2;
gi_472 = 1;
gi_476 = 0;
gt_unused_508 = Time[i];
gi_488 = FALSE;
}
if (gi_468 == 2) {
gi_480 = 1;
gi_476 = 1;
gi_472 = 0;
gt_unused_508 = Time[i];
gi_488 = FALSE;
}
//*************
if (gi_480 == 2 && gi_472 == 1)
{
gi_472 = gt_dm_xvost_sell(gi_472, gi_212, DM_sdvig, DM_xvost, i, gd_428, gia_524);
if (gi_472 == 2) {
if (gi_420 == FALSE && i == 0 && gi_488 == FALSE)
//Alert(gs_392, “-“, gs_384, “(桃 time=”, TimeToStr(l_time_0, TIME_DATE|TIME_MINUTES), “) 羞?呐汤惺?抢屡胸磐. 谚沩嚯 磬 镳钿噫?耵铕扈痤忄?”);
g_count_504++;
gi_488 = TRUE;
}
}
//*************
if (gi_480 == 1 && gi_476 == 1)
{
gi_476 = gt_dm_xvost_buy(gi_476, gi_212, DM_sdvig, DM_xvost, i, gd_428, gia_520);
if (gi_476 == 2) {
if (gi_420 == FALSE && i == 0 && gi_488 == FALSE)
//Alert(gs_392, “-“, gs_384, “(桃 time=”, TimeToStr(l_time_0, TIME_DATE|TIME_MINUTES), “) 羞?呐汤惺?抢屡胸磐. 谚沩嚯 磬 镱牦镪?耵铕扈痤忄?”);
g_count_504++;
gi_488 = TRUE;
}
}
}
//*************
gi_540 = GetTickCount();
gi_544 = gi_540 – gi_536;

if (gi_420 == TRUE) gs_572 = “\nMT4_” + “GoodTrade” + ” ?蝈耱钼铎 疱骅戾.”;
else {
if (gi_424 == FALSE) gs_572 = “\nMT4_” + “GoodTrade” + ” 钺疣犷蜿?桉蝾痂?”;
else gs_572 = “\nMT4_” + “GoodTrade” + ” 泐蝾?(” + DoubleToStr(gi_544, 0) + ” 祚.)”;
}
//Comment(“佯邃龛?徉?磬 桉蝾痂?=”, DoubleToStr(gd_348, 0), ” 矬黻蜞?, gs_580, gs_572);
}
if (gi_424 == FALSE)
{
if (g_time_360 != Time[1])
{
for (gi_548 = 1; gi_548 < Bars; gi_548++)
if (g_time_360 == Time[gi_548]) break;
gi_532 = gi_548;
//Comment(“Ekspert : 襄疱玎矬耜 镱 疣琊?(?觐眦?鲨觌? z_dop=”, gi_548, ” T[1}=”, TimeToStr(Time[1], TIME_SECONDS), ” T[z_dop]=”, TimeToStr(Time[gi_548], TIME_SECONDS), ” old_bar=”, TimeToStr(g_time_360, TIME_SECONDS));
if (gi_420 == FALSE) GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 0);
} else {
if (gi_420 == FALSE) {
GlobalVariableSet(“MT4_Ekspert_start_” + gs_392 + gs_384, 0);
GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 1);
}
gi_424 = TRUE;
gi_532 = 0;
}
}
if (gi_332 == FALSE) {
gi_332 = TRUE;
}
gi_412 = TRUE;
return (0);
}

int init() {
bool li_24 = FALSE;
gs_392 = Symbol();
gs_384 = Period();
gi_320 = 200;
if (!IsTesting()) {
if (Bars – gia_380[4] < 5 * gia_380[4]) {
//Comment(“Ekspert_start : 湾 漕耱囹铟眍 徉痤?桉蝾痂?(“, Bars, “) 潆 疣犷螓. 朽犷蜞 耧屦蜞 玎忮瘌屙?”);
gi_336 = 2;
return (0);
}
if (History >= gi_320) gi_320 = History;
else //Comment(“Ekspert_start : 青溧眄铄 锣扈 觐腓麇耱忸 徉痤?桉蝾痂?戾睃 扈龛爨朦眍泐 珥圜屙?. 殃铕疱牝桊钼囗?镳钽疣祆铋 漕 “, gi_320, ” 徉痤?”);
if (gi_320 > Bars) {
gi_320 = Bars – (gia_380[4] + 50);
//Comment(“Ekspert_start : 暑腓麇耱忸 徉痤?桉蝾痂?犷朦 麇?徉痤?磬 沭圄桕? 殃铕疱牝桊钼囗?镳钽疣祆铋 漕 爨犟桁嚯钽?珥圜屙?=:”, gi_320, ” 徉痤?”);
}
}
int l_reason_0 = UninitializeReason();
if (l_reason_0 == REASON_PARAMETERS) {
//Comment(“Ekspert_start : 绣耱囵? 相疣戾蝠?猁腓 桤戾礤睇. C钺桢=”, l_reason_0);
li_24 = TRUE;
}
if (l_reason_0 == REASON_CHARTCHANGE) {
//Comment(“Ekspert_start : 绣耱囵? 谚焘铍 桦?镥痂钿 猁?桤戾砀? C钺桢=”, l_reason_0);
li_24 = TRUE;
}
if (l_reason_0 == REASON_RECOMPILE) {
//Comment(“Ekspert_start : 绣耱囵? 蓐耧屦?镥疱觐祜桦桊钼囗. C钺桢=”, l_reason_0);
li_24 = TRUE;
}
if (Begin_draw_down < 2) {
gi_408 = 2;
//Comment(“Ekspert_start : 相疣戾蝠-Begin_draw_down ?铠栳觐? 锐镳噔脲?镳铕囔祛??镳孱狃噻钼囗 ?”, gi_408);
} else gi_408 = Begin_draw_down;
if (Begin_draw_up < 2) {
gi_404 = 2;
//Comment(“Ekspert_start : 相疣戾蝠-Begin_draw_up ?铠栳觐? 锐镳噔脲?镳铕囔祛??镳孱狃噻钼囗 ?”, gi_404);
} else gi_404 = Begin_draw_up;
if (f_period_draw < 0 || f_period_draw > 13) {
gia_380[0] = 1;
//Comment(“Ekspert_start : 湾忮痦 镟疣戾蝠 f_period_draw. 玉蜞眍怆屙?镱 箪铍鬣龛?:”, gia_380[0]);
} else gia_380[0] = f_period_draw + 3;
gia_380[1] = 5;
gia_380[2] = 7;
gia_380[3] = 9;
if (f_draw_mini_trend == TRUE) //Comment(“Ekspert_start : 玉蜞眍怆屙?镥痂钿?潆 镳铄牿梃 鲥? 1-?”, gia_380[1], ” 2-?”, gia_380[2], ” 3-?”, gia_380[3]);
if (Sektor_bar < gia_380[3] + 2) {
Sektor_bar = gia_380[3] + 2;
//Comment(“Ekspert_start : 相疣戾蝠 – Sektor_bar 忖邃疙 ?铠栳觐?(扈龛爨朦眍 祛驽?猁螯 疣忮?”, Sektor_bar, “). 锐镳噔脲?镳铕囔祛??”, Sektor_bar);
}
double ld_16 = 2.0 * MathCeil((Sektor_bar – 1) / 2) + 1.0;
if (ld_16 != Sektor_bar && gia_380[0] > 3) {
gia_380[4] = Sektor_bar + 1;
//Comment(“Ekspert_start : 相疣戾蝠 – Sektor_bar 忖邃疙 ?铠栳觐? 锐镳噔脲?镳铕囔祛??镳孱狃噻钼囗 ?”, gia_380[4]);
} else gia_380[4] = Sektor_bar;
gi_364 = 1.618 * gia_380[4];
ld_16 = MathMod(gi_364 – 1, 2);
if (ld_16 != 0.0 && gia_380[0] > 4) gia_380[5] = gi_364 + 1;
else gia_380[5] = gi_364;
gi_368 = 2.618 * gia_380[4];
ld_16 = MathMod(gi_368 – 1, 2);
if (ld_16 != 0.0 && gia_380[0] > 5) gia_380[6] = gi_368 + 1;
else gia_380[6] = gi_368;
gi_372 = 3.618 * gia_380[4];
ld_16 = MathMod(gi_372 – 1, 2);
if (ld_16 != 0.0 && gia_380[0] > 6) gia_380[7] = gi_372 + 1;
else gia_380[7] = gi_372;
gi_376 = 4.236 * gia_380[4];
ld_16 = MathMod(gi_376 – 1, 2);
if (ld_16 != 0.0 && gia_380[0] > 7) gia_380[8] = gi_376 + 1;
else gia_380[8] = gi_376;
if (gia_380[0] == 3) //Comment(“Ekspert_start : 彦牝铕睇?囗嚯桤 铗觌疙. 鸯彐睇?镥痂钿钼 礤?”);
if (gia_380[0] == 4) //Comment(“Ekspert_start : 襄痂钿 潆 皴牝铕眍泐 囗嚯桤? “, gia_380[4], “. 鸯彐睇?镥痂钿钼 礤?”);
if (gia_380[0] == 5) //Comment(“Ekspert_start : 襄痂钿 潆 皴牝铕眍泐 囗嚯桤? “, gia_380[4], “. 鸯彐睇?镥痂钿?: 2-?”, gia_380[5]);
if (gia_380[0] == 6) //Comment(“Ekspert_start : 襄痂钿 潆 皴牝铕眍泐 囗嚯桤? “, gia_380[4], “. 鸯彐睇?镥痂钿?: 2-?”, gia_380[5], ” 3-?”, gia_380[6]);
if (gia_380[0] == 7) //Comment(“Ekspert_start : 襄痂钿 潆 皴牝铕眍泐 囗嚯桤? “, gia_380[4], “. 鸯彐睇?镥痂钿?: 2-?”, gia_380[5], ” 3-?”, gia_380[6], ” 4-?”, gia_380[7]);
if (gia_380[0] == 8) //Comment(“Ekspert_start : 襄痂钿 潆 皴牝铕眍泐 囗嚯桤? “, gia_380[4], “. 鸯彐睇?镥痂钿?: 2-?”, gia_380[5], ” 3-?”, gia_380[6], ” 4-?”, gia_380[7], ” 5-?”, gia_380[8]);
if (li_24 == TRUE) {
ObjectsDeleteAll(0, OBJ_TRIANGLE);
ObjectsDeleteAll(0, OBJ_TREND);
ObjectsDeleteAll(0, OBJ_ARROW);
ObjectsDeleteAll(0, OBJ_LABEL);
ObjectsDeleteAll(0, OBJ_TEXT);
if (f_draw_wawe_fibo) {
ObjectDelete(“MyFibo_sell-” + DoubleToStr(0, 0));
ObjectDelete(“MyFibo_buy-” + DoubleToStr(0, 0));
}
if (f_draw_target_level) {
ObjectDelete(“Target_up_” + DoubleToStr(3, 0));
ObjectDelete(“Target_up_” + DoubleToStr(4, 0));
ObjectDelete(“Target_down_” + DoubleToStr(3, 0));
ObjectDelete(“Target_down_” + DoubleToStr(4, 0));
}
WindowRedraw();
li_24 = FALSE;
}
gi_436 = 0;
gi_440 = 0;
gi_444 = 0;
gi_448 = 0;
gi_unused_452 = 0;
if (Wawe_bar < 9) {
Wawe_bar = 9;
//Comment(“Ekspert_start : 湾忮痦 镟疣戾蝠 Wawe_bar (礤 祛驽?猁螯 戾睃 9). 玉蜞眍怆屙?镱 箪铍鬣龛?:”, Wawe_bar);
}
ld_16 = MathMod(Wawe_bar – 1, 2);
if (ld_16 != 0.0) {
Wawe_bar++;
//Comment(“Ekspert_start : 湾忮痦 镟疣戾蝠 Wawe_bar (漕腈屙 猁螯 礤鞲蝽). 玉蜞眍怆屙?镱 箪铍鬣龛?:”, Wawe_bar);
}
for (int x = 0; x < 10; x++) {
gia_256[x][0] = 0;
gia_256[x][1] = 0;
gia_256[x][2] = 0;
gia_256[x][3] = 0;
gia_256[x][4] = 0;
gia_280[x][0] = 0;
gia_280[x][1] = 0;
gia_280[x][2] = 0;
gia_280[x][3] = 0;
gia_280[x][4] = 0;
gia_304[x] = 0;
gia_308[x] = 0;
gia_312[x] = 0;
gia_316[x] = 0;
gda_288[x][0] = 0;
gda_288[x][1] = 0;
gda_292[x][0] = 0;
gda_292[x][1] = 0;
gda_296[x][0] = 0;
gda_296[x][1] = 0;
gia_284[x][0] = 0;
gia_284[x][1] = 0;
gda_264[x][0] = 0;
gda_264[x][1] = 0;
gda_268[x][0] = 0;
gda_268[x][1] = 0;
gda_272[x][0] = 0;
gda_272[x][1] = 0;
gia_260[x][0] = 0;
gia_260[x][1] = 0;
gia_496[x] = 0;
gia_500[x] = 0;
}
gia_184[0] = 16776960;
gia_184[1] = 16776960;
gia_184[2] = 16776960;
gia_184[3] = 16776960;
gia_184[4] = 8388352;
gia_184[5] = 65535;
gia_184[6] = 16436871;
gia_184[7] = 14524637;
gia_184[8] = 9639167;
gia_184[9] = 6908265;
gia_188[0] = RGB(40, 40, 40);
gia_188[1] = RGB(40, 40, 40);
gia_188[2] = RGB(60, 60, 60);
gia_188[3] = RGB(80, 80, 80);
gia_188[4] = RGB(0, 83, 16);
gia_188[5] = RGB(94, 94, 0);
gia_188[6] = RGB(0, 70, 90);
gia_188[7] = RGB(81, 0, 81);
gia_188[8] = RGB(70, 20, 0);
gia_188[9] = 6908265;
gi_192 = 13353215;
gi_196 = 8388352;
gi_204 = 13353215;
gi_200 = 8388352;
gi_208 = 16776960;
gi_212 = RGB(255, 255, 128);
gia_216[0] = 3329330;
gia_216[1] = 3329330;
gia_216[2] = 32768;
gia_216[3] = 25600;
gia_220[0] = 16748574;
gia_220[1] = 16748574;
gia_220[2] = 13434880;
gia_220[3] = 9109504;
gia_224[0] = 15631086;
gia_224[1] = 15631086;
gia_224[2] = 14822282;
gia_224[3] = 13828244;
gia_228[0] = 3937500;
gia_228[1] = 17919;
gia_228[2] = 3937500;
gia_228[3] = 2237106;
gia_232[0] = 16748574;
gia_232[1] = 16748574;
gia_232[2] = 13434880;
gia_232[3] = 9109504;
gia_236[0] = 15631086;
gia_236[1] = 15631086;
gia_236[2] = 14822282;
gia_236[3] = 13828244;
gt_color_user(gia_184, gia_188, gi_192, gi_196, gi_204, gi_200, gi_208, gi_212, gia_216, gia_220, gia_224, gia_228, gia_232, gia_236);
gi_unused_512 = 0;
gi_unused_516 = 0;
g_count_504 = 0;
for (x = 0; x < 5; x++) {
gia_520[x] = 0;
gia_524[x] = 0;
}
gi_332 = FALSE;
gi_412 = FALSE;
gi_460 = 0;
gi_468 = 0;
gi_unused_456 = 0;
gi_unused_464 = 0;
gi_480 = 0;
gi_unused_484 = 0;
gi_488 = TRUE;
return (0);
}

int deinit() {
if (gi_420 == FALSE) {
//Comment(“腻桧桷栲腓玎鲨. 西桉蜿?沭圄桕?);
ObjectsDeleteAll(0, OBJ_TRIANGLE);
ObjectsDeleteAll(0, OBJ_TREND);
ObjectsDeleteAll(0, OBJ_ARROW);
ObjectsDeleteAll(0, OBJ_LABEL);
if (f_draw_wawe_fibo == TRUE) {
ObjectDelete(“MyFibo_sell-” + DoubleToStr(0, 0));
ObjectDelete(“MyFibo_buy-” + DoubleToStr(0, 0));
}
if (f_draw_target_level) {
ObjectDelete(“Target_up_” + DoubleToStr(3, 0));
ObjectDelete(“Target_up_” + DoubleToStr(4, 0));
ObjectDelete(“Target_down_” + DoubleToStr(3, 0));
ObjectDelete(“Target_down_” + DoubleToStr(4, 0));
}
} else //Comment(“腻桧桷栲腓玎鲨. 义耱钼 疱骅? 西桉蜿?沭圄桕?礤 镳铊玮钿栩?.”);
GlobalVariableSet(“MT4_Ekspert_load_” + gs_392 + gs_384, 0);
GlobalVariableSet(“MT4_Ekspert_start_” + gs_392 + gs_384, 0);
GlobalVariableSet(“MT4_Ekspert_work_” + gs_392 + gs_384, 0);
return (0);
}

int gt_color_user(int &aia_0[], int &aia_4[], int ai_unused_8, int ai_unused_12, int ai_unused_16, int ai_unused_20, int ai_unused_24, int ai_unused_28, int &aia_32[], int &aia_36[], int &aia_40[], int &aia_44[], int &aia_48[], int &aia_52[]) {
aia_0[0] = 16776960;
aia_0[1] = 16776960;
aia_0[2] = 16776960;
aia_0[3] = 16776960;
aia_0[4] = 8388352;
aia_0[5] = 65535;
aia_0[6] = 16436871;
aia_0[7] = 14524637;
aia_0[8] = 9639167;
aia_0[9] = 6908265;
aia_4[0] = RGB(40, 40, 40);
aia_4[1] = RGB(40, 40, 40);
aia_4[2] = RGB(60, 60, 60);
aia_4[3] = RGB(80, 80, 80);
aia_4[4] = RGB(0, 83, 16);
aia_4[5] = RGB(94, 94, 0);
aia_4[6] = RGB(0, 70, 90);
aia_4[7] = RGB(81, 0, 81);
aia_4[8] = RGB(70, 20, 0);
aia_4[9] = 6908265;
ai_unused_8 = 13353215;
ai_unused_12 = 8388352;
ai_unused_16 = 13353215;
ai_unused_20 = 8388352;
ai_unused_24 = 16776960;
ai_unused_28 = RGB(255, 255, 128);
aia_32[0] = 3329330;
aia_32[1] = 3329330;
aia_32[2] = 32768;
aia_32[3] = 25600;
aia_36[0] = 16748574;
aia_36[1] = 16748574;
aia_36[2] = 13434880;
aia_36[3] = 9109504;
aia_40[0] = 15631086;
aia_40[1] = 15631086;
aia_40[2] = 14822282;
aia_40[3] = 13828244;
aia_44[0] = 3937500;
aia_44[1] = 17919;
aia_44[2] = 3937500;
aia_44[3] = 2237106;
aia_48[0] = 16748574;
aia_48[1] = 16748574;
aia_48[2] = 13434880;
aia_48[3] = 9109504;
aia_52[0] = 15631086;
aia_52[1] = 15631086;
aia_52[2] = 14822282;
aia_52[3] = 13828244;
return (0);
}

int RGB(int red_value,int green_value,int blue_value)
{
//—- check parameters
if(red_value<0) red_value=0;
if(red_value>255) red_value=255;
if(green_value<0) green_value=0;
if(green_value>255) green_value=255;
if(blue_value<0) blue_value=0;
if(blue_value>255) blue_value=255;
//—-
green_value<<=8;
blue_value<<=16;
return(red_value+green_value+blue_value);
}
//*****************

//+——————————————————————+

int gt_dm_xvost_sell(int inp_gtdmxs_0, int clr, int inp_gtdmxs_8, int inp_gtdmxs_12, int shift, double inp_gtdmxs_20, int& array[])
{
int i;
int j;
double close;
double high;
double low;
double open;
int time;

close = Close[shift + 1];
time = Time[shift + 1];
high = High[shift + 1];
low = Low[shift + 1];
open = Open[shift + 1];

if (array[2] == 0) array[1] = 0;
array[2]++;
i = shift + 2;
var_80 = array[0] + array[2];
j = iLowest(NULL,0,MODE_LOW,var_80 – 1,i);

if (close < Low[j])
{
//gt_move_simvol(0,”DM-xvost-reset-“,array[4],clr,253,2,time,Low[j]);
//ObjectDelete(“DM-sell-begin-” + DoubleToStr(array[4],0));
//ObjectDelete(“DM-sell-price-” + DoubleToStr(array[4],0));*/
for (i = array[3]; i > 0; i–)
{
ObjectDelete(“DM-xvost-sell-” + DoubleToStr(i,0) + DoubleToStr(array[4],0));
}
array[0] = 0;
array[1] = 0;
array[2] = 0;
array[3] = 0;
return(0);
}

if (array[1] == 0)
{
for (j = inp_gtdmxs_8; j <= var_80; j++)
{
if (close <= Low[shift + j]) break;
}
if (j <= var_80)
{
//gt_move_simvol(0,”DM-sell-begin-“,array[4],clr,252,2,time,low – 3 * inp_gtdmxs_20);
//gt_move_text(0,”DM-sell-price-“,array[4],clr,DoubleToStr(close,Digits),10,”Verdana”,time,low – inp_gtdmxs_20 * 6.0);
array[1] = 1;
}
}

if (array[1] == 0) return(1);

if (close > High[shift + inp_gtdmxs_8 – 1])
{
array[3]++;
if (array[3] < inp_gtdmxs_12)
{
//gt_move_text(0,”DM-xvost-sell-” + DoubleToStr(array[3],0),array[4],clr,DoubleToStr(array[3],0),10,”Verdana”,time,high + inp_gtdmxs_20 * 8.0);
}
}

if (array[3] == inp_gtdmxs_12)
{
gt_move_simvol(0,”DM-xvost-sell-end-“,array[4],clr,202,2,time,high + inp_gtdmxs_20 * 4.5);
gt_move_text(0,”DM-xvost-sell-p-end-“,array[4],clr,DoubleToStr(close,Digits),10,”Verdana”,time,high + inp_gtdmxs_20 * 8.0);
array[0] = 0;
array[1] = 0;
array[2] = 0;
array[3] = 0;
array[4]++;
return(2);
}
return(1);
}

//+——————————————————————+

int gt_dm_xvost_buy(int inp_gtdmxb_0, int clr, int inp_gtdmxb_8, int inp_gtdmxb_12, int shift, double inp_gtdmxb_20, int& array[])
{
int i;
int j;
double close;
double high;
double low;
double open;
int time;

close = Close[shift + 1];
time = Time[shift + 1];
high = High[shift + 1];
low = Low[shift + 1];
open = Open[shift + 1];

if (array[2] == 0) array[1] = 0;
array[2]++;
i = shift + 2;
var_96 = array[0] + array[2];
j = iHighest(NULL,0,MODE_HIGH,var_96 – 1,i);

if (close > High[j])
{
//gt_move_simvol(0,”DM-xvost-reset-“,array[4],clr,253,2,time,High[j]);
//ObjectDelete(“DM-buy-begin-” + DoubleToStr(array[4],0));
//ObjectDelete(“DM-buy-price-” + DoubleToStr(array[4],0));
for (i = array[3]; i > 0; i–)
{
ObjectDelete(“DM-xvost-buy-” + DoubleToStr(i,0) + DoubleToStr(array[4],0));
}
array[0] = 0;
array[1] = 0;
array[2] = 0;
array[3] = 0;
return(0);
}

if (array[1] == 0)
{
for (j = inp_gtdmxb_8; j <= var_96; j++)
{
if (close >= High[shift + j]) break;
}
if (j <= var_96)
{
//gt_move_simvol(0,”DM-buy-begin-“,array[4],clr,252,2,time,high + inp_gtdmxb_20 * 4.0);
//gt_move_text(0,”DM-buy-price-“,array[4],clr,DoubleToStr(close,Digits),10,”Verdana”,time,high + inp_gtdmxb_20 * 7.0);
array[1] = 1;
}
}

if (array[1] == 0) return(1);

if (close < Low[shift + inp_gtdmxb_8 – 1])
{
array[3]++;
if (array[3] < inp_gtdmxb_12)
{
//gt_move_text(0,”DM-xvost-buy-” + DoubleToStr(array[3],0),array[4],clr,DoubleToStr(array[3],0),10,”Verdana”,time,low – inp_gtdmxb_20 * 7.0);
}
}

if (array[3] == inp_gtdmxb_12)
{
gt_move_simvol(0,”DM-xvost-buy-end-“,array[4],clr,200,2,time,low – inp_gtdmxb_20 * 4.0);
gt_move_text(0,”DM-xvost-buy-p-end-“,array[4],clr,DoubleToStr(close,Digits),10,”Verdana”,time,low – inp_gtdmxb_20 * 7.0);
array[0] = 0;
array[1] = 0;
array[2] = 0;
array[3] = 0;
array[4]++;
return(2);
}
return(1);
}

//+——————————————————————+

int gt_dm_nabor_buy(int inp_gtdmnb_0, int inp_gtdmnb_4, int inp_gtdmnb_8, int inp_gtdmnb_12, int shift, double inp_gtdmnb_20, int& sarray[], int& barray[])
{
int var_gtdmnb_36;
int i;
int var_gtdmnb_44;
int time;
double close;
double low;
double high;

time = Time[shift + 1];
close = Close[shift + 1];
low = Low[shift + 1];
high = High[shift + 1];

if ((inp_gtdmnb_0 == 0) && (var_108 != 0))
{
if (var_108 >= inp_gtdmnb_12)
{
for (i = 1; i <= var_108; i++)
{
ObjectDelete(“DM-buy_temp-” + DoubleToStr(i,0));
}
}
var_108 = 0;
}
else
{
if ((close >= High[iHighest(NULL,0,MODE_HIGH,var_108,shift + var_108)]) && (var_108 > 1))
{
if (var_108 >= inp_gtdmnb_12)
{
for (i = 1; i <= var_108; i++)
{
ObjectDelete(“DM-buy_temp-” + DoubleToStr(i,0));
}
}
var_108 = 0;
return(0);
}
}

if (Close[shift + inp_gtdmnb_12 + 1] > close)
{
if ((var_108 == 0) && (Close[shift + 2 + inp_gtdmnb_12] > Close[shift + 2])) return(0);
var_108++;
if (var_108 == inp_gtdmnb_12)
{
for (i = var_108; i >= 1; i–)
{
//gt_move_text(0,”DM-buy_temp-“,var_108 – i + 1,inp_gtdmnb_4,DoubleToStr(var_108 – i + 1,0),10,”Verdana”,Time[shift + i],Low[shift + i] – inp_gtdmnb_20);
}
}
if (var_108 > inp_gtdmnb_12)
{
var_gtdmnb_36 = var_108 / 10;
var_gtdmnb_44 = var_108 – var_gtdmnb_36 * 10;
//gt_move_text(0,”DM-buy_temp-“,var_108,inp_gtdmnb_4,DoubleToStr(var_gtdmnb_44,0),10,”Verdana”,time,low – inp_gtdmnb_20);
}
return(1);
}

if (var_108 >= inp_gtdmnb_12)
{
for (i = 1; i <= var_108; i++)
{
ObjectDelete(“DM-buy_temp-” + DoubleToStr(i,0));
}
}

if (var_108 < inp_gtdmnb_12 + 5)
{
var_108 = 0;
return(0);
}

var_gtdmnb_36 = 1;
for (i = var_108; i >= 1; i–)
{
if (var_gtdmnb_36 == 10) var_gtdmnb_36 = 0;
//gt_move_text(0,”DM-buy-” + DoubleToStr(var_108 – i + 1,0) + “-“,var_112,inp_gtdmnb_8,DoubleToStr(var_gtdmnb_36,0),10,”Verdana”,Time[shift + i + 1],Low[shift + i + 1] – inp_gtdmnb_20);
var_gtdmnb_36++;
}

//ObjectDelete(“DM-sell-begin-” + DoubleToStr(sarray[4],0));
//ObjectDelete(“DM-buy-begin-” + DoubleToStr(barray[4],0));
//ObjectDelete(“DM-sell-price-” + DoubleToStr(sarray[4],0));
//ObjectDelete(“DM-buy-price-” + DoubleToStr(barray[4],0));

for (i = barray[3]; i > 0; i–)
{
ObjectDelete(“DM-xvost-buy-” + DoubleToStr(i,0) + DoubleToStr(barray[4],0));
}

for (i = sarray[3]; i > 0; i–)
{
ObjectDelete(“DM-xvost-sell-” + DoubleToStr(i,0) + DoubleToStr(sarray[4],0));
}

barray[0] = var_108;
barray[1] = 0;
barray[2] = 0;
barray[3] = 0;
sarray[0] = 0;
sarray[1] = 0;
sarray[2] = 0;
sarray[3] = 0;
var_108 = 0;
var_112++;
return(2);
}

//+——————————————————————+

int gt_dm_nabor_sell(int inp_gtdmns_0, int inp_gtdmns_4, int inp_gtdmns_8, int inp_gtdmns_12, int shift, double inp_gtdmns_20, int& sarray[], int& barray[])
{
int var_gtdmns_36;
int i;
int var_gtdmns_44;
int time;
double close;
double low;
double high;

time = Time[shift + 1];
close = Close[shift + 1];
low = Low[shift + 1];
high = High[shift + 1];

if ((inp_gtdmns_0 == 0) && (var_116 != 0))
{
if (var_116 >= inp_gtdmns_12)
{
for (i = 1; i <= var_116; i++)
{
ObjectDelete(“DM-sell_temp-” + DoubleToStr(i,0));
}
}
var_116 = 0;
}
else
{
if ((close <= Low[iLowest(NULL,0,MODE_LOW,var_116,shift + var_116)]) && (var_116 > 1))
{
if (var_116 >= inp_gtdmns_12)
{
for (i = 1; i <= var_116; i++)
{
ObjectDelete(“DM-sell_temp-” + DoubleToStr(i,0));
}
}
var_116 = 0;
return(0);
}
}

if (Close[shift + inp_gtdmns_12 + 1] < close)
{
if ((var_116 == 0) && (Close[shift + inp_gtdmns_12 + 2] < Close[shift + 2])) return(0);
var_116++;
if (var_116 == inp_gtdmns_12)
{
for (i = var_116; i >= 1; i–)
{
//gt_move_text(0,”DM-sell_temp-“,var_116 – i + 1,inp_gtdmns_4,DoubleToStr(var_116 – i + 1,0),10,”Verdana”,Time[shift + i],High[shift + i] + 2 * inp_gtdmns_20);
}
}
if (var_116 > inp_gtdmns_12)
{
var_gtdmns_36 = var_116 / 10;
var_gtdmns_44 = var_116 – var_gtdmns_36 * 10;
//gt_move_text(0,”DM-sell_temp-“,var_116,inp_gtdmns_4,DoubleToStr(var_gtdmns_44,0),10,”Verdana”,time,high + 2 * inp_gtdmns_20);
}
return(1);
}

if (var_116 >= inp_gtdmns_12)
{
for (i = 1; i <= var_116; i++)
{
ObjectDelete(“DM-sell_temp-” + DoubleToStr(i,0));
}
}

if (var_116 < inp_gtdmns_12 + 5)
{
var_116 = 0;
return(0);
}

var_gtdmns_36 = 1;
for (i = var_116; i >= 1; i–)
{
if (var_gtdmns_36 == 10) var_gtdmns_36 = 0;
//gt_move_text(0,”DM-sell-” + DoubleToStr(var_116 – i + 1,0) + “-“,var_120,inp_gtdmns_8,DoubleToStr(var_gtdmns_36,0),10,”Verdana”,Time[shift + i + 1],High[shift + i + 1] + 2 * inp_gtdmns_20);
var_gtdmns_36++;
}

//ObjectDelete(“DM-sell-begin-” + DoubleToStr(sarray[4],0));
//ObjectDelete(“DM-buy-begin-” + DoubleToStr(barray[4],0));
//ObjectDelete(“DM-sell-price-” + DoubleToStr(sarray[4],0));
//ObjectDelete(“DM-buy-price-” + DoubleToStr(barray[4],0));

for (i = barray[3]; i > 0; i–)
{
//ObjectDelete(“DM-xvost-buy-” + DoubleToStr(i,0) + DoubleToStr(barray[4],0));
}

for (i = sarray[3]; i > 0; i–)
{
ObjectDelete(“DM-xvost-sell-” + DoubleToStr(i,0) + DoubleToStr(sarray[4],0));
}

sarray[0] = var_116;
sarray[1] = 0;
sarray[2] = 0;
sarray[3] = 0;
barray[0] = 0;
barray[1] = 0;
barray[2] = 0;
barray[3] = 0;
var_116 = 0;
var_120++;
return(2);
}

//+——————————————————————+

int gt_d_wawe_sell(int& tarray[], double& parray[], int clr, int shift, double inp_gtdws_16, int inp_gtdws_24, int mode, bool inp_gtdws_32, bool inp_gtdws_36)
{
int i;
int var_gtdws_44;
int var_gtdws_48;
int var_gtdws_52;
int var_gtdws_56;
int var_gtdws_60;
double var_gtdws_64;
double var_gtdws_72;
double var_gtdws_80;
double var_gtdws_88;
double low;
double high;
double close;
int time;

low = Low[shift + 1];
close = Close[shift + 1];
time = Time[shift + 1];
high = High[shift + 1];

while (var_184 == 1)
{
switch (mode)
{
case 0:
var_188 = 0;
var_gtdws_48 = MathCeil(inp_gtdws_24 * 0.618);
i = MathMod(var_gtdws_48 – 1,2);
if (i != 0) var_124 = var_gtdws_48 + 1; else var_124 = var_gtdws_48;
var_gtdws_48 = MathCeil(var_124 * 0.618);
i = MathMod(var_gtdws_48 – 1,2);
if (i != 0) var_128 = var_gtdws_48 + 1; else var_128 = var_gtdws_48;
var_132 = inp_gtdws_24;
var_136 = var_124;
var_gtdws_48 = MathCeil(inp_gtdws_24 * 1.618);
i = MathMod(var_gtdws_48 – 1,2);
if (i != 0) var_140 = var_gtdws_48 + 1; else var_140 = var_gtdws_48;
var_144 = inp_gtdws_24;
var_gtdws_48 = (inp_gtdws_24 – 1) / 2 + 1 + shift;
var_gtdws_52 = iHighest(NULL,0,MODE_HIGH,inp_gtdws_24,shift);
if (var_gtdws_52 == var_gtdws_48)
{
tarray[0] = Time[var_gtdws_52];
parray[0] = High[var_gtdws_52];
gt_move_simvol(0,”T-0 (sell)-“,var_192,clr,139,2,tarray[0],parray[0] + inp_gtdws_16 * 6.0);
return(1);
}
if (parray[0] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
return(0);
break;
case 1:
if ((close > parray[0]) || (var_188 == 1))
{
if (parray[1] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
var_188 = 1;
mode = 0;
break;
}
var_188 = 0;
for (i = 2; i <= var_124 + 2; i++)
{
if (close > Low[shift + i]) break;
}
if (i <= var_124 + 2) return(1);
if ((close < parray[1]) || (parray[1] == 0))
{
tarray[1] = time;
parray[1] = low;
gt_move_simvol(0,”T-1 (sell)-“,var_192,clr,140,2,tarray[1],parray[1] – inp_gtdws_16 * 5.0);
var_gtdws_80 = parray[0] – (parray[0] – low) * 0.5;
gt_move_text(0,”Target-3 T2 (sell)-“,var_192,clr,”T2-” + DoubleToStr(var_gtdws_80,Digits),9,”Verdana”,time,var_gtdws_80);
var_gtdws_72 = parray[0] – (parray[0] – low) * 0.382;
gt_move_text(0,”Target-2 T2 (sell)-“,var_192,clr,”T2-” + DoubleToStr(var_gtdws_72,Digits),9,”Verdana”,time,var_gtdws_72);
var_gtdws_64 = parray[0] – (parray[0] – low) * 0.236;
gt_move_text(0,”Target-1 T2 (sell)-“,var_192,clr,”T2-” + DoubleToStr(var_gtdws_64,Digits),9,”Verdana”,time,var_gtdws_64);
return(2);
}
return(1);
break;
case 2:
if ((close > parray[0]) || (var_188 == 1))
{
if (parray[2] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 1;
var_188 = 1;
break;
}
var_188 = 0;
if ((close < parray[1]) && (parray[2] == 0))
{
if (parray[2] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 1;
break;
}
if ((close < parray[1]) && (parray[2] != 0))
{
mode = 3;
return(3);
}
for (i = 2; i <= var_128 + 2; i++)
{
if (close < Close[shift + i]) break;
}
if (i <= var_128 + 2) return(2);
if (close > parray[2])
{
tarray[2] = time;
parray[2] = high;
gt_move_simvol(0,”T-2 (sell)-“,var_192,clr,141,2,tarray[2],parray[2] + inp_gtdws_16 * 6.0);
var_gtdws_64 = parray[0] – (parray[0] – parray[1]) * var_152;
gt_move_text(0,”Target-1 T3-5 (sell)-“,var_192,clr,”Target-1 T3-5 :” + DoubleToStr(var_gtdws_64,Digits),9,”Verdana”,tarray[1],var_gtdws_64);
var_gtdws_72 = parray[0] – (parray[0] – parray[1]) * var_160;
gt_move_text(0,”Target-2 T3-5 (sell)-“,var_192,clr,”Target-2 T3-5 :” + DoubleToStr(var_gtdws_72,Digits),9,”Verdana”,tarray[1],var_gtdws_72);
var_gtdws_80 = parray[0] – (parray[0] – parray[1]) * var_168;
gt_move_text(0,”Target-3 T3-5 (sell)-“,var_192,clr,”Target-3 T3-5 :” + DoubleToStr(var_gtdws_80,Digits),9,”Verdana”,tarray[1],var_gtdws_80);
var_gtdws_88 = parray[0] – (parray[0] – parray[1]) * var_176;
gt_move_text(0,”Target-4 T3-5 (sell)-“,var_192,clr,”Target-4 T3-5 :” + DoubleToStr(var_gtdws_88,Digits),9,”Verdana”,tarray[1],var_gtdws_88);
if (inp_gtdws_32)
{
gt_move_fibo_level(0,”MyFibo_sell-“,0,clr,2,1,tarray[0],parray[0],tarray[2],var_gtdws_80,Red);
}
if (inp_gtdws_36)
{
gt_move_line_goriz(0,”Target_down_”,3,clr,2,1,tarray[1],var_gtdws_80);
gt_move_line_goriz(0,”Target_down_”,4,clr,2,1,tarray[1],var_gtdws_88);
}
}
return(2);
break;
case 3:
if ((close > parray[0]) || (var_188 == 1))
{
if (parray[3] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 2;
var_188 = 1;
break;
}
var_188 = 0;
if (close > parray[2])
{
if (parray[3] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 2;
break;
}
if ((close > parray[3]) && (parray[3] != 0))
{
mode = 4;
return(4);
}
for (i = 2; i <= var_132 + 2; i++)
{
if (close > Close[shift + i]) break;
}
if (i <= var_132 + 2) return(3);
if ((close < parray[3]) || (parray[3] == 0))
{
tarray[3] = time;
parray[3] = low;
gt_move_simvol(0,”T-3 (sell)-“,var_192,clr,142,2,tarray[3],parray[3] – inp_gtdws_16 * 5.0);
return(4);
}
return(3);
break;
case 4:
if ((close > parray[0]) || (var_188 == 1))
{
if (parray[4] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 3;
var_188 = 1;
break;
}
var_188 = 0;
if (close < parray[3])
{
if (parray[4] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 3;
break;
}
if ((close < parray[4]) && (parray[4] != 0))
{
mode = 5;
return(5);
}
if (high >= parray[2])
{
if (parray[4] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 2;
gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 3;
gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
var_gtdws_44 = 0;
i = 1;
while (Time[shift + i] != tarray[0])
{
var_gtdws_44++;
i++;
}
i = iLowest(NULL,0,MODE_LOW,var_gtdws_44,shift);
tarray[1] = Time[i];
parray[1] = Low[i];
gt_move_simvol(0,”T-1 (sell)-“,var_192,clr,140,2,tarray[1],parray[1] – inp_gtdws_16 * 5.0);
var_gtdws_80 = parray[0] – (parray[0] – parray[1]) * 0.5;
gt_move_text(0,”Target-3 T2 (sell)-“,var_192,clr,”T2-” + DoubleToStr(var_gtdws_80,Digits),9,”Verdana”,tarray[1],var_gtdws_80);
var_gtdws_72 = parray[0] – (parray[0] – parray[1]) * 0.382;
gt_move_text(0,”Target-2 T2 (sell)-“,var_192,clr,”T2-” + DoubleToStr(var_gtdws_72,Digits),9,”Verdana”,tarray[1],var_gtdws_72);
var_gtdws_64 = parray[0] – (parray[0] – parray[1]) * 0.236;
gt_move_text(0,”Target-1 T2 (sell)-“,var_192,clr,”T2-” + DoubleToStr(var_gtdws_64,Digits),9,”Verdana”,tarray[1],var_gtdws_64);
mode = 2;
break;
}
for (i = 2; i <= var_136 + 2; i++)
{
if (close < Close[shift + i]) break;
}
if (i <= var_136 + 2) return(4);
if (close > parray[4])
{
tarray[4] = time;
parray[4] = high;
gt_move_simvol(0,”T-4 (sell)-“,var_192,clr,143,2,tarray[4],parray[4] + inp_gtdws_16 * 6.0);
return(5);
}
return(4);
break;
case 5:
if ((close > parray[0]) || (var_188 == 1))
{
if (parray[5] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 4;
var_188 = 1;
break;
}
var_188 = 0;
if (close > parray[4])
{
if (parray[5] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 4;
break;
}
if ((close > parray[5]) && (parray[5] != 0))
{
mode = 6;
break;
}
for (i = 2; i <= var_140 + 2; i++)
{
if (low > Low[shift + i]) break;
}
if (i <= var_140 + 2) return(5);
if ((low < parray[5]) || (parray[5] == 0))
{
tarray[5] = time;
parray[5] = low;
gt_move_simvol(0,”T-5 (sell)-“,var_192,clr,144,2,tarray[5],parray[5] – inp_gtdws_16 * 5.0);
return(6);
}
return(5);
break;
case 6:
if (close > parray[0])
{
if (parray[6] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 5;
var_188 = 1;
break;
}
var_188 = 0;
if (close < parray[5])
{
if (parray[6] != 0.0) gt_d_wawe_sell_clear(mode,var_192,parray,inp_gtdws_32,inp_gtdws_36);
mode = 5;
break;
}
for (i = 2; i <= var_144 + 2; i++)
{
if (high < High[shift + i]) break;
}
if (i <= var_144 + 2) return(6);
if ((high > parray[6]) || (parray[6] == 0))
{
tarray[6] = time;
parray[6] = high;
mode = 8;
break;
}
return(6);
break;
case 8:
for (i = 0; i <= 6; i++)
{
tarray[i] = 0;
parray[i] = 0;
}
var_192++;
return(0);
break;
default:
//Comment(“Ekspert : 湾忮痦?箨噻囗 疱骅?疣犷螓 (填潴朦 忸腠钼钽?囗嚯桤?SELL).”);
return(0);
}
}
}

//+——————————————————————+

int gt_d_wawe_sell_clear(int mode, int inp_gtdwsc_4, double& array[], bool inp_gtdwsc_12, bool inp_gtdwsc_16)
{
switch (mode)
{
case 0:
ObjectDelete(“T-0 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
array[0] = 0;
break;
case 1:
ObjectDelete(“T-1 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-1 T2 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-2 T2 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-3 T2 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
array[1] = 0;
break;
case 2:
ObjectDelete(“T-2 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-1 T3-5 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-2 T3-5 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-3 T3-5 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
ObjectDelete(“Target-4 T3-5 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
if (inp_gtdwsc_12)
{
ObjectDelete(“MyFibo_sell-” + DoubleToStr(0,0));
}
if (inp_gtdwsc_16)
{
ObjectDelete(“Target_down_” + DoubleToStr(3,0));
ObjectDelete(“Target_down_” + DoubleToStr(4,0));
}
array[2] = 0;
break;
case 3:
ObjectDelete(“T-3 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
array[3] = 0;
break;
case 4:
ObjectDelete(“T-4 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
array[4] = 0;
break;
case 5:
ObjectDelete(“T-5 (sell)-” + DoubleToStr(inp_gtdwsc_4,0));
array[5] = 0;
break;
default:
//Comment(“Ekspert : 湾忮痦?箨噻囗 疱骅?疣犷螓 (填潴朦 箐嚯屙? 戾蝾?忸腠钼钽?囗嚯桤?SELL).”);
return(0);
}
}

//+——————————————————————+

int gt_d_wawe_buy(int& tarray[], double& parray[], int clr, int shift, double inp_gtdwb_16, int inp_gtdwb_24, int mode, bool inp_gtdwb_32, bool inp_gtdwb_36)
{
int i;
int var_gtdwb_44;
int var_gtdwb_48;
int var_gtdwb_52;
int var_gtdwb_56;
int var_gtdwb_60;
double var_gtdwb_64;
double var_gtdwb_72;
double var_gtdwb_80;
double var_gtdwb_88;
double low;
double high;
double close;
int time;

low = Low[shift + 1];
close = Close[shift + 1];
time = Time[shift + 1];
high = High[shift + 1];

while (var_256 == 1)
{
switch (mode)
{
case 0:
var_260 = 0;
var_gtdwb_48 = MathCeil(inp_gtdwb_24 * 0.618);
i = MathMod(var_gtdwb_48 – 1,2);
if (i != 0) var_196 = var_gtdwb_48 + 1; else var_196 = var_gtdwb_48;
var_gtdwb_48 = MathCeil(var_196 * 0.618);
i = MathMod(var_gtdwb_48 – 1,2);
if (i != 0) var_200 = var_gtdwb_48 + 1; else var_200 = var_gtdwb_48;
var_204 = inp_gtdwb_24;
var_208 = var_196;
var_gtdwb_48 = MathCeil(inp_gtdwb_24 * 1.618);
i = MathMod(var_gtdwb_48 – 1,2);
if (i != 0) var_212 = var_gtdwb_48 + 1; else var_212 = var_gtdwb_48;
var_216 = inp_gtdwb_24;
var_gtdwb_48 = (inp_gtdwb_24 – 1) / 2 + 1 + shift;
var_gtdwb_52 = iLowest(NULL,0,MODE_LOW,inp_gtdwb_24,shift);
if (var_gtdwb_52 == var_gtdwb_48)
{
tarray[0] = Time[var_gtdwb_52];
parray[0] = Low[var_gtdwb_52];
gt_move_simvol(0,”T-0 (buy)-“,var_264,clr,139,2,tarray[0],parray[0] – 2 * inp_gtdwb_16);
return(1);
}
if (parray[0] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
return(0);
case 1:
if ((close < parray[0]) || (var_260 == 1))
{
if (parray[1] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
var_260 = 1;
mode = 0;
break;
}
var_260 = 0;
for (i = 2; i <= var_196 + 2; i++)
{
if (close < High[shift + i]) break;
}
if (i <= var_196 + 2) return(1);
if (close > parray[1])
{
tarray[1] = time;
parray[1] = high;
gt_move_simvol(0,”T-1 (buy)-“,var_264,clr,140,2,tarray[1],parray[1] + 3 * inp_gtdwb_16);
var_gtdwb_80 = parray[0] – (parray[0] – low) * 0.5;
gt_move_text(0,”Target-3 T2 (buy)-“,var_264,clr,”T2-” + DoubleToStr(var_gtdwb_80,Digits),9,”Verdana”,time,var_gtdwb_80);
var_gtdwb_72 = parray[0] – (parray[0] – low) * 0.382;
gt_move_text(0,”Target-2 T2 (buy)-“,var_264,clr,”T2-” + DoubleToStr(var_gtdwb_72,Digits),9,”Verdana”,time,var_gtdwb_72);
var_gtdwb_64 = parray[0] – (parray[0] – low) * 0.236;
gt_move_text(0,”Target-1 T2 (buy)-“,var_264,clr,”T2-” + DoubleToStr(var_gtdwb_64,Digits),9,”Verdana”,time,var_gtdwb_64);
return(2);
}
return(1);
case 2:
if ((close < parray[0]) || (var_260 == 1))
{
if (parray[2] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 1;
var_260 = 1;
break;
}
var_260 = 0;
if ((close > parray[1]) && (parray[2] == 0))
{
if (parray[2] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 1;
break;
}
if ((close > parray[1]) && (parray[2] != 0))
{
mode = 3;
return(3);
}
for (i = 2; i <= var_200 + 2; i++)
{
if (close > Close[shift + i]) break;
}
if (i <= var_200 + 2) return(2);
if ((close < parray[2]) || (parray[2] == 0))
{
tarray[2] = time;
parray[2] = low;
gt_move_simvol(0,”T-2 (buy)-“,var_264,clr,141,2,tarray[2],parray[2] – 2 * inp_gtdwb_16);
var_gtdwb_64 = parray[0] – (parray[0] – parray[1]) * var_224;
gt_move_text(0,”Target-1 T3-5 (buy)-“,var_264,clr,”Target-1 T3-5 :” + DoubleToStr(var_gtdwb_64,Digits),9,”Verdana”,tarray[1],var_gtdwb_64);
var_gtdwb_72 = parray[0] – (parray[0] – parray[1]) * var_232;
gt_move_text(0,”Target-2 T3-5 (buy)-“,var_264,clr,”Target-2 T3-5 :” + DoubleToStr(var_gtdwb_72,Digits),9,”Verdana”,tarray[1],var_gtdwb_72);
var_gtdwb_80 = parray[0] – (parray[0] – parray[1]) * var_240;
gt_move_text(0,”Target-3 T3-5 (buy)-“,var_264,clr,”Target-3 T3-5 :” + DoubleToStr(var_gtdwb_80,Digits),9,”Verdana”,tarray[1],var_gtdwb_80);
var_gtdwb_88 = parray[0] – (parray[0] – parray[1]) * var_248;
gt_move_text(0,”Target-4 T3-5 (buy)-“,var_264,clr,”Target-4 T3-5 :” + DoubleToStr(var_gtdwb_88,Digits),9,”Verdana”,tarray[1],var_gtdwb_88);
if (inp_gtdwb_32)
{
gt_move_fibo_level(0,”MyFibo_buy-“,0,clr,2,1,tarray[0],parray[0],tarray[2],var_gtdwb_80,Lime);
}
if (inp_gtdwb_36)
{
gt_move_line_goriz(0,”Target_up_”,3,clr,2,1,tarray[1],var_gtdwb_80);
gt_move_line_goriz(0,”Target_up_”,4,clr,2,1,tarray[1],var_gtdwb_88);
}
}
return(2);
case 3:
if ((close < parray[0]) || (var_260 == 1))
{
if (parray[3] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 2;
var_260 = 1;
break;
}
var_260 = 0;
if (close < parray[2])
{
if (parray[3] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 2;
break;
}
if ((close < parray[3]) && (parray[3] != 0))
{
mode = 4;
return(4);
}
for (i = 2; i <= var_204 + 2; i++)
{
if (close < Close[shift + i]) break;
}
if (i <= var_204 + 2) return(3);
if (close > parray[3])
{
tarray[3] = time;
parray[3] = high;
gt_move_simvol(0,”T-3 (buy)-“,var_264,clr,142,2,tarray[3],parray[3] + 3 * inp_gtdwb_16);
return(4);
}
return(3);
case 4:
if ((close < parray[0]) || (var_260 == 1))
{
if (parray[4] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 3;
var_260 = 1;
break;
}
var_260 = 0;
if (close > parray[3])
{
if (parray[4] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 3;
break;
}
if ((close > parray[4]) && (parray[4] != 0))
{
mode = 5;
return(5);
}
if (low <= parray[2])
{
if (parray[4] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 2;
gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 3;
gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
var_gtdwb_44 = 0;
i = 1;
while (Time[shift + i] != tarray[0])
{
var_gtdwb_44++;
i++;
}
i = iHighest(NULL,0,MODE_HIGH,var_gtdwb_44,shift);
tarray[1] = Time[i];
parray[1] = High[i];
gt_move_simvol(0,”T-1 (buy)-“,var_264,clr,140,2,tarray[1],parray[1] + 3 * inp_gtdwb_16);
var_gtdwb_80 = parray[0] – (parray[0] – parray[1]) * 0.5;
gt_move_text(0,”Target-3 T2 (buy)-“,var_264,clr,”T2-” + DoubleToStr(var_gtdwb_80,Digits),9,”Verdana”,tarray[1],var_gtdwb_80);
var_gtdwb_72 = parray[0] – (parray[0] – parray[1]) * 0.382;
gt_move_text(0,”Target-2 T2 (buy)-“,var_264,clr,”T2-” + DoubleToStr(var_gtdwb_72,Digits),9,”Verdana”,tarray[1],var_gtdwb_72);
var_gtdwb_64 = parray[0] – (parray[0] – parray[1]) * 0.236;
gt_move_text(0,”Target-1 T2 (buy)-“,var_264,clr,”T2-” + DoubleToStr(var_gtdwb_64,Digits),9,”Verdana”,tarray[1],var_gtdwb_64);
mode = 2;
break;
}
for (i = 2; i <= var_208 + 2; i++)
{
if (close > Close[shift + i]) break;
}
if (i <= var_208 + 2) return(4);
if ((close < parray[4]) || (parray[4] == 0))
{
tarray[4] = time;
parray[4] = low;
gt_move_simvol(0,”T-4 (buy)-“,var_264,clr,143,2,tarray[4],parray[4] – 2 * inp_gtdwb_16);
return(5);
}
return(4);
case 5:
if ((close < parray[0]) || (var_260 == 1))
{
if (parray[5] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 4;
var_260 = 1;
break;
}
var_260 = 0;
if (close < parray[4])
{
if (parray[5] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 4;
break;
}
if ((close < parray[5]) && (parray[5] != 0))
{
mode = 6;
break;
}
for (i = 2; i <= var_212 + 2; i++)
{
if (high < High[shift + i]) break;
}
if (i <= var_212 + 2) return(5);
if (high > parray[5])
{
tarray[5] = time;
parray[5] = high;
gt_move_simvol(0,”T-5 (buy)-“,var_264,clr,144,2,tarray[5],parray[5] + 3 * inp_gtdwb_16);
return(6);
}
return(5);
case 6:
if (close < parray[0])
{
if (parray[6] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 5;
var_260 = 1;
break;
}
var_260 = 0;
if (close > parray[5])
{
if (parray[6] != 0.0) gt_d_wawe_buy_clear(mode,var_264,parray,inp_gtdwb_32,inp_gtdwb_36);
mode = 5;
break;
}
for (i = 2; i <= var_216 + 2; i++)
{
if (low > Low[shift + i]) break;
}
if (i <= var_216 + 2) return(6);
if ((low < parray[6]) || (parray[6] == 0))
{
tarray[6] = time;
parray[6] = low;
mode = 8;
break;
}
return(6);
case 8:
for (i = 0; i <= 6; i++)
{
tarray[i] = 0;
parray[i] = 0;
}
var_264++;
return(0);
default:
//Comment(“Ekspert : 湾忮痦?箨噻囗 疱骅?疣犷螓 (填潴朦 忸腠钼钽?囗嚯桤?buy).”);
return(0);
}
}
}

//+——————————————————————+

int gt_d_wawe_buy_clear(int mode, int inp_gtdwbc_4, double& arr_gtdwbc_8[], bool inp_gtdwbc_12, bool inp_gtdwbc_16)
{
switch (mode)
{
case 0:
ObjectDelete(“T-0 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
arr_gtdwbc_8[0] = 0;
break;
case 1:
ObjectDelete(“T-1 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-1 T2 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-2 T2 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-3 T2 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
arr_gtdwbc_8[1] = 0;
break;
case 2:
ObjectDelete(“T-2 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-1 T3-5 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-2 T3-5 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-3 T3-5 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
ObjectDelete(“Target-4 T3-5 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
if (inp_gtdwbc_12)
{
ObjectDelete(“MyFibo_buy-” + DoubleToStr(0,0));
}
if (inp_gtdwbc_16)
{
ObjectDelete(“Target_up_” + DoubleToStr(3,0));
ObjectDelete(“Target_up_” + DoubleToStr(4,0));
}
arr_gtdwbc_8[2] = 0;
break;
case 3:
ObjectDelete(“T-3 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
arr_gtdwbc_8[3] = 0;
break;
case 4:
ObjectDelete(“T-4 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
arr_gtdwbc_8[4] = 0;
break;
case 5:
ObjectDelete(“T-5 (buy)-” + DoubleToStr(inp_gtdwbc_4,0));
arr_gtdwbc_8[5] = 0;
break;
default:
//Comment(“Ekspert : 湾忮痦?箨噻囗 疱骅?疣犷螓 (填潴朦 箐嚯屙? 戾蝾?忸腠钼钽?囗嚯桤?buy).”);
return(0);
}
}

//+——————————————————————+

/*int gt_d_wawe_open(int inp_gtdwo_0, int inp_gtdwo_4, int inp_gtdwo_8, int inp_gtdwo_12, int inp_gtdwo_16, int inp_gtdwo_20, int inp_gtdwo_24, int inp_gtdwo_28, int inp_gtdwo_32, int inp_gtdwo_36, int inp_gtdwo_40, int inp_gtdwo_44)
{
double var_gtdwo_48;
return(0);
}*/

//+——————————————————————+

int gt_sektor_clear_up(int i)
{
/*ObjectDelete(“Sek_up_0-1-2_” + DoubleToStr(i,0));
ObjectDelete(“Prc_up1_” + DoubleToStr(i,0));
ObjectDelete(“Prc_up2_” + DoubleToStr(i,0));
ObjectDelete(“Prc_up3_” + DoubleToStr(i,0));

ObjectDelete(“Trend_up_2_” + DoubleToStr(i,0));
ObjectDelete(“Trend_up_3_” + DoubleToStr(i,0));
*/
ObjectDelete(“Trend_up_” + DoubleToStr(i,0));
}

//+——————————————————————+

int gt_sektor_clear_down(int i)
{
/*ObjectDelete(“Sek_down_0-1-2_” + DoubleToStr(i,0));
ObjectDelete(“Prc_dwn1_” + DoubleToStr(i,0));
ObjectDelete(“Prc_dwn2_” + DoubleToStr(i,0));
ObjectDelete(“Prc_dwn3_” + DoubleToStr(i,0));

ObjectDelete(“Trend_down_2_” + DoubleToStr(i,0));
ObjectDelete(“Trend_down_3_” + DoubleToStr(i,0));
*/
ObjectDelete(“Trend_down_” + DoubleToStr(i,0));
}

//+——————————————————————+

int gt_max_draw(int inp_gtmxd_0, int colors[], int arr_gtmxd_8[], int& arr_gtmxd_12[,], int arr_gtmxd_16[,], double arr_gtmxd_20[,], double arr_gtmxd_24[,], int arr_gtmxd_28[,], int shft, int inp_gtmxd_36, int inp_gtmxd_40, int shift)
{
double var_gtmxd_48;
double ma_s;
int var_gtmxd_64;
int var_gtmxd_68;

switch (inp_gtmxd_0)
{
case 0: break;
case 1:
gt_sektor_clear_down(inp_gtmxd_36);
for (I = 0; I < arr_276[shft]; I++)
{
ObjectDelete(“MAX-” + DoubleToStr(inp_gtmxd_36,0) + “-” + DoubleToStr(I,0));
}
for (I = 0; I < arr_gtmxd_12[shft,0]; I++)
{
ObjectDelete(“Temp_max_” + DoubleToStr(inp_gtmxd_36,0) + “_” + DoubleToStr(I,0));
}
arr_276[shft] = arr_gtmxd_12[shft,0];
for (I = 0; I <= arr_gtmxd_12[shft,0]; I++)
{
gt_move_simvol(0,”MAX-” + DoubleToStr(inp_gtmxd_36,0) + “-“,I,var_280,6,1,arr_gtmxd_16[shft,I + 10],arr_gtmxd_24[shft,I + 10]);
}
gt_move_trend(0,”Trend_down_”,inp_gtmxd_36,colors[shft],0,2,arr_gtmxd_16[shft,0],arr_gtmxd_24[shft,0],arr_gtmxd_16[shft,1],arr_gtmxd_24[shft,1]);
arr_gtmxd_12[shft,2] = 0;
arr_gtmxd_12[shft,3] = 0;
arr_gtmxd_12[shft,4] = 0;
break;
case 2:
arr_276[shft]++;
I = arr_gtmxd_12[shft,1] – 1;
gt_move_simvol(0,”MAX-” + DoubleToStr(inp_gtmxd_36,0) + “-“,I – 10,var_280,6,1,arr_gtmxd_16[shft,I],arr_gtmxd_24[shft,I]);
gt_move_trend(0,”Trend_down_”,inp_gtmxd_36,colors[shft],0,2,arr_gtmxd_16[shft,0],arr_gtmxd_24[shft,0],arr_gtmxd_16[shft,I],arr_gtmxd_24[shft,I]);
break;
case 3:
I = arr_gtmxd_12[shft,1] – 1;
gt_move_simvol(0,”Temp_max_” + DoubleToStr(inp_gtmxd_36,0) + “_”,I – 10,colors[shft],5,1,arr_gtmxd_16[shft,I],arr_gtmxd_24[shft,I]);
break;
case 4:
//gt_move_trend(0,”Trend_down_2_”,inp_gtmxd_36,colors[shft],0,1,arr_gtmxd_16[shft,0],arr_gtmxd_24[shft,0],arr_gtmxd_16[shft,2],arr_gtmxd_24[shft,2]);
//gt_move_trend(0,”Trend_down_3_”,inp_gtmxd_36,colors[shft],2,1,arr_gtmxd_16[shft,0],arr_gtmxd_24[shft,0],arr_gtmxd_16[shft,1],arr_gtmxd_20[shft,1]);
arr_gtmxd_12[shft,2] = 1;
break;
case 5:
for (I = 0; I < arr_gtmxd_12[shft,1] – 10; I++)
{
ObjectDelete(“Temp_max_” + DoubleToStr(inp_gtmxd_36,0) + “_” + DoubleToStr(I,0));
}
break;
case 6:
for (I = 0; I < arr_276[shft]; I++)
{
ObjectDelete(“MAX-” + DoubleToStr(inp_gtmxd_36,0) + “-” + DoubleToStr(I,0));
}
arr_276[shft] = 0;
ObjectDelete(“Trend_down_” + DoubleToStr(inp_gtmxd_36,0));
arr_gtmxd_12[shft,2] = 0;
arr_gtmxd_12[shft,3] = 0;
arr_gtmxd_12[shft,4] = 0;
}

var_284 = arr_gtmxd_24[shft,0] – arr_gtmxd_20[shft,3] * (inp_gtmxd_40 – arr_gtmxd_28[shft,0] – 1) * Point;
var_292 = arr_gtmxd_24[shft,0] – arr_gtmxd_20[shft,4] * (inp_gtmxd_40 – arr_gtmxd_28[shft,0]) * Point;
var_300 = arr_gtmxd_24[shft,0] – arr_gtmxd_20[shft,5] * (inp_gtmxd_40 – arr_gtmxd_28[shft,0]) * Point;

if ((arr_gtmxd_12[shft,2] == 1) && (Close[shift + 1] > var_292))
{
arr_gtmxd_12[shft,3] = 1;
}

if ((arr_gtmxd_12[shft,3] == 1) && (Low[shift + 1] <= var_292) && (Low[shift + 1] >= var_300))
{
arr_gtmxd_12[shft,4] = 1;
}

if ((arr_gtmxd_12[shft,2] == 1) && (High[shift + 1] <= var_300))
{
arr_gtmxd_12[shft,2] = 0;
arr_gtmxd_12[shft,3] = 0;
arr_gtmxd_12[shft,4] = 0;
/*ObjectDelete(“Prc_dwn1_” + DoubleToStr(inp_gtmxd_36,0));
ObjectDelete(“Prc_dwn2_” + DoubleToStr(inp_gtmxd_36,0));
ObjectDelete(“Prc_dwn3_” + DoubleToStr(inp_gtmxd_36,0));*/
}

if (arr_gtmxd_12[shft,2] == 1)
{
ma_s = iMA(NULL,0,MA_Per,0,MODE_LWMA,PRICE_CLOSE,shift + 1);
if (ma_s < var_284) return(0);
var_gtmxd_48 = (ma_s + var_284) * 0.5;
if (Low[shift + 1] <= var_gtmxd_48)
{
//gt_move_simvol(0,”S-2-” + DoubleToStr(inp_gtmxd_36,0) + “-“,var_320,SpringGreen,180,1,Time[shift + 1],var_gtmxd_48);
var_320++;
}
var_284 = arr_gtmxd_24[shft,0] – arr_gtmxd_20[shft,3] * (inp_gtmxd_40 – arr_gtmxd_28[shft,0]) * Point;
var_292 = arr_gtmxd_24[shft,0] – arr_gtmxd_20[shft,4] * (inp_gtmxd_40 – arr_gtmxd_28[shft,0] + 1) * Point;
var_300 = arr_gtmxd_24[shft,0] – arr_gtmxd_20[shft,5] * (inp_gtmxd_40 – arr_gtmxd_28[shft,0] + 1) * Point;
//gt_move_sektor(0,”Sek_down_0-1-2_”,inp_gtmxd_36,arr_gtmxd_8[shft],arr_gtmxd_16[shft,0],arr_gtmxd_24[shft,0],Time[shift],var_284,Time[shift],var_292);
/*gt_move_simvol(0,”Prc_dwn1_”,inp_gtmxd_36,PaleGreen,6,1,Time[shift],var_284);
gt_move_simvol(0,”Prc_dwn2_”,inp_gtmxd_36,MistyRose,6,1,Time[shift],var_292);
gt_move_simvol(0,”Prc_dwn3_”,inp_gtmxd_36,SpringGreen,6,1,Time[shift],var_300);*/
}
}

//+——————————————————————+

int gt_min_draw(int inp_gtmnd_0, int colors[], int arr_gtmnd_8[], int& arr_gtmnd_12[,], int arr_gtmnd_16[,], double arr_gtmnd_20[,], double arr_gtmnd_24[,], int arr_gtmnd_28[,], int shft, int inp_gtmnd_36, int inp_gtmnd_40, int shift)
{
double var_gtmnd_48;
double ma_s;
int var_gtmnd_64;
int var_gtmnd_68;

switch (inp_gtmnd_0)
{
case 0: break;
case 1:
gt_sektor_clear_up(inp_gtmnd_36);
for (J = 0; J < arr_332[shft]; J++)
{
ObjectDelete(“MIN-” + DoubleToStr(inp_gtmnd_36,0) + “-” + DoubleToStr(J,0));
}
for (J = 0; J < arr_gtmnd_12[shft,0]; J++)
{
ObjectDelete(“Temp_min_” + DoubleToStr(inp_gtmnd_36,0) + “_” + DoubleToStr(J,0));
}
arr_332[shft] = arr_gtmnd_12[shft,0];
for (J = 0; J <= arr_gtmnd_12[shft,0]; J++)
{
gt_move_simvol(0,”MIN-” + DoubleToStr(inp_gtmnd_36,0) + “-“,J,var_336,6,1,arr_gtmnd_16[shft,J + 10],arr_gtmnd_24[shft,J + 10]);
}
gt_move_trend(0,”Trend_up_”,inp_gtmnd_36,colors[shft],0,2,arr_gtmnd_16[shft,0],arr_gtmnd_24[shft,0],arr_gtmnd_16[shft,1],arr_gtmnd_24[shft,1]);
arr_gtmnd_12[shft,2] = 0;
arr_gtmnd_12[shft,3] = 0;
arr_gtmnd_12[shft,4] = 0;
break;
case 2:
arr_332[shft]++;
J = arr_gtmnd_12[shft,1] – 1;
gt_move_simvol(0,”MIN-” + DoubleToStr(inp_gtmnd_36,0) + “-“,J – 10,var_336,6,1,arr_gtmnd_16[shft,J],arr_gtmnd_24[shft,J]);
gt_move_trend(0,”Trend_up_”,inp_gtmnd_36,colors[shft],0,2,arr_gtmnd_16[shft,0],arr_gtmnd_24[shft,0],arr_gtmnd_16[shft,J],arr_gtmnd_24[shft,J]);
break;
case 3:
J = arr_gtmnd_12[shft,1] – 1;
gt_move_simvol(0,”Temp_min_” + DoubleToStr(inp_gtmnd_36,0) + “_”,J – 10,colors[shft],5,1,arr_gtmnd_16[shft,J],arr_gtmnd_24[shft,J]);
break;
case 4:
//gt_move_trend(0,”Trend_up_2_”,inp_gtmnd_36,colors[shft],0,1,arr_gtmnd_16[shft,0],arr_gtmnd_24[shft,0],arr_gtmnd_16[shft,2],arr_gtmnd_24[shft,2]);
//gt_move_trend(0,”Trend_up_3_”,inp_gtmnd_36,colors[shft],2,1,arr_gtmnd_16[shft,0],arr_gtmnd_24[shft,0],arr_gtmnd_16[shft,1],arr_gtmnd_20[shft,1]);
arr_gtmnd_12[shft,2] = 1;
break;
case 5:
for (J = 0; J < arr_gtmnd_12[shft,1] – 10; J++)
{
ObjectDelete(“Temp_min_” + DoubleToStr(inp_gtmnd_36,0) + “_” + DoubleToStr(J,0));
}
break;
case 6:
for (J = 0; J < arr_332[shft]; J++)
{
ObjectDelete(“MIN-” + DoubleToStr(inp_gtmnd_36,0) + “-” + DoubleToStr(J,0));
}
arr_332[shft] = 0;
arr_gtmnd_12[shft,2] = 0;
arr_gtmnd_12[shft,3] = 0;
arr_gtmnd_12[shft,4] = 0;
ObjectDelete(“Trend_up_” + DoubleToStr(inp_gtmnd_36,0));
}

var_340 = arr_gtmnd_24[shft,0] + arr_gtmnd_20[shft,3] * (inp_gtmnd_40 – arr_gtmnd_28[shft,0] – 1) * Point;
var_348 = arr_gtmnd_24[shft,0] + arr_gtmnd_20[shft,4] * (inp_gtmnd_40 – arr_gtmnd_28[shft,0]) * Point;
var_356 = arr_gtmnd_24[shft,0] + arr_gtmnd_20[shft,5] * (inp_gtmnd_40 – arr_gtmnd_28[shft,0]) * Point;

if ((arr_gtmnd_12[shft,2] == 1) && (High[shift + 1] < var_348))
{
arr_gtmnd_12[shft,3] = 1;
}

if ((arr_gtmnd_12[shft,3] == 1) && (High[shift + 1] >= var_348) && (High[shift + 1] <= var_356))
{
arr_gtmnd_12[shft,4] = 1;
}

if ((arr_gtmnd_12[shft,2] == 1) && (Low[shift + 1] >= var_356))
{
arr_gtmnd_12[shft,2] = 0;
arr_gtmnd_12[shft,3] = 0;
arr_gtmnd_12[shft,4] = 0;
/*ObjectDelete(“Prc_up1_” + DoubleToStr(inp_gtmnd_36,0));
ObjectDelete(“Prc_up2_” + DoubleToStr(inp_gtmnd_36,0));
ObjectDelete(“Prc_up3_” + DoubleToStr(inp_gtmnd_36,0));*/
}

if (arr_gtmnd_12[shft,2] == 1)
{
ma_s = iMA(NULL,0,MA_Per,0,MODE_LWMA,PRICE_CLOSE,shift + 1);
if (ma_s > var_340) return(0);
var_gtmnd_48 = (ma_s + var_340) * 0.5;
if (High[shift + 1] >= var_gtmnd_48)
{
//gt_move_simvol(0,”S-2-” + DoubleToStr(inp_gtmnd_36,0) + “-“,var_376,255,180,1,Time[shift + 1],var_gtmnd_48);
var_376++;
}
var_340 = arr_gtmnd_24[shft,0] + arr_gtmnd_20[shft,3] * (inp_gtmnd_40 – arr_gtmnd_28[shft,0]) * Point;
var_348 = arr_gtmnd_24[shft,0] + arr_gtmnd_20[shft,4] * (inp_gtmnd_40 – arr_gtmnd_28[shft,0] + 1) * Point;
var_356 = arr_gtmnd_24[shft,0] + arr_gtmnd_20[shft,5] * (inp_gtmnd_40 – arr_gtmnd_28[shft,0] + 1) * Point;
//gt_move_sektor(0,”Sek_up_0-1-2_”,inp_gtmnd_36,arr_gtmnd_8[shft],arr_gtmnd_16[shft,0],arr_gtmnd_24[shft,0],Time[shift],var_340,Time[shift],var_348);
/*gt_move_simvol(0,”Prc_up1_”,inp_gtmnd_36,PaleGreen,6,1,Time[shift],var_340);
gt_move_simvol(0,”Prc_up2_”,inp_gtmnd_36,MistyRose,6,1,Time[shift],var_348);
gt_move_simvol(0,”Prc_up3_”,inp_gtmnd_36,SpringGreen,6,1,Time[shift],var_356);*/
}
}

//+——————————————————————+

/*int gt_trend_3_5_7_draw(int inp_gttdw__0, int inp_gttdw__4, int inp_gttdw__8, int inp_gttdw__12, int inp_gttdw__16, int inp_gttdw__20, int inp_gttdw__24)
{
int var_gttdw__28;
int var_gttdw__32;
int var_gttdw__36;
int var_gttdw__40;
}*/

//+——————————————————————+

int gt_trend_3_5_7_down(int inp_gttd_0, int inp_gttd_4, int inp_gttd_8, int arr_gttd_12[], int arr_gttd_16[], int arr_gttd_20[], int& arr_gttd_24[])
{
int var_gttd_28;
double var_gttd_32;
double var_gttd_40;
double var_gttd_48;
double var_gttd_56;
double var_gttd_64;
int var_gttd_72;
int var_gttd_76;
int var_gttd_80;

var_392 = 0;
var_380 = (inp_gttd_0 – 1) / 2;
var_384 = var_380 + 1 + inp_gttd_8;
var_388 = iHighest(NULL,0,MODE_HIGH,inp_gttd_0,inp_gttd_8);
if (var_388 != var_384) return(var_392);

if (arr_gttd_24[inp_gttd_4] <= 1)
{
var_gttd_28 = -1;
arr_396[arr_gttd_24[inp_gttd_4],inp_gttd_4] = Time[var_384];
arr_400[arr_gttd_24[inp_gttd_4],inp_gttd_4] = High[var_384];
arr_404[arr_gttd_24[inp_gttd_4],inp_gttd_4] = Close[var_384];
arr_gttd_24[inp_gttd_4]++;
}
else
{
var_gttd_28 = 1;
arr_396[0,inp_gttd_4] = arr_396[1,inp_gttd_4];
arr_400[0,inp_gttd_4] = arr_400[1,inp_gttd_4];
arr_404[0,inp_gttd_4] = arr_404[1,inp_gttd_4];
arr_396[1,inp_gttd_4] = Time[var_384];
arr_400[1,inp_gttd_4] = High[var_384];
arr_404[1,inp_gttd_4] = Close[var_384];
if (arr_400[0,inp_gttd_4] > High[var_384])
{
var_gttd_28 = 2;
var_gttd_76 = 1;
var_gttd_80 = var_384 + 1;
while (arr_396[0,inp_gttd_4] != Time[var_gttd_80])
{
var_gttd_76++;
var_gttd_80++;
}
var_gttd_48 = (arr_400[0,inp_gttd_4] – arr_400[1,inp_gttd_4]) / Point / var_gttd_76;
var_gttd_72 = -1 * var_380;
var_gttd_56 = 0;
var_gttd_64 = 0;
var_gttd_80 = inp_gttd_8 + 1;
while (arr_396[0,inp_gttd_4] != Time[var_gttd_80])
{
var_gttd_40 = arr_400[1,inp_gttd_4] + var_gttd_48 * var_gttd_72 * Point;
var_gttd_72++;
var_gttd_32 = var_gttd_40 – Low[var_gttd_80];
if (var_gttd_56 < var_gttd_32) var_gttd_56 = var_gttd_32;
var_gttd_32 = var_gttd_40 – Close[var_gttd_80];
if (var_gttd_64 < var_gttd_32) var_gttd_64 = var_gttd_32;
var_gttd_80++;
}
var_gttd_56 = var_gttd_56 / Point;
var_gttd_64 = var_gttd_64 / Point;
gt_trend_3_5_7_draw_trend(inp_gttd_0,arr_396[0,inp_gttd_4],arr_396[1,inp_gttd_4],arr_400[0,inp_gttd_4],arr_400[1,inp_gttd_4],var_gttd_56,var_gttd_64,arr_gttd_12[inp_gttd_4],arr_gttd_16[inp_gttd_4],arr_gttd_20[inp_gttd_4]);
}
}
return(var_392);
}

//+——————————————————————+

int gt_trend_3_5_7_up(int inp_gttu_0, int inp_gttu_4, int inp_gttu_8, int arr_gttu_12[], int arr_gttu_16[], int arr_gttu_20[], int& arr_gttu_24[])
{
int var_gttu_28;
double var_gttu_32;
double var_gttu_40;
double var_gttu_48;
double var_gttu_56;
double var_gttu_64;
int var_gttu_72;
int var_gttu_76;
int var_gttu_80;

var_420 = 0;
var_408 = (inp_gttu_0 – 1) / 2;
var_412 = var_408 + 1 + inp_gttu_8;
var_416 = iLowest(NULL,0,MODE_LOW,inp_gttu_0,inp_gttu_8);
if (var_416 != var_412) return(var_420);

if (arr_gttu_24[inp_gttu_4] <= 1)
{
var_gttu_28 = -1;
arr_424[arr_gttu_24[inp_gttu_4],inp_gttu_4] = Time[var_412];
arr_428[arr_gttu_24[inp_gttu_4],inp_gttu_4] = Low[var_412];
arr_432[arr_gttu_24[inp_gttu_4],inp_gttu_4] = Close[var_412];
arr_gttu_24[inp_gttu_4]++;
}
else
{
var_gttu_28 = 1;
arr_424[0,inp_gttu_4] = arr_424[1,inp_gttu_4];
arr_428[0,inp_gttu_4] = arr_428[1,inp_gttu_4];
arr_432[0,inp_gttu_4] = arr_432[1,inp_gttu_4];
arr_424[1,inp_gttu_4] = Time[var_412];
arr_428[1,inp_gttu_4] = Low[var_412];
arr_432[1,inp_gttu_4] = Close[var_412];
if (arr_428[0,inp_gttu_4] < Low[var_412])
{
var_gttu_28 = 2;
var_gttu_76 = 1;
var_gttu_80 = var_412 + 1;
while (arr_424[0,inp_gttu_4] != Time[var_gttu_80])
{
var_gttu_76++;
var_gttu_80++;
}
var_gttu_48 = (arr_428[1,inp_gttu_4] – arr_428[0,inp_gttu_4]) / Point / var_gttu_76;
var_gttu_72 = -1 * var_408;
var_gttu_56 = 0.0;
var_gttu_64 = 0.0;
var_gttu_80 = inp_gttu_8 + 1;
while (arr_424[0,inp_gttu_4] != Time[var_gttu_80])
{
var_gttu_40 = arr_428[1,inp_gttu_4] – var_gttu_48 * var_gttu_72 * Point;
var_gttu_72++;
var_gttu_32 = High[var_gttu_80] – var_gttu_40;
if (var_gttu_56 < var_gttu_32) var_gttu_56 = var_gttu_32;
var_gttu_32 = Close[var_gttu_80] – var_gttu_40;
if (var_gttu_64 < var_gttu_32) var_gttu_64 = var_gttu_32;
var_gttu_80++;
}
var_gttu_56 = var_gttu_56 / Point;
var_gttu_64 = var_gttu_64 / Point;
gt_trend_3_5_7_draw_trend(inp_gttu_0,arr_424[0,inp_gttu_4],arr_424[1,inp_gttu_4],arr_428[0,inp_gttu_4],arr_428[1,inp_gttu_4],var_gttu_56,var_gttu_64,arr_gttu_12[inp_gttu_4],arr_gttu_16[inp_gttu_4],arr_gttu_20[inp_gttu_4]);
}
}
return(var_420);
}

//+——————————————————————+

int gt_trend_3_5_7_draw_trend(int inp_gttdt_0, int inp_gttdt_4, int inp_gttdt_8, double inp_gttdt_12, double inp_gttdt_20, double inp_gttdt_28, double inp_gttdt_36, int inp_gttdt_44, int inp_gttdt_48, int inp_gttdt_52)
{
if (inp_gttdt_12 > inp_gttdt_20)
{
var_436 = “DM_Trend_down_”;
var_444 = “DM_Trend_down_p1_”;
var_460 = “DM_Trend_down_p3_”;
var_452 = “DM_Trend_down_p2_”;
var_516 = inp_gttdt_28 * Point;
var_524 = inp_gttdt_36 * Point;
}
else
{
var_436 = “DM_Trend_up_”;
var_444 = “DM_Trend_up_p1_”;
var_460 = “DM_Trend_up_p3_”;
var_452 = “DM_Trend_up_p2_”;
var_516 = inp_gttdt_28 * Point * (-1.0);
var_524 = inp_gttdt_36 * Point * (-1.0);
}

gt_move_trend(0,var_436,inp_gttdt_0,inp_gttdt_44,0,1,inp_gttdt_4,inp_gttdt_12,inp_gttdt_8,inp_gttdt_20);
var_468 = inp_gttdt_12 + var_516;
var_476 = inp_gttdt_20 + var_516;
var_484 = inp_gttdt_12 + var_524;
var_492 = inp_gttdt_20 + var_524;
var_500 = inp_gttdt_12 – var_516;
var_508 = inp_gttdt_20 – var_516;

gt_move_trend(0,var_444,inp_gttdt_0,inp_gttdt_48,1,1,inp_gttdt_4,var_468,inp_gttdt_8,var_476);
gt_move_trend(0,var_460,inp_gttdt_0,inp_gttdt_48,2,1,inp_gttdt_4,var_484,inp_gttdt_8,var_492);
gt_move_trend(0,var_452,inp_gttdt_0,inp_gttdt_52,0,1,inp_gttdt_4,var_500,inp_gttdt_8,var_508);
return(0);
}

//+——————————————————————+

int gt_max(int& arr_gtmax_0[], int& arr_gtmax_4[], int& arr_gtmax_8[,], int& arr_gtmax_12[,], double& arr_gtmax_16[,], double& arr_gtmax_20[,], double& arr_gtmax_24[,], int& arr_gtmax_28[,], int i, int inp_gtmax_36, int inp_gtmax_40, int inp_gtmax_44, int inp_gtmax_48)
{
var_548 = 0;
var_532 = (inp_gtmax_40 – 1) / 2;
var_536 = var_532 + 1 + inp_gtmax_36;
var_540 = iHighest(NULL,0,MODE_HIGH,inp_gtmax_40,inp_gtmax_36);
var_544 = arr_gtmax_8[i,1];

if (var_540 == var_536)
{
if (var_544 < 10) var_544 = 10;
if (var_544 > 10)
{
if (arr_gtmax_24[i,var_544 – 1] < Close[var_536])
{
var_544 = 10;
arr_gtmax_0[i] = 0;
arr_gtmax_8[i,0] = arr_gtmax_8[i,1];
}
}
arr_gtmax_16[i,var_544] = Close[var_536];
arr_gtmax_12[i,var_544] = Time[var_536];
arr_gtmax_28[i,var_544] = inp_gtmax_48 – var_532 – 1;
arr_gtmax_24[i,var_544] = High[var_536];
arr_gtmax_20[i,var_544] = Low[var_536];
var_544++;
arr_gtmax_8[i,1] = var_544;
if (inp_gtmax_44 == var_544 – 10)
{
arr_gtmax_0[i] = 1;
arr_gtmax_4[i] = 0;
arr_gtmax_16[i,0] = arr_gtmax_16[i,10];
arr_gtmax_12[i,0] = arr_gtmax_12[i,10];
arr_gtmax_28[i,0] = arr_gtmax_28[i,10];
arr_gtmax_24[i,0] = arr_gtmax_24[i,10];
arr_gtmax_20[i,0] = arr_gtmax_20[i,10];
arr_gtmax_8[i,0] = arr_gtmax_8[i,1] – 10;
arr_gtmax_16[i,1] = arr_gtmax_16[i,var_544 – 1];
arr_gtmax_12[i,1] = arr_gtmax_12[i,var_544 – 1];
arr_gtmax_28[i,1] = arr_gtmax_28[i,var_544 – 1];
arr_gtmax_24[i,1] = arr_gtmax_24[i,var_544 – 1];
arr_gtmax_20[i,1] = arr_gtmax_20[i,var_544 – 1];
var_548 = 1;
}
else
{
if (inp_gtmax_44 < var_544 – 10) var_548 = 2; else var_548 = 3;
}
}

if ((arr_gtmax_0[i] == 1) && (arr_gtmax_4[i] == 0) && (arr_gtmax_24[i,var_544 – 1] < Close[inp_gtmax_36 + 1]))
{
arr_gtmax_16[i,1] = arr_gtmax_16[i,var_544 – 1];
arr_gtmax_12[i,1] = arr_gtmax_12[i,var_544 – 1];
arr_gtmax_28[i,1] = arr_gtmax_28[i,var_544 – 1];
arr_gtmax_24[i,1] = arr_gtmax_24[i,var_544 – 1];
arr_gtmax_20[i,1] = arr_gtmax_20[i,var_544 – 1];
arr_gtmax_8[i,0] = arr_gtmax_8[i,1] – 10;
arr_gtmax_16[i,2] = arr_gtmax_24[i,1];
arr_gtmax_12[i,2] = Time[inp_gtmax_36 + 1];
arr_gtmax_28[i,2] = arr_gtmax_28[i,var_544 – 1];
arr_gtmax_24[i,2] = arr_gtmax_24[i,1];
arr_gtmax_20[i,2] = Low[inp_gtmax_36 + 1];
arr_gtmax_24[i,3] = (arr_gtmax_24[i,0] – arr_gtmax_24[i,1]) / Point;
arr_gtmax_28[i,3] = arr_gtmax_28[i,1] – arr_gtmax_28[i,0];
arr_gtmax_16[i,3] = arr_gtmax_24[i,3] / arr_gtmax_28[i,3];
arr_gtmax_24[i,4] = (arr_gtmax_24[i,0] – arr_gtmax_24[i,2]) / Point;
arr_gtmax_28[i,4] = inp_gtmax_48 – arr_gtmax_28[i,0];
arr_gtmax_16[i,4] = arr_gtmax_24[i,4] / arr_gtmax_28[i,4];
arr_gtmax_24[i,5] = (arr_gtmax_24[i,0] – arr_gtmax_16[i,1]) / Point;
arr_gtmax_28[i,5] = arr_gtmax_28[i,1] – arr_gtmax_28[i,0];
arr_gtmax_16[i,5] = arr_gtmax_24[i,5] / arr_gtmax_28[i,5];
arr_gtmax_8[i,1] = 10;
if (arr_gtmax_24[i,0] <= arr_gtmax_24[i,1])
{
arr_gtmax_0[i] = 0;
arr_gtmax_4[i] = 0;
var_548 = 6;
}
else
{
arr_gtmax_0[i] = 0;
arr_gtmax_4[i] = 1;
var_548 = 4;
}
}

if ((var_548 == 0) && (var_544 > 11) && (arr_gtmax_0[i] == 0) && (arr_gtmax_24[i,var_544 – 1] < Close[inp_gtmax_36 + 1])) var_548 = 5;
return(var_548);
}

//+——————————————————————+

int gt_min(int& arr_gtmin_0[], int& arr_gtmin_4[], int& arr_gtmin_8[,], int& arr_gtmin_12[,], double& arr_gtmin_16[,], double& arr_gtmin_20[,], double& arr_gtmin_24[,], int& arr_gtmin_28[,], int i, int inp_gtmin_36, int inp_gtmin_40, int inp_gtmin_44, int inp_gtmin_48)
{
var_568 = 0;
var_552 = (inp_gtmin_40 – 1) / 2;
var_556 = var_552 + 1 + inp_gtmin_36;
var_560 = iLowest(NULL,0,MODE_LOW,inp_gtmin_40,inp_gtmin_36);
var_564 = arr_gtmin_8[i,1];

if (var_560 == var_556)
{
if (var_564 < 10) var_564 = 10;
if (var_564 > 10)
{
if (arr_gtmin_20[i,var_564 – 1] > Close[var_556])
{
var_564 = 10;
arr_gtmin_0[i] = 0;
arr_gtmin_8[i,0] = arr_gtmin_8[i,1];
}
}
arr_gtmin_16[i,var_564] = Close[var_556];
arr_gtmin_12[i,var_564] = Time[var_556];
arr_gtmin_28[i,var_564] = inp_gtmin_48 – var_552 – 1;
arr_gtmin_20[i,var_564] = Low[var_556];
arr_gtmin_24[i,var_564] = High[var_556];
var_564++;
arr_gtmin_8[i,1] = var_564;
if (inp_gtmin_44 == var_564 – 10)
{
arr_gtmin_0[i] = 1;
arr_gtmin_4[i] = 0;
arr_gtmin_16[i,0] = arr_gtmin_16[i,10];
arr_gtmin_12[i,0] = arr_gtmin_12[i,10];
arr_gtmin_28[i,0] = arr_gtmin_28[i,10];
arr_gtmin_24[i,0] = arr_gtmin_24[i,10];
arr_gtmin_20[i,0] = arr_gtmin_20[i,10];
arr_gtmin_8[i,0] = arr_gtmin_8[i,1] – 10;
arr_gtmin_16[i,1] = arr_gtmin_16[i,var_564 – 1];
arr_gtmin_12[i,1] = arr_gtmin_12[i,var_564 – 1];
arr_gtmin_28[i,1] = arr_gtmin_28[i,var_564 – 1];
arr_gtmin_24[i,1] = arr_gtmin_24[i,var_564 – 1];
arr_gtmin_20[i,1] = arr_gtmin_20[i,var_564 – 1];
var_568 = 1;
}
else
{
if (inp_gtmin_44 < var_564 – 10) var_568 = 2; else var_568 = 3;
}
}

if ((arr_gtmin_0[i] == 1) && (arr_gtmin_4[i] == 0) && (arr_gtmin_20[i,var_564 – 1] > Close[inp_gtmin_36 + 1]))
{
arr_gtmin_16[i,1] = arr_gtmin_16[i,var_564 – 1];
arr_gtmin_12[i,1] = arr_gtmin_12[i,var_564 – 1];
arr_gtmin_28[i,1] = arr_gtmin_28[i,var_564 – 1];
arr_gtmin_24[i,1] = arr_gtmin_24[i,var_564 – 1];
arr_gtmin_20[i,1] = arr_gtmin_20[i,var_564 – 1];
arr_gtmin_8[i,0] = arr_gtmin_8[i,1] – 10;
arr_gtmin_16[i,2] = arr_gtmin_20[i,1];
arr_gtmin_12[i,2] = Time[inp_gtmin_36 + 1];
arr_gtmin_28[i,2] = arr_gtmin_28[i,var_564 – 1];
arr_gtmin_20[i,2] = arr_gtmin_20[i,1];
arr_gtmin_24[i,1] = High[inp_gtmin_36 + 1];
arr_gtmin_20[i,3] = (arr_gtmin_20[i,1] – arr_gtmin_20[i,0]) / Point;
arr_gtmin_28[i,3] = arr_gtmin_28[i,1] – arr_gtmin_28[i,0];
arr_gtmin_16[i,3] = arr_gtmin_20[i,3] / arr_gtmin_28[i,3];
arr_gtmin_20[i,4] = (arr_gtmin_20[i,2] – arr_gtmin_20[i,0]) / Point;
arr_gtmin_28[i,4] = inp_gtmin_48 – arr_gtmin_28[i,0];
arr_gtmin_16[i,4] = arr_gtmin_20[i,4] / arr_gtmin_28[i,4];
arr_gtmin_20[i,5] = (arr_gtmin_16[i,1] – arr_gtmin_20[i,0]) / Point;
arr_gtmin_28[i,5] = arr_gtmin_28[i,1] – arr_gtmin_28[i,0];
arr_gtmin_16[i,5] = arr_gtmin_20[i,5] / arr_gtmin_28[i,5];
arr_gtmin_8[i,1] = 10;
if (arr_gtmin_20[i,0] >= arr_gtmin_20[i,1])
{
arr_gtmin_0[i] = 0;
arr_gtmin_4[i] = 0;
var_568 = 6;
}
else
{
arr_gtmin_0[i] = 0;
arr_gtmin_4[i] = 1;
var_568 = 4;
}
}

if ((var_568 == 0) && (var_564 > 11) && (arr_gtmin_0[i] == 0) && (arr_gtmin_20[i,var_564 – 1] > Close[inp_gtmin_36 + 1])) var_568 = 5;
return(var_568);
}

//******************
int gt_move_trend(int win, string text, int ai_12, color col, int style, int width, int datetimes1, double price1, int datetimes, double price) {
string name_Ob = text + DoubleToStr(ai_12, 0);
if (ObjectFind(name_Ob) == -1) ObjectCreate(name_Ob, OBJ_TREND, win, datetimes1, price1, datetimes, price);
ObjectSet(name_Ob, OBJPROP_WIDTH, width);
ObjectSet(name_Ob, OBJPROP_STYLE, style);
ObjectSet(name_Ob, OBJPROP_COLOR, col);
ObjectSet(name_Ob, OBJPROP_TIME1, datetimes1);
ObjectSet(name_Ob, OBJPROP_TIME2, datetimes);
ObjectSet(name_Ob, OBJPROP_PRICE1, price1);
ObjectSet(name_Ob, OBJPROP_PRICE2, price);
WindowRedraw();
return (0);
}

/*int gt_move_sektor(int win, string text, int ai_12, color col, int a_datetime_20, double a_price_24, int a_datetime_32, double a_price_36, int a_datetime_44, double a_price_48) {
string name_Ob = text + DoubleToStr(ai_12, 0);
if (ObjectFind(name_Ob) == -1) ObjectCreate(name_Ob, OBJ_TRIANGLE, win, a_datetime_20, a_price_24, a_datetime_32, a_price_36, a_datetime_44, a_price_48);
ObjectSet(name_Ob, OBJPROP_COLOR, col);
ObjectSet(name_Ob, OBJPROP_TIME1, a_datetime_20);
ObjectSet(name_Ob, OBJPROP_TIME2, a_datetime_32);
ObjectSet(name_Ob, OBJPROP_TIME3, a_datetime_44);
ObjectSet(name_Ob, OBJPROP_PRICE1, a_price_24);
ObjectSet(name_Ob, OBJPROP_PRICE2, a_price_36);
ObjectSet(name_Ob, OBJPROP_PRICE3, a_price_48);
WindowRedraw();
return (0);
}*/

int gt_move_line_goriz(int win, string text, int ai_12, color col, int style, int width, int datetimes1, double price1) {
string name_Ob = text + DoubleToStr(ai_12, 0);
if (ObjectFind(name_Ob) == -1) ObjectCreate(name_Ob, OBJ_HLINE, win, datetimes1, price1);
ObjectSet(name_Ob, OBJPROP_WIDTH, width);
ObjectSet(name_Ob, OBJPROP_STYLE, style);
ObjectSet(name_Ob, OBJPROP_COLOR, col);
ObjectSet(name_Ob, OBJPROP_TIME1, datetimes1);
ObjectSet(name_Ob, OBJPROP_PRICE1, price1);
WindowRedraw();
return (0);
}

int gt_move_simvol(int win, string text, int ai_12, color col, int ai_20, int width, int datetimes1, double price1) {
string name_Ob = text + DoubleToStr(ai_12, 0);
if (ObjectFind(name_Ob) == -1) ObjectCreate(name_Ob, OBJ_ARROW, win, datetimes1, price1);
ObjectSet(name_Ob, OBJPROP_WIDTH, width);
ObjectSet(name_Ob, OBJPROP_ARROWCODE, ai_20);
ObjectSet(name_Ob, OBJPROP_COLOR, col);
ObjectSet(name_Ob, OBJPROP_TIME1, datetimes1);
ObjectSet(name_Ob, OBJPROP_PRICE1, price1);
WindowRedraw();
return (0);
}

int gt_move_fibo_level(int win, string text, int ai_12, color col, int style, int width, int datetimes1, double price1, int datetimes, double price,color col2) {
string name_Ob = text + DoubleToStr(ai_12, 0);
if (ObjectFind(name_Ob) == -1) ObjectCreate(name_Ob, OBJ_FIBO, win, datetimes1, price1, datetimes, price);
ObjectSet(name_Ob, OBJPROP_WIDTH, width);
ObjectSet(name_Ob, OBJPROP_STYLE, style);
ObjectSet(name_Ob, OBJPROP_COLOR, Green);
ObjectSet(name_Ob, OBJPROP_LEVELCOLOR, col2);
ObjectSet(name_Ob, OBJPROP_TIME1, datetimes1);
ObjectSet(name_Ob, OBJPROP_TIME2, datetimes);
ObjectSet(name_Ob, OBJPROP_PRICE1, price1);
ObjectSet(name_Ob, OBJPROP_PRICE2, price);
ObjectSet(name_Ob, OBJPROP_RAY, false);
ObjectSet(name_Ob, OBJPROP_BACK, true);
WindowRedraw();
return (0);
}

int gt_move_text(int win, string text, int ai_12, color col, string a_text_20, int fontsize, string fontname, int datetimes, double price) {
string name_Ob = text + DoubleToStr(ai_12, 0);
if (ObjectFind(name_Ob) == -1) ObjectCreate(name_Ob, OBJ_TEXT, win, datetimes, price);
ObjectSetText(name_Ob, a_text_20, fontsize, fontname, col);
ObjectSet(name_Ob, OBJPROP_FONTSIZE, fontsize);
ObjectSet(name_Ob, OBJPROP_COLOR, col);
ObjectSet(name_Ob, OBJPROP_TIME1, datetimes);
ObjectSet(name_Ob, OBJPROP_PRICE1, price);
WindowRedraw();
return (0);
}

 

如果你对文件有了解,请帮助投票!

If you are familiar with the file, please help vote!

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位投票人。

相关资源

暂无评论

none
暂无评论...