Декомпилированный код советника A-King

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
extern double TakeProfit = 50.0;
extern double Lots = 0.1;
extern double TrailingStop = 30.0;
extern double MACDOpenLevel = 3.0;
extern double MACDCloseLevel = 2.0;
extern double MATrendPeriod = 26.0;
extern double Ib = 0.0;
extern double Is = 0.0;
extern double Totb = 4.0;
extern double Tots = 4.0;
extern double rose = 16.0;
extern double tim = 2.0;
extern double micro = 12.0;
extern double okstopb = 0.0;
extern double okstops = 0.0;
extern double trial_time_to = D'09.06.2009 08:02:07';
int start() {
double lda_72[2];
double lda_76[2];
double ld_120;
double ld_136;
double ld_176;
double ld_184;
double ld_192;
double ld_200;
double ld_208;
double ld_232;
double ld_240;
double ld_248;
double ld_unused_256;
double lda_264[2];
double ld_unused_276;
double ld_unused_284;
double ld_unused_292;
double ld_unused_300;
double ld_unused_308;
double ld_unused_316;
double ld_356;
double ld_364;
double ld_372;
int l_ticket_384;
int li_396;
double ld_464;
double lda_504[2];
double lda_508[2];
double lda_512[2];
double lda_516[2];
double ld_600;
double ld_608;
double ld_unused_616;
double ld_unused_624;
double ld_760;
double ld_768;
double ld_unused_776;
double ld_unused_784;
double ld_792;
double ld_800;
double ld_808;
double ld_816;
double ld_824;
double ld_872;
double ld_880;
double ld_888;
double ld_896;
double ld_904;
double lda_912[3];
double lda_916[3];
double lda_920[64];
double lda_924[64];
double lda_944[64];
double lda_972[64];
double l_price_1032;
double l_price_1040;
if (TimeCurrent() > trial_time_to && AccountNumber() == 0) {
Comment("Меня зовут робот a-King. Текущее время: ", TimeCurrent(), "Бесплатное использование истекло. Заказать меня у моего создателя по icq 478359410, цена от 20 до 400 дол. США в зависимости от комплектации.");
return (0);
}
Comment("Меня зовут робот a-King. Я работаю до: ", TimeDay(trial_time_to), "-", TimeMonth(trial_time_to), "-", TimeYear(trial_time_to), " Заказать меня у моего создателя по icq 478359410, цена от 20 до 400 дол. США в зависимости от комплектации.");
double l_timeframe_96 = Period();
double ld_984 = MathSqrt(l_timeframe_96) + 16.0;
lda_944[0] = Close[0];
lda_920[0] = iVolume(NULL, 0, 0);
for (int l_pos_380 = 0; l_pos_380 < 15; l_pos_380++) {
if (lda_944[15 - l_pos_380] != 0.0) lda_944[15 - l_pos_380 + 1] = lda_944[15 - l_pos_380];
else lda_944[15 - l_pos_380 + 1] = Close[0];
if (lda_920[15 - l_pos_380] != 0.0) lda_920[15 - l_pos_380 + 1] = lda_920[15 - l_pos_380];
else lda_920[15 - l_pos_380 + 1] = iVolume(NULL, 0, 0);
}
double ld_976 = 0;
for (l_pos_380 = 1; l_pos_380 < 14; l_pos_380++) {
lda_924[l_pos_380] = lda_920[l_pos_380] - (lda_920[l_pos_380 + 1]);
if (lda_924[l_pos_380] < 0.0) lda_924[l_pos_380] = lda_920[l_pos_380];
lda_972[l_pos_380] = (lda_944[l_pos_380] - (lda_944[l_pos_380 + 1])) / Point * lda_924[l_pos_380];
ld_976 += lda_972[l_pos_380];
}
double ld_1008 = lda_972[2] + lda_972[3] + lda_972[4] + lda_972[5];
double ld_332 = 120.0 * l_timeframe_96;
double ld_592 = 0;
double ld_584 = 0;
if (ld_176 != 8.0) {
ld_unused_276 = -1;
ld_unused_284 = -1;
ld_unused_292 = -1;
ld_unused_300 = -1;
ld_unused_308 = -1;
ld_unused_316 = -1;
ld_600 = Ask + 1000.0 * Point;
ld_608 = 0;
ld_unused_624 = 0;
ld_unused_616 = 0;
ld_464 = 2;
if (Symbol() == "USDCAD") ld_464 = 4;
if (Symbol() == "USDJPY") ld_464 = 4;
if (Symbol() == "GBPJPY") ld_464 = 10;
if (Symbol() == "GBPUSD") ld_464 = 8;
if (Symbol() == "GBPCHF") ld_464 = 8;
if (Symbol() == "EURCHF") ld_464 = 4;
if (Symbol() == "EURJPY") ld_464 = 4;
if (Symbol() == "GBPAUD") ld_464 = 8;
if (Symbol() == "AUDUSD") ld_464 = 4;
l_price_1032 = 0;
l_price_1040 = 0;
ld_760 = 0;
ld_768 = 0;
ld_176 = 8;
ld_184 = High[iHighest(NULL, 0, MODE_HIGH, 256, 0)];
ld_192 = Low[iLowest(NULL, 0, MODE_LOW, 256, 0)];
ld_232 = ld_184 - (ld_184 - ld_192) / 2.0;
ld_240 = ld_184 - (ld_184 - ld_192) / 2.0;
ld_248 = ld_184 - 0.618 * (ld_184 - ld_192);
ld_unused_256 = ld_240;
li_396 = 8;
ld_872 = High[iHighest(NULL, 0, MODE_HIGH, li_396 << 8, 0)];
ld_880 = Low[iLowest(NULL, 0, MODE_LOW, li_396 << 8, 0)];
ld_200 = High[iHighest(NULL, 0, MODE_HIGH, li_396 << 10, 0)];
ld_208 = Low[iLowest(NULL, 0, MODE_LOW, li_396 << 10, 0)];
ld_792 = High[iHighest(NULL, 0, MODE_HIGH, li_396 << 12, 0)];
ld_800 = Low[iLowest(NULL, 0, MODE_LOW, li_396 << 12, 0)];
ld_888 = ld_872 - (ld_872 - ld_880) / 2.0;
ld_896 = ld_872 - (ld_872 - ld_880) / 2.0;
ld_904 = ld_872 - 0.618 * (ld_872 - ld_880);
ld_356 = ld_200 - (ld_200 - ld_208) / 2.0;
ld_364 = ld_200 - (ld_200 - ld_208) / 2.0;
ld_372 = ld_200 - 0.612 * (ld_200 - ld_208);
ld_808 = ld_792 - (ld_792 - ld_800) / 2.0;
ld_816 = ld_792 - (ld_792 - ld_800) / 2.0;
ld_824 = ld_792 - 0.618 * (ld_792 - ld_800);
}
double ld_432 = High[iHighest(NULL, l_timeframe_96, MODE_HIGH, 64, 31)] - (High[iHighest(NULL, l_timeframe_96, MODE_HIGH, 128, 63)] - Low[iLowest(NULL, l_timeframe_96, MODE_LOW, 64, 31)]) / 2.0;
double ld_440 = High[iHighest(NULL, l_timeframe_96, MODE_HIGH, 32, 0)] - (High[iHighest(NULL, l_timeframe_96, MODE_HIGH, 64, 0)] - Low[iLowest(NULL, l_timeframe_96, MODE_LOW, 32, 0)]) / 2.0;
double ld_416 = Low[iLowest(NULL, l_timeframe_96, MODE_LOW, 32, 0)] + (ld_432 - ld_440);
double ld_424 = Low[iLowest(NULL, l_timeframe_96, MODE_LOW, 32, 0)];
double ld_400 = High[iHighest(NULL, l_timeframe_96, MODE_HIGH, 32, 0)];
double ld_408 = High[iHighest(NULL, l_timeframe_96, MODE_HIGH, 32, 0)] + (ld_440 - ld_432);
double ld_448 = 0;
double ld_456 = 0;
if (Bid - 1.0 * Point < ld_192) {
ld_unused_776 = 1;
ld_584 = 1;
} else ld_unused_776 = 0;
if (Ask + 1.0 * Point > ld_184) {
ld_unused_784 = 1;
ld_592 = 1;
} else ld_unused_784 = 0;
if (Bid > ld_184 + (ld_184 - ld_192) / 8.0 || Ask < ld_192 - (ld_184 - ld_192) / 8.0) {
ld_184 = High[iHighest(NULL, 0, MODE_HIGH, 256, 0)];
ld_192 = Low[iLowest(NULL, 0, MODE_LOW, 256, 0)];
ld_232 = ld_184 - (ld_184 - ld_192) / 2.0;
ld_240 = ld_184 - (ld_184 - ld_192) / 2.0;
ld_248 = ld_184 - 0.618 * (ld_184 - ld_192);
ld_unused_256 = ld_240;
if (TimeCurrent() - lda_264[1] > 32.0 * ld_332) {
lda_516[1] = 0;
lda_504[1] = 0;
lda_512[1] = 0;
lda_508[1] = 0;
lda_264[1] = TimeCurrent();
}
}
if (l_price_1032 == 0.0 || l_price_1032 < Ask) l_price_1032 = ld_184 - 8.0 * ld_464 * Point;
if (l_price_1040 == 0.0 || l_price_1040 > Bid) l_price_1040 = ld_192 + 8.0 * ld_464 * Point;
double ld_unused_720 = 0;
double l_iad_696 = iAD(NULL, PERIOD_M1, 1);
double l_iad_704 = iAD(NULL, PERIOD_M1, 32);
double l_iad_712 = iAD(NULL, PERIOD_M1, 64);
if (l_iad_696 > l_iad_704 && l_iad_704 > l_iad_712) ld_unused_720 = 1;
if (l_iad_696 < l_iad_704 && l_iad_704 < l_iad_712) ld_unused_720 = -1;
int l_ord_total_388 = OrdersTotal();
double ld_340 = 0;
double ld_348 = 0;
ld_600 = Ask + 41.0 * Point;
ld_608 = Bid - 41.0 * Point;
double ld_736 = Bid + 100.0 * Point;
double ld_728 = Ask - 100.0 * Point;
double ld_752 = 0;
double ld_744 = 0;
double l_istochastic_40 = iStochastic(NULL, l_timeframe_96, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
double l_istochastic_24 = iStochastic(NULL, l_timeframe_96, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 0);
double ld_unused_648 = iStochastic(NULL, PERIOD_M1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
double l_istochastic_632 = iStochastic(NULL, PERIOD_M1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 0);
double l_istochastic_528 = iStochastic(NULL, PERIOD_H1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
double l_istochastic_520 = iStochastic(NULL, PERIOD_H1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 0);
double l_istochastic_672 = iStochastic(NULL, PERIOD_D1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
double l_istochastic_664 = iStochastic(NULL, PERIOD_D1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 0);
double l_istochastic_480 = iStochastic(NULL, PERIOD_W1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
double l_istochastic_472 = iStochastic(NULL, PERIOD_W1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 0);
double l_istochastic_544 = iStochastic(NULL, PERIOD_MN1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 0);
double l_istochastic_536 = iStochastic(NULL, PERIOD_MN1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 0);
double ld_unused_560 = iStochastic(NULL, PERIOD_H1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 1);
double ld_unused_552 = iStochastic(NULL, PERIOD_H1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 1);
double l_istochastic_688 = iStochastic(NULL, PERIOD_D1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 1);
double l_istochastic_680 = iStochastic(NULL, PERIOD_D1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 1);
double l_istochastic_496 = iStochastic(NULL, PERIOD_W1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 1);
double l_istochastic_488 = iStochastic(NULL, PERIOD_W1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 1);
double ld_unused_576 = iStochastic(NULL, PERIOD_MN1, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 1);
double l_istochastic_568 = iStochastic(NULL, PERIOD_MN1, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, 1);
for (l_pos_380 = 0; l_pos_380 < l_ord_total_388; l_pos_380++) {
OrderSelect(l_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol() && OrderType() == OP_BUY) {
ld_340 += 1.0;
if (OrderOpenTime() > lda_76[1]) lda_76[1] = OrderOpenTime();
if (OrderStopLoss() != 0.0) ld_752 += 1.0;
if (OrderStopLoss() == 0.0 && OrderOpenPrice() < Bid - 8.0 * ld_464 * Point && ld_340 > ld_348 && okstopb != 0.0) {
lda_76[1] = TimeCurrent() - ld_332;
OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() + 4.0 * Point, OrderTakeProfit(), 0, Blue);
}
if (ld_592 == 1.0 && OrderStopLoss() != 0.0 && OrderStopLoss() < Bid - 16.0 * ld_464 * Point) {
lda_76[1] = TimeCurrent() - ld_332;
OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss() + Point, OrderTakeProfit(), 0, Blue);
return (0);
}
if (OrderStopLoss() > ld_736) ld_736 = OrderStopLoss();
if (OrderOpenPrice() < ld_600) ld_600 = OrderOpenPrice();
}
if (OrderSymbol() == Symbol() && OrderType() == OP_SELL) {
ld_348 += 1.0;
if (OrderOpenTime() > lda_72[1]) lda_72[1] = OrderOpenTime();
if (OrderStopLoss() != 0.0) ld_744 += 1.0;
if (OrderStopLoss() == 0.0 && OrderOpenPrice() > Ask + 8.0 * ld_464 * Point && ld_348 > ld_340 && okstops != 0.0 && OrderProfit() + OrderSwap() > 0.0) {
lda_72[1] = TimeCurrent() - ld_332;
OrderModify(OrderTicket(), OrderOpenPrice(), OrderOpenPrice() - 4.0 * Point, OrderTakeProfit(), 0, Blue);
}
if (OrderStopLoss() > ld_728) ld_728 = OrderStopLoss();
if (ld_584 == 1.0 && OrderStopLoss() != 0.0 && OrderStopLoss() > Ask + 16.0 * ld_464 * Point) {
lda_72[1] = TimeCurrent() - ld_332;
OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss() - Point, OrderTakeProfit(), 0, Blue);
return (0);
}
if (OrderOpenPrice() > ld_608) ld_608 = OrderOpenPrice();
}
}
ld_760 = 0;
if (Totb != 0.0) {
if (Ask < ld_240 && ld_448 > rose - 2.0) ld_760 = 1;
if (Ask < ld_248 && ld_448 > rose) ld_760 = 2;
if (ld_340 == 1.0 && ld_448 > rose + 1.0) ld_760 = 2;
}
ld_768 = 0;
if (Tots != 0.0) {
if (Bid > ld_240 && ld_456 > rose - 2.0) ld_768 = 1;
if (Bid > ld_232 && ld_456 > rose) ld_768 = 2;
if (ld_348 == 1.0 && ld_456 > rose + 1.0) ld_768 = 2;
}
if (l_istochastic_536 < 32.0 && l_istochastic_544 > l_istochastic_536 && l_istochastic_568 < l_istochastic_536) ld_448 += 3.0;
if (l_istochastic_472 < 26.0 && l_istochastic_480 > l_istochastic_472 && l_istochastic_488 < 19.0 && l_istochastic_496 > l_istochastic_488) ld_448 += 3.0;
if (Ask > ld_888) ld_448 -= 1.0;
if (Ask > ld_356) ld_448 -= 2.0;
if (Ask > ld_808) ld_448 -= 3.0;
if (Ask < ld_888) ld_448 += 1.0;
if (Ask < ld_372) ld_448 += 2.0;
if (Ask < ld_824) ld_448 += 3.0;
if (l_istochastic_664 < 20.0 && l_istochastic_672 > l_istochastic_664 && l_istochastic_680 < 18.0 && l_istochastic_688 > l_istochastic_664) ld_448 += 3.0;
if (l_istochastic_520 < 18.0 && l_istochastic_528 > l_istochastic_520) ld_448 += 3.0;
if (iAD(NULL, l_timeframe_96, 1) > iAD(NULL, l_timeframe_96, 32) && iAD(NULL, l_timeframe_96, 32) > iAD(NULL, l_timeframe_96, 64)) ld_448 += 2.0;
if (iAD(NULL, PERIOD_M1, 1) > iAD(NULL, PERIOD_M1, 8) && iAD(NULL, PERIOD_M1, 8) > iAD(NULL, PERIOD_M1, 16) && iAD(NULL, PERIOD_H1, 1) < iAD(NULL, PERIOD_H1, 8)) ld_448 += 2.0;
if (iAD(NULL, l_timeframe_96, 1) > iAD(NULL, l_timeframe_96, 8) && iAD(NULL, l_timeframe_96, 8) > iAD(NULL, l_timeframe_96, 16) && iAD(NULL, PERIOD_D1, 1) < iAD(NULL, PERIOD_D1, 8)) ld_448 += 3.0;
if (l_istochastic_536 > 68.0 && l_istochastic_544 < l_istochastic_536 && l_istochastic_568 > l_istochastic_536) ld_456 += 3.0;
if (l_istochastic_472 > 74.0 && l_istochastic_480 < l_istochastic_472 && l_istochastic_488 > 81.0 && l_istochastic_496 < l_istochastic_488) ld_456 += 3.0;
if (Bid > ld_888) ld_456 += 1.0;
if (Bid > ld_356) ld_456 += 2.0;
if (Bid > ld_808) ld_456 += 3.0;
if (Bid < ld_904) ld_456 -= 1.0;
if (Bid < ld_372) ld_456 -= 2.0;
if (Bid < ld_808) ld_456 -= 3.0;
if (l_istochastic_664 > 80.0 && l_istochastic_672 < l_istochastic_664 && l_istochastic_680 > 82.0 && l_istochastic_688 > l_istochastic_664) ld_456 += 3.0;
if (l_istochastic_520 > 82.0 && l_istochastic_528 < l_istochastic_520) ld_456 += 3.0;
if (iAD(NULL, l_timeframe_96, 1) < iAD(NULL, l_timeframe_96, 32) && iAD(NULL, l_timeframe_96, 32) < iAD(NULL, l_timeframe_96, 64)) ld_456 += 2.0;
if (iAD(NULL, PERIOD_M1, 1) < iAD(NULL, PERIOD_M1, 8) && iAD(NULL, PERIOD_M1, 8) < iAD(NULL, PERIOD_M1, 16) && iAD(NULL, PERIOD_H1, 1) > iAD(NULL, PERIOD_H1, 8)) ld_456 += 2.0;
if (iAD(NULL, l_timeframe_96, 1) < iAD(NULL, l_timeframe_96, 8) && iAD(NULL, l_timeframe_96, 8) < iAD(NULL, l_timeframe_96, 16) && iAD(NULL, PERIOD_D1, 1) > iAD(NULL, PERIOD_D1, 8)) ld_456 += 3.0;
if (ld_416 > ld_424 && Ask + 2.0 * Point * MathSqrt(Period() << 1) > ld_424 && Ask - 2.0 * Point * MathSqrt(Period() << 1) < ld_416) ld_448 += 3.0;
if (ld_416 < ld_424 && Ask - 2.0 * Point * MathSqrt(Period() << 1) < ld_424 && Ask + 2.0 * Point * MathSqrt(Period() << 1) > ld_416) ld_448 += 1.0;
if (ld_400 > ld_408 && Bid + 2.0 * Point * MathSqrt(Period() << 1) > ld_408 && Bid - 2.0 * Point * MathSqrt(Period() << 1) < ld_400) ld_456 += 3.0;
if (ld_400 < ld_408 && Bid - 2.0 * Point * MathSqrt(Period() << 1) < ld_408 && Bid + 2.0 * Point * MathSqrt(Period() << 1) > ld_400) ld_456 += 1.0;
ld_448 -= ld_340;
ld_456 -= ld_348;
if (l_istochastic_24 > 76.0 && ld_976 > ld_984 && TimeCurrent() - lda_72[2] > ld_332) {
if (lda_508[1] < Ask || lda_508[1] == 0.0) {
lda_512[1] += 1.0;
lda_72[2] = TimeCurrent();
lda_508[1] = Ask;
} else {
lda_512[1] = 1;
lda_72[2] = TimeCurrent();
lda_508[1] = Ask;
}
}
double ld_128 = 0;
if (Bid > ld_240 && ld_348 - ld_744 < Tots && ld_456 - ld_448 >= rose) ld_128 = 1;
double ld_144 = 0;
if (Bid > l_price_1040 && l_price_1040 != 0.0) ld_144 = 1;
if (l_istochastic_24 > 76.0 && TimeCurrent() - lda_72[1] > ld_332 && ld_128 == 1.0 && ld_144 == 1.0 && lda_512[1] > tim && ld_1008 < 0.0) {
for (l_pos_380 = 0; l_pos_380 < l_ord_total_388; l_pos_380++) {
OrderSelect(l_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if (OrderType() == OP_BUY && OrderProfit() > 0.0 && OrderStopLoss() == 0.0 && OrderProfit() + OrderSwap() > 0.0) {
ld_unused_616 = 0;
ld_600 = Ask + 1000.0 * Point;
lda_76[1] = lda_76[1] - ld_332;
OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
return (0);
}
}
}
l_ticket_384 = OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, 0, l_price_1040, "Noo order", 16384, 0, Green);
if (l_ticket_384 != 0) {
ld_unused_624 = 0;
ld_unused_616 = 1;
Is = 0;
lda_72[1] = TimeCurrent();
lda_512[1] = 0;
lda_508[1] = 0;
} else return (0);
}
if (ld_976 < (-1.0 * ld_984) && l_istochastic_24 < 24.0 && TimeCurrent() - lda_76[1] > ld_332) {
if (lda_504[1] > Bid || lda_504[1] == 0.0) {
lda_516[1] += 1.0;
lda_76[2] = TimeCurrent();
lda_504[1] = Bid;
} else {
lda_516[1] = 1;
lda_76[2] = TimeCurrent();
lda_504[1] = Bid;
}
}
if (Ask < ld_240 && ld_340 - ld_752 < Totb && ld_448 - ld_456 >= rose) ld_120 = 1;
else ld_120 = 0;
if (Ask < l_price_1032 && l_price_1032 != 0.0) ld_136 = 1;
else ld_136 = 0;
if (l_istochastic_24 < 24.0 && TimeCurrent() - lda_76[1] > ld_332 && ld_120 == 1.0 && ld_136 == 1.0 && lda_516[1] > tim && ld_1008 > 0.0) {
for (l_pos_380 = 0; l_pos_380 < l_ord_total_388; l_pos_380++) {
OrderSelect(l_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if (OrderType() == OP_SELL && OrderProfit() > 0.0 && OrderStopLoss() == 0.0 && OrderProfit() + OrderSwap() > 0.0) {
ld_unused_624 = 0;
ld_608 = 0;
lda_72[1] = lda_72[1] - ld_332;
OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
return (0);
}
}
}
l_ticket_384 = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, l_price_1032, "Noo order", 16384, 0, Green);
if (l_ticket_384 != 0) {
Ib = 0;
ld_unused_616 = 0;
ld_unused_624 = 1;
lda_516[1] = 0;
lda_76[1] = TimeCurrent();
lda_504[1] = 0;
} else return (0);
}
for (l_pos_380 = 0; l_pos_380 < l_ord_total_388; l_pos_380++) {
OrderSelect(l_pos_380, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol() == Symbol()) {
if (OrderType() == OP_BUY) {
if (l_istochastic_24 > 79.0 && l_istochastic_24 > l_istochastic_40 && ld_340 > ld_348 && OrderProfit() > ld_464 * MathSqrt(l_timeframe_96) && OrderProfit() + OrderSwap() > 0.0) {
ld_unused_616 = 0;
ld_600 = Ask + 1000.0 * Point;
lda_76[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
return (0);
}
if (l_istochastic_24 > 82.0 && lda_512[1] > tim - 1.0 && OrderProfit() > ld_464 * MathSqrt(l_timeframe_96) && OrderProfit() + OrderSwap() > 0.0 && OrderTakeProfit() == 0.0) {
ld_unused_616 = 0;
ld_600 = Ask + 1000.0 * Point;
lda_76[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
return (0);
}
if (l_istochastic_632 > 80.0 && ld_340 > ld_348 && ld_340 >= Totb && Ask > ld_240 && OrderProfit() + OrderSwap() > ld_464 && OrderStopLoss() == 0.0) {
ld_unused_616 = 0;
ld_600 = Ask + 1000.0 * Point;
lda_76[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
return (0);
}
if (l_istochastic_24 > 82.0 && lda_512[1] > tim - 1.0 && l_istochastic_24 > l_istochastic_40 && ld_340 >= ld_348 && ld_760 < 2.0 && OrderStopLoss() == 0.0 && OrderProfit() > ld_464 * MathSqrt(l_timeframe_96) &&
OrderProfit() + OrderSwap() > ld_464) {
ld_unused_616 = 0;
ld_600 = Ask + 1000.0 * Point;
lda_76[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Bid, 3, Violet);
return (0);
}
}
if (OrderType() == OP_SELL) {
if (l_istochastic_24 < 21.0 && l_istochastic_24 < l_istochastic_40 && ld_348 > ld_340 && OrderProfit() > ld_464 * MathSqrt(l_timeframe_96) && OrderProfit() + OrderSwap() > ld_464) {
ld_unused_624 = 0;
ld_608 = 0;
lda_72[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet);
return (0);
}
if (l_istochastic_24 < 18.0 && lda_516[1] > tim - 1.0 && OrderProfit() > ld_464 * MathSqrt(l_timeframe_96) && OrderProfit() + OrderSwap() > ld_464 && OrderTakeProfit() == 0.0) {
ld_unused_624 = 0;
ld_608 = 0;
lda_72[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet);
return (0);
}
if (l_istochastic_632 < 20.0 && ld_348 > ld_340 && ld_348 >= Tots && Bid < ld_240 && OrderProfit() + OrderSwap() > ld_464 && OrderStopLoss() == 0.0) {
ld_unused_624 = 0;
ld_608 = 0;
lda_72[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet);
return (0);
}
if (l_istochastic_24 < 18.0 && lda_516[1] > tim - 1.0 && l_istochastic_24 < l_istochastic_40 && ld_348 >= ld_340 && ld_768 < 2.0 && OrderStopLoss() == 0.0 && OrderProfit() > ld_464 * MathSqrt(l_timeframe_96) &&
OrderProfit() + OrderSwap() > ld_464) {
ld_unused_624 = 0;
ld_608 = 0;
lda_72[1] = TimeCurrent() - ld_332;
OrderClose(OrderTicket(), OrderLots(), Ask, 3, Violet);
return (0);
}
}
}
}
return (0);
}