设为首页 收藏本站 切换语言

【Band top and bottom v2.1】准确率还算不错的  

| 发表于 2023-8-8 11:17:56 | 显示全部楼层 |复制链接
//-----------------------------------------------------------------

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkGoldenrod
#property indicator_color2 Blue

extern int ExtDepth = 12;
extern int ExtDeviation = 3;
extern int ExtBackstep = 2;
double g_ibuf_88[];
double g_ibuf_92[];
int g_time_96 = 0;
int gi_100;
int gi_104;
int gi_108;
double gd_112;
double gd_120;
double gd_128;

int init() {
IndicatorBuffers(2);
SetIndexStyle(0, DRAW_SECTION);
SetIndexBuffer(0, g_ibuf_88);
SetIndexBuffer(1, g_ibuf_92);
SetIndexEmptyValue(0, 0.0);
SetIndexEmptyValue(1, 0.0);
ArraySetAsSeries(g_ibuf_88, TRUE);
ArraySetAsSeries(g_ibuf_92, TRUE);
IndicatorShortName("WolfWave");
return (0);
}

int deinit() {
for (int li_0 = 1; li_0 <= 5; li_0++) ObjectDelete("WW" + "" + li_0);
ObjectDelete("WW" + "Line-2-4");
ObjectDelete("WW" + "Line-1-3");
ObjectDelete("WW" + "Line-1-4");
ObjectDelete("WW" + "Line-2-5");
return (0);
}

