النتائج 1 إلى 5 من 5
الموضوع: طريقة عمل مؤشر
- 26-01-2018, 01:42 PM #1
- 26-01-2018, 11:47 PM #2كود PHP:
#property indicator_separate_window
#property indicator_minimum -1.1
#property indicator_maximum 1.1
#property indicator_buffers 6
#property indicator_color1 Yellow
#property indicator_color2 Red
#property indicator_color3 DeepSkyBlue
#property indicator_color4 Red
#property indicator_color5 White
#property indicator_color6 White
extern int FS30Range = 5;
extern int FilterPeriod = 17;
extern double MartFiltr = 2.0;
extern int PriceConst = 6;
extern int MaPeriod = 5;
extern int MaMode = 3;
extern double LevelsCross = 0.95;
extern int Countbars = 300;
extern bool AlertOn = TRUE;
extern int ArrowUp = 108;
extern int ArrowDown = 108;
int Gi_unused_128 = 20;
double G_ibuf_132[];
double G_ibuf_136[];
double G_ibuf_140[];
double G_ibuf_144[];
double G_ibuf_148[];
double G_ibuf_152[];
double G_ibuf_156[];
double G_ibuf_160[];
int Gi_164 = 14;
double Gda_168[];
double Gd_172;
int Gia_180[];
int Gia_184[];
bool Gi_188 = FALSE;
bool Gi_192 = FALSE;
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
IndicatorBuffers(8);
SetIndexBuffer(0, G_ibuf_132);
SetIndexStyle(0, DRAW_LINE);
SetIndexBuffer(1, G_ibuf_144);
SetIndexStyle(1, DRAW_LINE);
SetIndexBuffer(2, G_ibuf_148);
SetIndexStyle(2, DRAW_ARROW);
SetIndexBuffer(3, G_ibuf_152);
SetIndexStyle(3, DRAW_ARROW);
SetIndexArrow(2, ArrowUp);
SetIndexArrow(3, ArrowDown);
SetIndexBuffer(4, G_ibuf_156);
SetIndexStyle(4, DRAW_ARROW);
SetIndexBuffer(5, G_ibuf_160);
SetIndexStyle(5, DRAW_ARROW);
SetIndexBuffer(6, G_ibuf_136);
SetIndexStyle(6, DRAW_NONE);
SetIndexBuffer(7, G_ibuf_140);
SetIndexStyle(7, DRAW_NONE);
SetLevelValue(0, LevelsCross);
SetLevelValue(1, -LevelsCross);
SetLevelValue(2, 0);
ArrayResize(Gda_168, Gi_164);
ArrayResize(Gia_180, Gi_164);
ArrayResize(Gia_184, Gi_164);
IndicatorShortName(WindowExpertName() + "( SR:" + FS30Range + ", FP:" + FilterPeriod + ", MA:" + MaPeriod + " )");
Gd_172 = MathPow(10, Digits);
return (0);
}
// 52D46093050F38C27267BCE42543EF60
int deinit() {
return (0);
}
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
int Li_0;
int Li_4;
int Li_8;
if (Gi_164 > 30) return (-1);
int Li_12 = IndicatorCounted();
if (Li_12 > 0) Li_12--;
int Li_16 = Countbars - Li_12 - 1;
if (Li_0 > Li_4) Li_4 = Li_0;
if (Li_4 < Countbars - 1) Li_16 = Countbars - 1;
for (Li_0 = 0; Li_0 < Li_16; Li_0++) {
G_ibuf_148[Li_0] = EMPTY_VALUE;
G_ibuf_152[Li_0] = EMPTY_VALUE;
G_ibuf_156[Li_0] = EMPTY_VALUE;
G_ibuf_160[Li_0] = EMPTY_VALUE;
G_ibuf_132[Li_0] = EMPTY_VALUE;
G_ibuf_144[Li_0] = EMPTY_VALUE;
}
for (Li_0 = Li_16; Li_0 >= 0; Li_0--) f0_0(Li_0);
for (Li_0 = Li_16; Li_0 >= 0; Li_0--) f0_4(Li_0);
for (Li_0 = Li_16; Li_0 >= 0; Li_0--) {
for (int index_20 = 0; index_20 < Gi_164; index_20++) Gia_180[index_20] = MathRound((G_ibuf_140[Li_0 + index_20]) * Gd_172);
f0_3(Gia_180);
G_ibuf_132[Li_0] = f0_2(Gda_168, Gi_164);
if (G_ibuf_132[Li_0] > 1.0) G_ibuf_132[Li_0] = 1.0;
if (G_ibuf_132[Li_0] < -1.0) G_ibuf_132[Li_0] = -1.0;
}
for (Li_0 = Li_16; Li_0 >= 0; Li_0--) G_ibuf_144[Li_0] = iMAOnArray(G_ibuf_132, 0, MaPeriod, 0, MaMode, Li_0);
for (Li_0 = Li_16; Li_0 >= 0; Li_0--) {
if (G_ibuf_132[Li_0] > G_ibuf_144[Li_0] && G_ibuf_132[Li_0] > (-LevelsCross) && G_ibuf_132[Li_0] < 0.0 && G_ibuf_144[Li_0] < 0.0 && Li_0 != 0 && Li_8 != 1) {
Li_8 = 1;
G_ibuf_148[Li_0] = G_ibuf_132[Li_0];
G_ibuf_152[Li_0] = EMPTY_VALUE;
if (AlertOn && Li_0 == 1 && (!Gi_188)) {
Alert(WindowExpertName() + " is crossing UP on" + " " + Symbol(), " ", Period() + " " + "minute charts");
Gi_188 = TRUE;
Gi_192 = FALSE;
}
} else {
if (G_ibuf_132[Li_0] < G_ibuf_144[Li_0] && G_ibuf_132[Li_0] < LevelsCross && G_ibuf_132[Li_0] > 0.0 && G_ibuf_144[Li_0] > 0.0 && Li_0 != 0 && Li_8 != -1) {
Li_8 = -1;
G_ibuf_152[Li_0] = G_ibuf_132[Li_0];
G_ibuf_148[Li_0] = EMPTY_VALUE;
if (AlertOn && Li_0 == 1 && (!Gi_192)) {
Alert(WindowExpertName() + " is crossing DOWN on" + " " + Symbol(), " ", Period() + " " + "minute charts");
Gi_188 = FALSE;
Gi_192 = TRUE;
}
}
}
}
for (Li_0 = Li_16; Li_0 >= 0; Li_0--) {
if (G_ibuf_132[Li_0] > G_ibuf_144[Li_0] && G_ibuf_144[Li_0] > (-LevelsCross) && G_ibuf_132[Li_0] < 0.0 && G_ibuf_144[Li_0] < 0.0 && Li_0 != 0 && Li_8 != 1) {
Li_8 = 1;
G_ibuf_156[Li_0] = G_ibuf_132[Li_0];
G_ibuf_160[Li_0] = EMPTY_VALUE;
} else {
if (G_ibuf_132[Li_0] < G_ibuf_144[Li_0] && G_ibuf_144[Li_0] < LevelsCross && G_ibuf_132[Li_0] > 0.0 && G_ibuf_144[Li_0] > 0.0 && Li_0 != 0 && Li_8 != -1) {
Li_8 = -1;
G_ibuf_160[Li_0] = G_ibuf_132[Li_0];
G_ibuf_156[Li_0] = EMPTY_VALUE;
}
}
}
if (Li_0 > Li_4) Li_4 = Li_0;
return (0);
}
// 15EAF6D521704D0194B14E496A74E1EE
void f0_0(int Ai_0) {
int Li_4;
int count_8;
int Li_12;
int Li_16;
double Ld_20;
switch (PriceConst) {
case 0:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_CLOSE, Ai_0);
break;
case 1:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_OPEN, Ai_0);
break;
case 2:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_HIGH, Ai_0);
break;
case 3:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_LOW, Ai_0);
break;
case 4:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_MEDIAN, Ai_0);
break;
case 5:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_TYPICAL, Ai_0);
break;
case 6:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_WEIGHTED, Ai_0);
break;
default:
G_ibuf_136[Ai_0] = iMA(NULL, 0, FS30Range + 1, 0, MODE_LWMA, PRICE_WEIGHTED, Ai_0);
}
for (int Li_32 = Ai_0 + FS30Range + 2; Li_32 > Ai_0; Li_32--) {
Ld_20 = 0.0;
Li_4 = 0;
count_8 = 0;
Li_12 = Li_32 + FS30Range;
Li_16 = Li_32 - FS30Range;
if (Li_16 < Ai_0) Li_16 = Ai_0;
while (Li_12 >= Li_32) {
count_8++;
Ld_20 += count_8 * f0_1(Li_12);
Li_4 += count_8;
Li_12--;
}
while (Li_12 >= Li_16) {
count_8--;
Ld_20 += count_8 * f0_1(Li_12);
Li_4 += count_8;
Li_12--;
}
G_ibuf_136[Li_32] = Ld_20 / Li_4;
}
}
// 3D3D39E487639BEC47B5773DA2D3ADEF
double f0_1(int Ai_0) {
switch (PriceConst) {
case 0:
return (Close[Ai_0]);
case 1:
return (Open[Ai_0]);
case 2:
return (High[Ai_0]);
case 3:
return (Low[Ai_0]);
case 4:
return ((High[Ai_0] + Low[Ai_0]) / 2.0);
case 5:
return ((Close[Ai_0] + High[Ai_0] + Low[Ai_0]) / 3.0);
case 6:
return ((2.0 * Close[Ai_0] + High[Ai_0] + Low[Ai_0]) / 4.0);
}
return (Close[Ai_0]);
}
// BFFCA781645251F48D9246A28A0FF279
void f0_4(int Ai_0) {
double Ld_4 = G_ibuf_136[ArrayMaximum(G_ibuf_136, FilterPeriod, Ai_0)];
double Ld_12 = G_ibuf_136[ArrayMinimum(G_ibuf_136, FilterPeriod, Ai_0)];
G_ibuf_140[Ai_0] = (2.0 * (MartFiltr + 2.0) * G_ibuf_136[Ai_0] - (Ld_4 + Ld_12)) / 2.0 / (MartFiltr + 1.0);
}
// 500FD7E6B28CC63D9B9089FD7AF931F0
double f0_2(double Ada_0[], int Ai_4) {
double Ld_8;
for (int index_16 = 0; index_16 < Ai_4; index_16++) Ld_8 += MathPow(Ada_0[index_16] - index_16 - 1.0, 2);
double Ld_ret_20 = 1 - 6.0 * Ld_8 / (MathPow(Ai_4, 3) - Ai_4);
return (Ld_ret_20);
}
// 6891180C583D478DF8E2EF1F9FD17D72
void f0_3(int Aia_0[]) {
double Ld_4;
double Ld_12;
int index_20;
int Li_24;
int Li_28;
int Li_32;
double Lda_36[];
ArrayResize(Lda_36, Gi_164);
ArrayCopy(Gia_184, Aia_0);
for (int index_40 = 0; index_40 < Gi_164; index_40++) Lda_36[index_40] = index_40 + 1;
ArraySort(Gia_184, WHOLE_ARRAY, 0, MODE_DESCEND);
for (index_40 = 0; index_40 < Gi_164 - 1; index_40++) {
if (Gia_184[index_40] == Gia_184[index_40 + 1]) {
Li_24 = Gia_184[index_40];
index_20 = index_40 + 1;
Li_28 = 1;
Ld_12 = index_40 + 1;
while (index_20 < Gi_164) {
if (Gia_184[index_20] != Li_24) break;
Li_28++;
Ld_12 += index_20 + 1;
index_20++;
}
Ld_4 = Li_28;
Ld_12 /= Ld_4;
for (int Li_44 = index_40; Li_44 < index_20; Li_44++) Lda_36[Li_44] = Ld_12;
index_40 = index_20;
}
}
for (index_40 = 0; index_40 < Gi_164; index_40++) {
Li_32 = Aia_0[index_40];
for (index_20 = 0; index_20 < Gi_164; index_20++) {
if (Li_32 == Gia_184[index_20]) {
Gda_168[index_40] = Lda_36[index_20];
break;
}
}
}
}
- 27-01-2018, 12:11 AM #3
اعتقد طلب مني احدهم قبل فترة التعديل عليه وبينته مفصلا
يا ليت تبحث --يمكن قبل شهرين في هذا القسم
للأسف لايوجد فهرسة في المنتدى!!! العصر الكريتاسي!
- 09-02-2018, 11:41 AM #4
طيب ماذا كان اسم الموضوع يا اخي
وانا اسف ولكنه اتجاه قديمجدا في المنتدايات لكي تبحث وتبحث ولا تجد ولهذا سيكون عليان ن ابحث عن مشاركاتك وكلها ليس له مواضاع محددة فكله يكتب مؤشر تعديل فهذا يتطلب بحث رخهيب وهو سر قديم من اسرار العمل في جوجل كان ينشط المنتديات عام 2010 واليوم ليس له قيمة ولكنه تعنت غريب من الادارة لكي تظل في المنتدي اطول فترة ممكنة
الله يهدي بس
- 10-02-2018, 06:30 PM #5
I watched the indicator on backtester and it repainted... once the blue dot appeared then after 6 bars it disapeared.