النتائج 1 إلى 3 من 3
- 15-05-2018, 08:10 AM #1
رجاء هذا الكود يحتاج تعديل استرتيجية ممتازة
هذه الستراتيجية ممتازة ولكن يجب تعديل الكود لكي يقراه الاكسبرت
كود PHP:#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Yellow
#property indicator_color2 White
#property indicator_color3 Red
#property indicator_color4 Blue
//#property strict
#define buy -2
#define sell 2
#define exitS 3
#define exitL 4
int Bars_D;
string name;
int i;
int Quantity=0;
int Quantity1=0;
extern string strBasic = " -- Basic Ichimoku Parameters --";
extern int Tenkan = 9;
extern int Kijun = 26;
extern int Senkou = 52;
extern string strAlerts = "-- Entry and Exit Alert parameters ";
extern bool UseEntryAlerts = FALSE;
extern bool UseExitAlerts = FALSE;
extern string strRSI = " -- Releative Strength Indicator Parameters -- ";
extern int RSILength = 9;
extern int RSIChangeVal = 20;
double var_1[];
double var_2[];
double var_3[];
double var_4[];
double var_5[];
double var_6[];
double var_7[];
double var_8[];
double var_9[];
double var_10[];
double var_11[];
int var_12 = 0;
bool var_13 = FALSE;
int var_14;
bool var_15 = FALSE;
bool var_16 = FALSE;
double var_17 = 0.0;
double var_18 = 0.0;
bool var_19 = FALSE;
int init() {
var_19 = FALSE;
IndicatorBuffers(8);
SetIndexBuffer(4, var_1);
SetIndexBuffer(5, var_2);
SetIndexBuffer(6, var_5);
SetIndexBuffer(7, var_6);
var_14 = Kijun;
if (var_14 < Tenkan) var_14 = Tenkan;
SetIndexEmptyValue(0, 0.0);
SetIndexStyle(0, DRAW_ARROW);
SetIndexArrow(0, 234);
SetIndexBuffer(0, var_9);
SetIndexEmptyValue(1, 0.0);
SetIndexStyle(1, DRAW_ARROW);
SetIndexArrow(1, 233);
SetIndexBuffer(1, var_8);
SetIndexEmptyValue(2, 0.0);
SetIndexStyle(2, DRAW_ARROW);
SetIndexArrow(2, 233);
SetIndexBuffer(2, var_10);
SetIndexEmptyValue(3, 0.0);
SetIndexStyle(3, DRAW_ARROW);
SetIndexArrow(3, 234);
SetIndexBuffer(3, var_11);
Bars_D = Bars;
return (0);
}
int deinit() {
ObjectsDeleteAll();
return (0);
}
int start() {
double ld_12;
double ld_20;
double ld_28;
string l_name_40;
string l_text_48;
double l_irsi_56;
double l_irsi_64;
int status=0;
int l_ind_counted_8 = IndicatorCounted();
if (Bars_D <= Tenkan || Bars_D <= Kijun || Bars_D <= Senkou) return (0);
if (l_ind_counted_8 < 1) {
for (int li_0 = 1; li_0 <= Tenkan; li_0++) var_1[Bars_D - li_0] = 0;
for ( li_0 = 1; li_0 <= Kijun; li_0++) var_2[Bars_D - li_0] = 0;
for ( li_0 = 1; li_0 <= var_14; li_0++) {
var_3[Bars_D - li_0] = 0;
var_5[Bars_D - li_0] = 0;
}
for ( li_0 = 1; li_0 <= Senkou; li_0++) {
var_4[Bars_D - li_0] = 0;
var_6[Bars_D - li_0] = 0;
}
}
li_0 = Bars_D - Tenkan;
if (l_ind_counted_8 > Tenkan) li_0 = Bars_D - l_ind_counted_8 - 1;
while (li_0 >= 0) {
ld_12 = High[li_0];
ld_20 = Low[li_0];
for (int li_4 = li_0 - 1 + Tenkan; li_4 >= li_0; li_4--) {
ld_28 = High[li_4];
if (ld_12 < ld_28) ld_12 = ld_28;
ld_28 = Low[li_4];
if (ld_20 > ld_28) ld_20 = ld_28;
}
var_1[li_0] = (ld_12 + ld_20) / 2.0;
li_0--;
}
li_0 = Bars_D - Kijun;
if (l_ind_counted_8 > Kijun) li_0 = Bars_D - l_ind_counted_8 - 1;
while (li_0 >= 0) {
ld_12 = High[li_0];
ld_20 = Low[li_0];
for ( li_4 = li_0 - 1 + Kijun; li_4 >= li_0; li_4--) {
ld_28 = High[li_4];
if (ld_12 < ld_28) ld_12 = ld_28;
ld_28 = Low[li_4];
if (ld_20 > ld_28) ld_20 = ld_28;
}
var_2[li_0] = (ld_12 + ld_20) / 2.0;
li_0--;
}
li_0 = Bars_D - var_14 + 1;
if (l_ind_counted_8 > var_14 - 1) li_0 = Bars_D - l_ind_counted_8 - 1;
while (li_0 >= 0) {
ld_28 = (var_2[li_0] + var_1[li_0]) / 2.0;
var_3[li_0 - Kijun] = ld_28;
var_5[li_0 - Kijun] = ld_28;
li_0--;
}
li_0 = Bars_D - Senkou;
if (l_ind_counted_8 > Senkou) li_0 = Bars_D - l_ind_counted_8 - 1;
while (li_0 >= 0) {
ld_12 = High[li_0];
ld_20 = Low[li_0];
for ( li_4 = li_0 - 1 + Senkou; li_4 >= li_0; li_4--) {
ld_28 = High[li_4];
if (ld_12 < ld_28) ld_12 = ld_28;
ld_28 = Low[li_4];
if (ld_20 > ld_28) ld_20 = ld_28;
}
ld_28 = (ld_12 + ld_20) / 2.0;
var_4[li_0 - Kijun] = ld_28;
var_6[li_0 - Kijun] = ld_28;
li_0--;
}
li_0 = Bars_D - 1;
if (l_ind_counted_8 > 1) li_0 = Bars_D - l_ind_counted_8 - 1;
while (li_0 >= 0) {
var_7[li_0 + Kijun] = Close[li_0];
li_0--;
}
var_19 = FALSE;
int li_36 = Bars_D - Senkou;
if (l_ind_counted_8 > Senkou) li_36 = Bars_D - l_ind_counted_8 - 1;
while (li_36 >= 0) {
if (li_36 == 0) var_19 = TRUE;
l_name_40 = "";
l_text_48 = "";
l_irsi_56 = iRSI(NULL, 0, RSILength, PRICE_CLOSE, li_36);
l_irsi_64 = iRSI(NULL, 0, RSILength, PRICE_CLOSE, li_36 + 3);
CheckCloud(li_36);
CheckRSI(l_irsi_56, li_36);
bool Uptrend=(iCustom(NULL,0,"HMA",200,3,0,0,li_36)>iCustom(NULL,0,"HMA",200,3,0,0,li_36+1));
if(Uptrend==true){
if (var_1[li_36] >= var_2[li_36] && var_1[li_36 + 1] < var_2[li_36 + 1] && High[li_36] > var_1[li_36] && var_15 == FALSE) {
var_8[li_36] = Low[li_36] - 15.0 * Point;
l_name_40 = "Buy-" + TimeToStr(Time[li_36]);
l_text_48 = "Buy-" + DoubleToStr(Low[li_36], 5);
ObjectCreate(l_name_40, OBJ_TEXT, 0, Time[li_36], Low[li_36] - 40.0 * Point);
ObjectSetText(l_name_40, l_text_48, 10, "Times New Roman", White);
var_15 = TRUE;
var_17 = l_irsi_56;
if (UseEntryAlerts && var_19) {
// status = 7;
// GlobalVariableSet("STATUS", buy);
// Alert(l_text_48);
// PlaySound("alert.wav");
}
// status = 0;
// Quantity=0;
}}
if(Uptrend==false){
if (var_1[li_36] <= var_2[li_36] && var_1[li_36 + 1] > var_2[li_36 + 1] && Low[li_36] < var_1[li_36] && var_16 == FALSE) {
var_9[li_36] = High[li_36] + 15.0 * Point;
l_name_40 = "Short-" + TimeToStr(Time[li_36]);
l_text_48 = "Short-" + DoubleToStr(High[li_36], 5);
ObjectCreate(l_name_40, OBJ_TEXT, 0, Time[li_36], High[li_36] + 40.0 * Point);
ObjectSetText(l_name_40, l_text_48, 10, "Times New Roman", White);
var_16 = TRUE;
var_18 = l_irsi_56;
if (UseEntryAlerts && var_19) {
// status = -7;
// GlobalVariableSet("STATUS", sell);
// Alert(l_text_48);
// PlaySound("alert.wav");
}
status = 0;
Quantity=0;
}}
li_36--;
}
return (0);
}
int CheckCloud(int ai_0) {
var_12 = 0;
var_13 = FALSE;
if (var_6[ai_0] > var_5[ai_0]) var_12 = -1;
if (var_6[ai_0] < var_5[ai_0]) var_12 = 1;
if (var_12 == 1 && var_6[ai_0] == var_6[ai_0 + 1]) var_13 = TRUE;
if (var_12 == -1 && var_5[ai_0] == var_5[ai_0 + 1]) var_13 = TRUE;
return (0);
}
int CheckRSI(double ad_0, int ai_8) {
string l_name_12 = "";
string l_text_20 = "";
// int exit = 0;
if (var_15) {
if (ad_0 > var_17) var_17 = ad_0;
bool rsibefilter=iRSI(NULL, 0, RSILength, PRICE_CLOSE, ai_8)<50;
if (ad_0 < var_17 && var_17 - ad_0 > RSIChangeVal) {
l_name_12 = "ExitLong-" + TimeToStr(Time[ai_8]);
l_text_20 = "ExitLong-" + DoubleToStr(Close[ai_8], 5);
ObjectCreate(l_name_12, OBJ_TEXT, 0, Time[ai_8], High[ai_8] + 40.0 * Point);
ObjectSetText(l_name_12, l_text_20, 10, "Times New Roman", White);
var_11[ai_8] = High[ai_8] + 15.0 * Point;
var_15 = FALSE;
if (UseExitAlerts && var_19) {
//exit = 5;
// GlobalVariableSet("exitLl", exitL);
// GlobalVariableSet("STATUS", 0);
// Alert(l_text_20);
// PlaySound("alert.wav");
}
//exit = 0;
// Quantity1=0;
}
}
if (var_16) {
if (ad_0 < var_18) var_18 = ad_0;
bool rsisefilter=iRSI(NULL, 0, RSILength, PRICE_CLOSE, ai_8)>50;
if (ad_0 > var_18 && ad_0 - var_18 > RSIChangeVal) {
l_name_12 = "ExitShort-" + TimeToStr(Time[ai_8]);
l_text_20 = "ExitShort-" + DoubleToStr(Close[ai_8], 5);
ObjectCreate(l_name_12, OBJ_TEXT, 0, Time[ai_8], Low[ai_8] - 40.0 * Point);
ObjectSetText(l_name_12, l_text_20, 10, "Times New Roman", White);
var_10[ai_8] = Low[ai_8] - 15.0 * Point;
var_16 = FALSE;
if (UseExitAlerts && var_19) {
// Alert(l_text_20);
//exit = 5;
// GlobalVariableSet("exitshl", exitS);
// GlobalVariableSet("STATUS", 0);
// PlaySound("alert.wav");
}
//exit = 5;
// Quantity1=0;
}
}
return (1);
}
- 15-05-2018, 08:13 AM #2
- 19-05-2018, 08:34 PM #3
السلام عليكم ورحمة الله وبركاته
متابع