int start() {
double ld_0;
double ld_8;
double ld_16;
double ld_24;
double ld_32;
double ld_40;
int lia_48[200];
int lia_52[6];
int li_56;
int shift_60;
int li_64;
int li_68;
double ld_72;
double ld_80;
double ld_88;
double ld_96;
int li_104;
int li_108;
int li_112;
int li_116;
int li_120;
int li_124 = IndicatorCounted();
int li_unused_128 = 0;
string ls_132 = "None";
bool li_140 = FALSE;
if (Bars - 1 < ExtDepth) return (0);
if (li_124 < 0) return (-1);
if (li_124 > 0) li_124--;
int li_144 = Bars - ExtDepth;
if (li_124 == 0 || Bars - li_124 > 2) li_56 = li_144;
else {
shift_60 = iBarShift(NULL, 0, gi_100, TRUE);
li_64 = iBarShift(NULL, 0, gi_104, TRUE);
li_68 = iBarShift(NULL, 0, gi_108, TRUE);
li_56 = li_64;
if (shift_60 < 0 || li_64 < 0 || li_68 < 0) li_56 = li_144;
}
if (li_56 >= li_144 || g_time_96 != Time[Bars - 1]) {
g_time_96 = Time[Bars - 1];
for (int li_148 = Bars - 1; li_148 > 0; li_148--) {
g_ibuf_88[li_148] = 0.0;
g_ibuf_92[li_148] = 0.0;
}
li_56 = li_144;
}
for (li_148 = Bars - ExtDepth; li_148 >= 0; li_148--) {
ld_0 = Low[iLowest(NULL, 0, MODE_LOW, ExtDepth, li_148)];
if (ld_0 == ld_40) ld_0 = 0.0;
else {
ld_40 = ld_0;
if (Low[li_148] - ld_0 > ExtDeviation * Point) ld_0 = 0.0;
else {
for (int li_152 = 1; li_152 <= ExtBackstep; li_152++) {
ld_8 = g_ibuf_88[li_148 + li_152];
if (ld_8 != 0.0 && ld_8 > ld_0) g_ibuf_88[li_148 + li_152] = 0.0;
}
}
}
if (Low[li_148] == ld_0) g_ibuf_88[li_148] = ld_0;
ld_0 = High[iHighest(NULL, 0, MODE_HIGH, ExtDepth, li_148)];
if (ld_0 == ld_32) ld_0 = 0.0;
else {
ld_32 = ld_0;
if (ld_0 - High[li_148] > ExtDeviation * Point) ld_0 = 0.0;
else {
for (li_152 = 1; li_152 <= ExtBackstep; li_152++) {
ld_8 = g_ibuf_92[li_148 + li_152];
if (ld_8 != 0.0 && ld_8 < ld_0) g_ibuf_92[li_148 + li_152] = 0.0;
}
}
}
if (High[li_148] == ld_0) g_ibuf_92[li_148] = ld_0;
}
ld_32 = -1;
int li_156 = -1;
ld_40 = -1;
int li_160 = -1;
for (li_148 = Bars - ExtDepth; li_148 >= 0; li_148--) {
ld_16 = g_ibuf_88[li_148];
ld_24 = g_ibuf_92[li_148];
if (ld_16 == 0.0 && ld_24 == 0.0) continue;
if (ld_24 != 0.0) {
if (ld_32 > 0.0) {
if (ld_32 < ld_24) g_ibuf_92[li_156] = 0;
else g_ibuf_92[li_148] = 0;
}
if (ld_32 < ld_24 || ld_32 < 0.0) {
ld_32 = ld_24;
li_156 = li_148;
}
ld_40 = -1;
}
if (ld_16 != 0.0) {
if (ld_40 > 0.0) {
if (ld_40 > ld_16) g_ibuf_88[li_160] = 0;
else g_ibuf_88[li_148] = 0;
}
if (ld_16 < ld_40 || ld_40 < 0.0) {
ld_40 = ld_16;
li_160 = li_148;
}
ld_32 = -1;
}
}
for (li_148 = Bars - 1; li_148 >= 0; li_148--) {
if (li_148 >= Bars - ExtDepth) g_ibuf_88[li_148] = 0.0;
else {
ld_8 = g_ibuf_92[li_148];
if (ld_8 > 0.0) g_ibuf_88[li_148] = ld_8;
}
}
int index_164 = 0;
int index_168 = 0;
ld_8 = 0;
for (li_148 = 0; index_164 < 3; li_148++) {
if (g_ibuf_88[li_148] > 0.0) {
index_164++;
if (index_164 == 1 && g_ibuf_88[li_148] == High[li_148]) {
index_168 = li_148;
ld_8 = g_ibuf_88[li_148];
}
if (index_164 == 2 && ld_8 > 0.0 && g_ibuf_88[li_148] == High[li_148]) {
if (g_ibuf_88[li_148] >= g_ibuf_88[index_168]) g_ibuf_88[index_168] = 0;
else g_ibuf_88[li_148] = 0;
ld_8 = 0;
index_164 = 0;
index_168 = 0;
li_148 = 0;
}
}
}
if (li_56 < li_144) {
g_ibuf_88[shift_60] = gd_112;
g_ibuf_88[li_64] = gd_120;
g_ibuf_88[li_68] = gd_128;
for (int li_172 = li_68 - 1; li_172 > li_64; li_172--) g_ibuf_88[li_172] = 0;
for (int li_176 = li_64 - 1; li_176 > shift_60; li_176--) g_ibuf_88[li_176] = 0;
}
if (li_56 == li_144) li_68 = li_144;
for (int li_180 = li_68; li_180 >= 0; li_180--) {
if (g_ibuf_88[li_180] != 0.0) {
li_120++;
ld_96 = ld_88;
li_116 = li_112;
ld_88 = ld_80;
li_112 = li_108;
ld_80 = ld_72;
li_108 = li_104;
ld_72 = g_ibuf_88[li_180];
li_104 = li_180;
if (li_120 >= 3) {
if (ld_88 < ld_80 && ld_80 < ld_72) {
g_ibuf_88[li_108] = 0;
li_180 = li_112 + 1;
}
if (ld_88 > ld_80 && ld_80 > ld_72) {
g_ibuf_88[li_108] = 0;
li_180 = li_112 + 1;
}
if (ld_80 == ld_72 && ld_72 != 0.0) {
g_ibuf_88[li_104] = 0;
li_180 = li_112 + 1;
}
}
}
}
gi_100 = Time[li_108];
gi_104 = Time[li_112];
gi_108 = Time[li_116];
gd_112 = ld_80;
gd_120 = ld_88;
gd_128 = ld_96;
index_164 = 0;
for (int index_184 = 0; index_184 < Bars && index_164 < 200; index_184++) {
if (g_ibuf_88[index_184] != 0.0 || g_ibuf_92[index_184] != 0.0) {
lia_48[index_164] = index_184;
index_164++;
}
}
for (index_168 = 0; index_168 < index_164 && index_168 < 200 && li_140 == FALSE; index_168++) {
lia_52[1] = lia_48[index_168 + 4];
lia_52[2] = lia_48[index_168 + 3];
lia_52[3] = lia_48[index_168 + 2];
lia_52[4] = lia_48[index_168 + 1];
lia_52[5] = lia_48[index_168 + 0];
if (Low[lia_52[1]] < High[lia_52[2]] && Low[lia_52[3]] < Low[lia_52[1]] && Low[lia_52[3]] < High[lia_52[4]]) ls_132 = "Buy";
else {
if (High[lia_52[1]] > Low[lia_52[2]] && High[lia_52[3]] > High[lia_52[1]] && High[lia_52[3]] > Low[lia_52[4]]) ls_132 = "Sell";
else ls_132 = "Not";
}
if (ls_132 == "Buy") {
ObjectCreate("WW" + "Line-1-3", OBJ_TREND, 0, Time[lia_52[1]], Low[lia_52[1]], Time[lia_52[3]], Low[lia_52[3]]);
ObjectSet("WW" + "Line-1-3", OBJPROP_COLOR, Teal);
ObjectSet("WW" + "Line-1-3", OBJPROP_WIDTH, 1);
if (ObjectGetValueByShift("WW" + "Line-1-3", lia_52[3]) >= Low[lia_52[3]]) {
ObjectCreate("WW" + "1", OBJ_ARROW, 0, Time[lia_52[1]], Low[lia_52[1]] - 2.0 * Point);
ObjectSet("WW" + "1", OBJPROP_ARROWCODE, 140);
ObjectSet("WW" + "1", OBJPROP_COLOR, White);
ObjectCreate("WW" + "2", OBJ_ARROW, 0, Time[lia_52[2]], High[lia_52[2]] + 8.0 * Point);
ObjectSet("WW" + "2", OBJPROP_ARROWCODE, 141);
ObjectSet("WW" + "2", OBJPROP_COLOR, White);
ObjectCreate("WW" + "3", OBJ_ARROW, 0, Time[lia_52[3]], Low[lia_52[3]] - 2.0 * Point);
ObjectSet("WW" + "3", OBJPROP_ARROWCODE, 142);
ObjectSet("WW" + "3", OBJPROP_COLOR, White);
ObjectCreate("WW" + "4", OBJ_ARROW, 0, Time[lia_52[4]], High[lia_52[4]] + 8.0 * Point);
ObjectSet("WW" + "4", OBJPROP_ARROWCODE, 143);
ObjectSet("WW" + "4", OBJPROP_COLOR, White);
ObjectCreate("WW" + "5", OBJ_ARROW, 0, Time[lia_52[5]], Low[lia_52[5]] - 2.0 * Point);
ObjectSet("WW" + "5", OBJPROP_ARROWCODE, 144);
ObjectSet("WW" + "5", OBJPROP_COLOR, White);
ObjectCreate("WW" + "Line-1-4", OBJ_TREND, 0, Time[lia_52[1]], Low[lia_52[1]], Time[lia_52[4]], High[lia_52[4]]);
ObjectSet("WW" + "Line-1-4", OBJPROP_COLOR, Chocolate);
ObjectSet("WW", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("WW" + "Line-1-4", OBJPROP_WIDTH, 0);
ObjectSet("WW" + "Line-1-4", OBJPROP_BACK, FALSE);
ObjectSet("WW" + "Line-2-5", OBJPROP_BACK, FALSE);
}
} else {
if (ls_132 == "Sell") {
ObjectCreate("WW" + "Line-1-3", OBJ_TREND, 0, Time[lia_52[1]], High[lia_52[1]], Time[lia_52[3]], High[lia_52[3]]);
ObjectSet("WW" + "Line-1-3", OBJPROP_COLOR, Teal);
ObjectSet("WW" + "Line-1-3", OBJPROP_WIDTH, 0);
if (ObjectGetValueByShift("WW" + "Line-1-3", lia_52[3]) <= High[lia_52[3]]) {
ObjectCreate("WW" + "1", OBJ_ARROW, 0, Time[lia_52[1]], High[lia_52[1]] + 8.0 * Point);
ObjectSet("WW" + "1", OBJPROP_ARROWCODE, 140);
ObjectSet("WW" + "1", OBJPROP_COLOR, White);
ObjectCreate("WW" + "2", OBJ_ARROW, 0, Time[lia_52[2]], Low[lia_52[2]] - 2.0 * Point);
ObjectSet("WW" + "2", OBJPROP_ARROWCODE, 141);
ObjectSet("WW" + "2", OBJPROP_COLOR, White);
ObjectCreate("WW" + "3", OBJ_ARROW, 0, Time[lia_52[3]], High[lia_52[3]] + 8.0 * Point);
ObjectSet("WW" + "3", OBJPROP_ARROWCODE, 142);
ObjectSet("WW" + "3", OBJPROP_COLOR, White);
ObjectCreate("WW" + "4", OBJ_ARROW, 0, Time[lia_52[4]], Low[lia_52[4]] - 2.0 * Point);
ObjectSet("WW" + "4", OBJPROP_ARROWCODE, 143);
ObjectSet("WW" + "4", OBJPROP_COLOR, White);
ObjectSet("WW" + "4", OBJPROP_BACK, TRUE);
ObjectCreate("WW" + "5", OBJ_ARROW, 0, Time[lia_52[5]], High[lia_52[5]] + 8.0 * Point);
ObjectSet("WW" + "5", OBJPROP_ARROWCODE, 144);
ObjectSet("WW" + "5", OBJPROP_COLOR, White);
ObjectCreate("WW" + "Line-1-4", OBJ_TREND, 0, Time[lia_52[1]], High[lia_52[1]], Time[lia_52[4]], Low[lia_52[4]]);
ObjectSet("WW" + "Line-1-4", OBJPROP_COLOR, Chocolate);
ObjectSet("WW", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("WW" + "Line-1-4", OBJPROP_WIDTH, 1);
ObjectSet("WW" + "Line-1-4", OBJPROP_BACK, FALSE);
}
WindowRedraw();
}
}
}
return (0);
}
QQ图片20230808111510.png
QQ图片20230808111541.png

Band top and bottom v2.1.ex4

46.17 KB, 下载次数: 5, 下载积分: 活跃度 -5 售价: 1 H币  [记录]  [下载]

评分
  • 1
  • 2
  • 3
  • 4
  • 5
平均分:NAN    参与人数:0    我的评分:未评 下载时遇到问题?
如果有帮助,就支持一下我呗
举报

评论 使用道具

精彩评论16

三条龙交易
DDD
| 发表于 2023-8-8 11:22:38 | 显示全部楼层
信号漂吗
举报

点赞 评论 使用道具

jj644719356
DD
| 发表于 2023-8-8 12:08:02 | 显示全部楼层
两个帖子一样的指标吗
举报

点赞 评论 使用道具

peterzhu2004
DDD
| 发表于 2023-8-8 14:51:57 | 显示全部楼层
看起来还不错,至少有错误信号,
举报

点赞 评论 使用道具

i221bci
DDD
| 发表于 2023-8-8 16:31:51 | 显示全部楼层
楼主可以,都贴源码了
举报

点赞 评论 使用道具

detoihc
DD
| 发表于 2023-8-8 17:06:48 来自手机 | 显示全部楼层
漂不漂,有没有未来
举报

点赞 评论 使用道具

detoihc
DD
| 发表于 2023-8-8 18:11:45 | 显示全部楼层
此坑 已踩,漂到外婆家了,金币不易呀!
举报

点赞 评论 使用道具

cdz66
DD
| 发表于 2023-8-8 21:17:41 | 显示全部楼层
几乎没有不飘的
举报

点赞 评论 使用道具

tradert
D
| 发表于 2023-8-8 22:28:39 | 显示全部楼层
nicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenicenice
举报

点赞 评论 使用道具

peterzhu2004
DDD
| 发表于 2023-8-9 04:10:28 | 显示全部楼层
又是一个漂移的,又逃过了一次
举报

点赞 评论 使用道具

ea12213
C
| 发表于 2023-8-9 19:40:13 | 显示全部楼层
直接贴源码也是特别
举报

点赞 评论 使用道具

hankxue
DD
| 发表于 2023-8-10 02:31:27 | 显示全部楼层
detoihc 发表于 2023-8-8 18:11
此坑 已踩,漂到外婆家了,金币不易呀!

谢谢你,探路者
举报

点赞 评论 使用道具

风行天
D
| 发表于 2023-8-24 20:35:52 | 显示全部楼层
谢谢分享,源码不错
举报

点赞 评论 使用道具

dou85079
D
| 发表于 2023-8-24 20:44:17 | 显示全部楼层
多大周期的  有没有重绘
举报

点赞 评论 使用道具

6669
DDD
| 发表于 2023-9-30 07:29:22 | 显示全部楼层
感谢分享
举报

点赞 评论 使用道具

hawkbig
DD
| 发表于 2023-9-30 09:41:02 | 显示全部楼层
漂移不呀
举报

点赞 评论 使用道具

美丽娜娜
DDD
| 发表于 2024-4-12 17:28:04 | 显示全部楼层
飘移吗,看着不错
举报

点赞 评论 使用道具

发新帖
EA交易
您需要登录后才可以评论 登录 | 立即注册

简体中文
繁體中文
English(英语)
日本語(日语)
Deutsch(德语)
Русский язык(俄语)
بالعربية(阿拉伯语)
Türkçe(土耳其语)
Português(葡萄牙语)
ภาษาไทย(泰国语)
한어(朝鲜语/韩语)
Français(法语)