← К каталогу
Исходный код · ID 3431

Oracle

oracle v2.0.mq4

Похожие материалы по тегам

gg_master.mq5MQL5 / MetaTrader 5 · 1 общих теговxbest_rv3 (1).47.mq4MQL4 / MetaTrader 4 · 1 общих теговtrend_catcher.mq4MQL4 / MetaTrader 4 · 1 общих теговcoin_flip.mq4MQL4 / MetaTrader 4 · 1 общих теговbambang aryawan v2.mq4MQL4 / MetaTrader 4 · 1 общих тегов!caio trader.mq5MQL5 / MetaTrader 5 · 1 общих тегов
Вы автор или правообладатель?

Сообщите нам, если считаете, что материал размещён без разрешения.

Краткий обзор

О программе

Oracle — торговый советник для MetaTrader 4, реализующий сеточную торговую систему с двумя независимыми движками: движок A для покупок и движок B для продаж. Советник анализирует рыночные данные с помощью индикаторов скользящей средней и HILO для формирования сигналов на вход в сделки. Поддерживает ручной и автоматический режимы открытия сетки ордеров с configurable параметрами лотности. Включает визуальный дашборд на графике, отображающий текущую цену, спред, прибыль/убыток и статистику позиции.

Настройки программы

НастройкаОписание
Start MANUAL Order Grid (Only if A / B Enable) (InpManualInitGrid) Ручная инициализация сетки — Запуск ручной сетки ордеров, доступный только при включённых движках A и B
Open New Orders ? (InpOpenNewOrders) Открывать новые ордера — Включает или отключает возможность открытия новых ордеров
Enable Grid ? (OpenNewOrdersGrid) Включить сетку — Активирует режим сеточной торговли
closes all orders now (InpCloseAllNow) Закрыть все ордера сейчас — Принудительно закрывает все открытые ордера
Magic_ Магический номер — Идентификатор магического номера для ордеров
Enable Engine A [BUY] (InpEnableEngineA) Включить движок A — Активирует движок A для торговли в сторону BUY
Magic Number A (InpMagic) Магический номер A — Магический номер для ордеров, открытых движком A
Enable Engine B [SELL] (InpEnableEngineB) Включить движок B — Активирует движок B для торговли в сторону SELL
Magic Number B (InpMagic2) Магический номер B — Магический номер для ордеров, открытых движком B
LOT CONFIGURATION (ConfigLOTE__) Конфигурация лота — Группа настроек конфигурации лота
Lot Mode (InpLotMode) Режим лота — Выбор режима расчёта размера лота
Fixed Lot (InpFixedLot) Фиксированный лот — Фиксированный размер лота при фиксированном режиме
Percent Lot (InpPercentLot) Процентный лот — Процент от баланса для расчёта размера лота
Take Profit in Pips (InpTakeProfit) Тейк-профит — Уровень тейк-профита в пипсах
Stop Loss (Pips) - 0.0 to No SL (GSL) Стоп-лосс — Стоп-лосс в пипсах, 0.0 означает отсутствие стоп-лосса
GRID CONFIGURATION (Prop_Firm_EA_ConfigGrid__) Конфигурация сетки — Группа настроек конфигурации сетки
Type Grid Lot (TypeGridLot) Тип лота сетки — Выбор типа лота для сетки
Step Size in Pips (InpGridSize) Размер шага сетки — Шаг сетки в пипсах
Grid Increment Factor (If Martingale) (InpGridFactor) Фактор увеличения сетки — Множитель увеличения лота при мартингейле
STEP LOT (If Step Lot) (InpGridStepLot) Шаг лота — Шаг увеличения лота при пошаговом режиме
Max Lot (InpMaxLot) Максимальный лот — Максимально допустимый размер лота
After Level Change Lot A to B (Necessari all Engine Enable) (InpHedgex) Смена лота A на B — Уровень, после которого лот меняется с A на B; требуется включение всех движков
Enable Grid Dual Side (GridAllDirect) Сетка на обе стороны — Включает сетку в обоих направлениях одновременно
Hedge After Level (InpHedge) Хедж после уровня — Уровень для активации хеджа
FILTER ORDER (FilterOpenOneCandle__) Фильтр одного ордера — Группа настроек фильтра открытия одного ордера по свече
Open one order by candle (InpOpenOneCandle) Один ордер по свече — Разрешает открытие только одного ордера за свечу
Timeframe OpenOneCandle (InpTimeframeBarOpen) Таймфрейм для одного ордера — Таймфрейм, по которому проверяется свеча для фильтра одного ордера
MA SETUP (MovingAverageConfig__) Настройка MA — Группа настроек скользящей средней
Moving Average TimeFrame (InpMaFrame) Таймфрейм MA — Таймфрейм для расчёта скользящей средней
Moving Average Period (InpMaPeriod) Период MA — Период скользящей средней
Moving Average Method (InpMaMethod) Метод MA — Метод расчёта скользящей средней
Moving Average Price (InpMaPrice) Цена MA — Тип цены для расчёта скользящей средней
Moving Average Shift (InpMaShift) Сдвиг MA — Горизонтальный сдвиг скользящей средней
HI-LO SETUP (HILOConfig__) Настройка HILO — Группа настроек индикатора HILO
Enable Sinal HILO (EnableSinalHILO) Включить сигнал HILO — Активирует использование сигнала индикатора HILO
If True Invert Filter (InpHILOFilterInverter) Инвертировать фильтр HILO — Инвертирует направление фильтра HILO
HILO TimeFrame (InpHILOFrame) Таймфрейм HILO — Таймфрейм для индикатора HILO
HILO Period (InpHILOPeriod) Период HILO — Период индикатора HILO
HILO Method (InpHILOMethod) Метод HILO — Метод расчёта индикатора HILO
HILO Shift (InpHILOShift) Сдвиг HILO — Сдвиг индикатора HILO
TRAILING STOP (TrailingStop__) Трейлинг-стоп — Группа настроек трейлинг-стопа
Use Trailing Stop? (InpUseTrailingStop) Использовать трейлинг-стоп — Включает функцию трейлинг-стопа
TrailingStart (InpTrailStart) Начало трейлинга — Расстояние в пипсах от входа для начала трейлинга
Size Trailing stop (InpTrailStop) Размер трейлинг-стопа — Размер трейлинг-стопа в пипсах
BREAKEVEN (BreakEven) Безубыточность — Группа настроек безубыточности
Use Break Even ? (InpUseBreakEven) Использовать безубыточность — Включает функцию перевода ордеров в безубыточное состояние
Break Even Start (InpBreakEvenStart) Начало безубыточности — Расстояние в пипсах от входа для активации безубыточности
Break Even Step (InpBreakEvenStep) Шаг безубыточности — Шаг смещения стоп-лосса при безубыточности в пипсах
FilterSpread__ Фильтр спреда — Группа настроек фильтра максимального спреда
Max Spread in Pips (InpMaxSpread) Максимальный спред — Максимально допустимый спред в пипсах
DAILY LIMITS (NoOpenMoreTradesWhenReaches__) Дневные лимиты — Группа настроек дневных ограничений
Max trades (0 to NO limit) (MaxTrades) Максимум сделок — Максимальное количество сделок за день (0 — без ограничений)
Max lots (0 to NO limit) (MaxLots) Максимум лотов — Максимальная сумма лотов за день (0 — без ограничений)
Range of Price (PriceRanger) Диапазон цены — Группа настроек диапазона цены
Activate Range of Price feature (PriceRangerActive) Активировать диапазон цены — Включает функцию диапазона цены
Distance between actual price and the initial range limits (RangeDistance) Расстояние диапазона — Расстояние между текущей ценой и начальными границами диапазона
Equity Protection (EquityGuardian) Защита equity — Группа настроек защиты equity
When Equity Protection activates -> Close (Action) Действие при защите equity — Выбор действия при срабатывании защиты equity
Close Chart (CloseChart) Закрыть график — Автоматически закрывать график при срабатывании защиты
Turn Off AutoTrade (AutoTradeOFF) Выключить автоторговлю — Автоматически отключает автоторговлю при срабатывании защиты
Close MetaTrader (CloseTerminal) Закрыть MetaTrader — Автоматически закрывает терминал при срабатывании защиты
Max floating DrawDown in money (0 to OFF) (MaxFloatingDDMoney) Макс. плавающий DD в деньгах — Максимальный плавающий DrawDown в денежных единицах (0 — выкл)
Max floating DrawDown in percentage (0 to OFF) (MaxFloatingDDPercent) Макс. плавающий DD в % — Максимальный плавающий DrawDown в процентах (0 — выкл)
Min Equity (0 to OFF) (EquitySL) Минимальный Equity — Минимальный уровень equity (0 — выкл)
Max DD Mode (PriceModeDD) Режим DD — Режим отображения максимального DrawDown
Max DD per Day (0 to no limit) (MaxDailyDrawDown) Макс. DD в день — Максимальный дневной DrawDown (0 — без ограничений)
Max floating Profit in money (0 to OFF) (MaxFloatingProfitMoney) Макс. плавающий Profit в деньгах — Максимальный плавающий Profit в денежных единицах (0 — выкл)
Max floating Profit in percentage (0 to OFF) (MaxFloatingProfitPercent) Макс. плавающий Profit в % — Максимальный плавающий Profit в процентах (0 — выкл)
Max Equity (0 to OFF) (EquityTP) Максимальный Equity — Максимальный уровень equity (0 — выкл)
Daily target Mode (PriceModeTP) Режим TP — Режим отображения дневной цели
Daily target (0 to No limit) (DailyTarget) Дневная цель — Дневная цель по прибыли (0 — без ограничений)
NewsFilter__ Фильтр новостей — Группа настроек фильтра новостей
Enable News Filter (NewsFilter) Включить фильтр новостей — Активирует фильтрацию торговли по новостному календарю
When News Filter activates -> Close (NewsAction) Действие при новостях — Выбор действия при срабатывании фильтра новостей
mins after an event to stay out of trading (AfterNewsStop) После новости — Минуты ожидания после новостного события перед возобновлением торговли
mins before an event to stay out of trading (BeforeNewsStop) До новости — Минуты ожидания перед новостным событием
Enable light news (NewsLight) Лёгкие новости — Учитывать лёгкие новости в фильтре
Enable medium news (NewsMedium) Средние новости — Учитывать средние новости в фильтре
Enable hard news (NewsHard) Важные новости — Учитывать важные новости в фильтре
Your Time Zone, GMT (for news) (offset) Часовой пояс — Смещение часового пояса GMT для новостей
Draw lines for news (DrawLines) Рисовать линии новостей — Рисовать вертикальные линии на графике для новостей
Hide past news (Draw only future ones) (HidePast) Скрыть прошедшие новости — Отображать только будущие новостные линии
TimeFilter__ Фильтр времени — Группа настроек временного фильтра
UseTimeFilter Использовать фильтр времени — Включает фильтрацию торговли по времени
Sunday Trading Hours (SundayHours) Часы торговли в воскресенье — Время торговли в воскресенье
Monday Trading Hours (MondayHours) Часы торговли в понедельник — Время торговли в понедельник
Tuesday Trading Hours (TuesdayHours) Часы торговли во вторник — Время торговли во вторник
Wednesday Trading Hours (WednesdayHours) Часы торговли в среду — Время торговли в среду
Thursday Trading Hours (ThursdayHours) Часы торговли в четверг — Время торговли в четверг
Friday Trading Hours (FridayHours) Часы торговли в пятницу — Время торговли в пятницу
Saturday Trading Hours (SaturdayHours) Часы торговли в субботу — Время торговли в субботу
Close All Trades when EA turns off (InpCloseAllTrades) Закрыть все при выключении — Закрывает все сделки при деинициализации советника
_Visor1_ Визор 1 — Группа настроек визуального дашборда
Visor1_Show_the_Time Показывать время — Отображать текущее время на графике
Visor1_Show_the_Price Показывать цену — Отображать текущую цену на графике
Visor1_Price_Up_Color Цвет роста цены — Цвет индикатора при росте цены
Visor1_Price_Down_Color Цвет падения цены — Цвет индикатора при падении цены
Visor1_Price_X_Position Позиция X цены — Горизонтальная позиция ценового индикатора
Visor1_Price_Y_Position Позиция Y цены — Вертикальная позиция ценового индикатора
Visor1_Price_Size Размер цены — Размер шрифта ценового индикатора
Получить полный код

Поиск по коду файла

???#property copyright "??LifeInDreamsWorld 2025";

#property version "";
#property strict
#property description "";

#import "user32.dll"

int PostMessageA(int,int,int,int);
int GetParent(int);
int GetAncestor(int,int);

#import

enum ENUM_LOT_MODE {
   LOT_MODE_FIXED = 1, // Fixed Lot
   LOT_MODE_PERCENT = 2 // Percent Lot
};

enum ENUM_TYPE_GRID_LOT {
   fix_lot = 0, // Fixed Start Lot 0.01 / 0.01 / 0.01 / 0.01 / 0.01 /.............
   Summ_lot = 1, // Summ Sart Lot   0.01 / 0.02 / 0.03 / 0.04 / 0.05 /.............
   Martingale = 2, // Martingale Lot  0.01 / 0.02 / 0.04 / 0.08 / 0.16 /.............
   Step_lot = 3 // Step Lot        0.01 / 0.01 / 0.01 / 0.02 / 0.02 / 0.02 / 0.03
};

enum ENUM_CLOSE_MODE {
   Close_all = 0, // All Trades
   Close_this_symbol = 1, // This Symbol
   Close_this_EA = 2 // Opened with EA
};

enum ENUM_PRICE_MODE {
   Money = 0, // Equity Money
   Percentage = 1 // Equity Percent
};

enum ENUM_CLOSENEWS_MODE {
   Close_nothing = 0, // False
   Close_all_t = 1, // All Trades
   Close_this_symbol_t = 2, // This Symbol Trades
   Close_this_EA_t = 3 // Opened with EA
};

extern bool InpManualInitGrid; // Start MANUAL Order  Grid  (Only if A / B Enable)
extern bool InpOpenNewOrders = true; // Open New Orders ?
extern bool OpenNewOrdersGrid = true; // Enable Grid ?
extern bool InpCloseAllNow; // closes all orders now
extern string Magic_ = "--------If all the engines are disabled runs a motor in buy and sell ---------";
extern bool InpEnableEngineA = true; // Enable Engine A   [BUY]
extern int InpMagic = 7799; // Magic Number  A
extern bool InpEnableEngineB = true; // Enable Engine B   [SELL]
extern int InpMagic2 = 9977; // Magic Number  B
extern string ConfigLOTE__ = "---------------------------Config Lot INIT--------------------------------------"; // LOT CONFIGURATION
extern ENUM_LOT_MODE InpLotMode = LOT_MODE_FIXED; // Lot Mode
extern double InpFixedLot = 0.01; // Fixed Lot
extern double InpPercentLot = 0.03; // Percent Lot
extern int InpTakeProfit = 100; // Take Profit in Pips
extern double GSL; // Stop Loss (Pips) - 0.0 to No SL
extern string Prop_Firm_EA_ConfigGrid__ = "---------------------------Config Grid--------------------------------------"; // GRID CONFIGURATION
extern ENUM_TYPE_GRID_LOT TypeGridLot = Martingale; // Type Grid Lot
extern int InpGridSize = 100; // Step Size in Pips
extern double InpGridFactor = 1.457; // Grid Increment Factor (If Martingale)
extern int InpGridStepLot = 4; // STEP LOT (If  Step Lot)
extern double InpMaxLot = 99; // Max Lot
extern int InpHedgex = 2; // After Level Change Lot A to B (Necessari all Engine Enable)
extern bool GridAllDirect; // Enable Grid Dual Side
extern int InpHedge; // Hedge After Level
extern string FilterOpenOneCandle__ = "--------------------Filter One Order by Candle--------------"; // FILTER ORDER
extern bool InpOpenOneCandle; // Open one order by candle
extern ENUM_TIMEFRAMES InpTimeframeBarOpen = PERIOD_CURRENT; // Timeframe OpenOneCandle
extern string MovingAverageConfig__ = "-----------------------------Moving Average-----------------------"; // MA SETUP
extern ENUM_TIMEFRAMES InpMaFrame = PERIOD_CURRENT; // Moving Average TimeFrame
extern int InpMaPeriod = 34; // Moving Average Period
extern ENUM_MA_METHOD InpMaMethod = MODE_EMA; // Moving Average Method
extern ENUM_APPLIED_PRICE InpMaPrice = PRICE_OPEN; // Moving Average Price
extern int InpMaShift; // Moving Average Shift
extern string HILOConfig__ = "-----------------------------HILO--------------------"; // HI-LO SETUP
extern bool EnableSinalHILO = true; // Enable Sinal  HILO
extern bool InpHILOFilterInverter; // If True Invert Filter
extern ENUM_TIMEFRAMES InpHILOFrame = PERIOD_CURRENT; // HILO TimeFrame
extern int InpHILOPeriod = 3; // HILO Period
extern ENUM_MA_METHOD InpHILOMethod = MODE_EMA; // HILO Method
extern int InpHILOShift; // HILO Shift
extern string TrailingStop__ = "--------------------Trailing Stop--------------"; // TRAILING STOP
extern bool InpUseTrailingStop; // Use Trailing Stop?
extern int InpTrailStart = 20; // TrailingStart
extern int InpTrailStop = 20; // Size Trailing stop
extern string BreakEven = "--------------------Break Even--------------"; // BREAKEVEN
extern bool InpUseBreakEven; // Use Break Even ?
extern int InpBreakEvenStart = 15; // Break Even Start
extern int InpBreakEvenStep = 3; // Break Even Step
extern string FilterSpread__ = "----------------------------Filter Max Spread--------------------";
extern int InpMaxSpread = 240; // Max Spread in Pips
extern string NoOpenMoreTradesWhenReaches__ = "------------------------Daily Limits / Targets ---------------"; // DAILY LIMITS
extern int MaxTrades; // Max trades (0 to NO limit)
extern double MaxLots; // Max lots (0 to NO limit)
extern string PriceRanger = "--------------------Range of Price----------------------"; // Range of Price
extern bool PriceRangerActive; // Activate Range of Price feature
extern double RangeDistance = 10; // Distance between actual price and the initial range limits
extern string EquityGuardian = "---------------------Equity Protection--------------------"; // Equity Protection
extern ENUM_CLOSE_MODE Action = Close_all; // When Equity Protection activates -> Close
extern bool CloseChart; // Close Chart
extern bool AutoTradeOFF; // Turn Off AutoTrade
extern bool CloseTerminal; // Close MetaTrader
extern double MaxFloatingDDMoney; // Max floating DrawDown in money (0 to OFF)
extern double MaxFloatingDDPercent; // Max floating DrawDown in percentage (0 to OFF)
extern double EquitySL; // Min Equity (0 to OFF)
extern ENUM_PRICE_MODE PriceModeDD = Money; // Max DD Mode
extern double MaxDailyDrawDown; // Max DD per Day (0 to no limit)
extern double MaxFloatingProfitMoney; // Max floating Profit in money (0 to OFF)
extern double MaxFloatingProfitPercent; // Max floating Profit in percentage (0 to OFF)
extern double EquityTP; // Max Equity (0 to OFF)
extern ENUM_PRICE_MODE PriceModeTP = Money; // Daily target Mode
extern double DailyTarget; // Daily target (0 to No limit)
extern string NewsFilter__ = "----------------------------News Filter------------------------";
extern bool NewsFilter; // Enable News Filter
extern ENUM_CLOSENEWS_MODE NewsAction = Close_nothing; // When News Filter activates -> Close
extern int AfterNewsStop = 120; // mins after  an event to stay out of trading
extern int BeforeNewsStop = 120; // mins before an event to stay out of trading
extern bool NewsLight; // Enable light news
extern bool NewsMedium; // Enable medium news
extern bool NewsHard = true; // Enable hard news
extern int offset = 3; // Your Time Zone, GMT (for news)
extern bool DrawLines; // Draw lines for news
extern bool HidePast; // Hide past news (Draw only future ones)
extern string TimeFilter__ = "-------------------------Scheduler---------------------------";
extern bool UseTimeFilter;
extern string SundayHours; // Sunday Trading Hours
extern string MondayHours; // Monday Trading Hours
extern string TuesdayHours; // Tuesday Trading Hours
extern string WednesdayHours; // Wednesday Trading Hours
extern string ThursdayHours; // Thursday Trading Hours
extern string FridayHours; // Friday Trading Hours
extern string SaturdayHours; // Saturday Trading Hours
extern bool InpCloseAllTrades = true; // Close All Trades when EA turns off
extern string _Visor1_ = "-----------------------------Visor 1 --------------------";
extern bool Visor1_Show_the_Time = true;
extern bool Visor1_Show_the_Price = true;
extern color Visor1_Price_Up_Color = LawnGreen;
extern color Visor1_Price_Down_Color = Tomato;
extern int Visor1_Price_X_Position = 10;
extern int Visor1_Price_Y_Position = 10;
extern int Visor1_Price_Size = 20;
extern int Visor1_Porcent_X_Position = 10;
extern int Visor1_Porcent_Y_Position = 70;
extern int Visor1_Porcent_Size = 20;
extern int Visor1_Symbol_X_Position = 10;
extern int Visor1_Symbol_Y_Position = 40;
extern int Visor1_Symbol_Size = 20;
extern int Visor1_Chart_Timezone = -5;
extern color Visor1_Time_Color = Yellow;
extern int Visor1_Time_Size = 17;
extern int Visor1_Time_X_Position = 10;
extern int Visor1_Time_Y_Position = 10;
extern int Visor1_Spread_Size = 10;
extern int Visor1_Spread_X_Position = 10;
extern int Visor1_Spread_Y_Position = 100;

bool returned_b;
long returned_l;
int returned_i;
string Is_0508;
double Ind_003;
int Ii_0528;
int Ii_0548;
bool Gb_0000;
bool Ib_0537;
double Id_0420;
double Id_0060;
bool Ib_0533;
bool Ib_0535;
bool Ib_0536;
int Ii_0578;
double Id_0418;
double Id_0400;
double Id_03F8;
double Id_0410;
double Id_0408;
string Is_0518;
string Is_04E8;
double Ind_000;
double Id_0450;
double Ind_004;
double Id_0458;
double Id_0460;
double Id_0468;
bool Ib_052D;
bool Ib_052E;
int Ii_0558;
long Il_0028;
int Ii_0540;
double Id_0480;
double Id_04B0;
double Id_04B8;
double Id_04C0;
double Id_04C8;
bool Ib_052F;
bool Ib_0530;
int Ii_0564;
long Il_0030;
int Ii_0544;
double Id_04D8;
string Is_04F8;
bool Ib_0532;
int Gi_0000;
string Is_0008;
string Is_0588;
long Gl_0000;
string Is_C150;
int Gi_0001;
int Gi_0002;
int Gi_0003;
int Gi_0004;
bool Gb_0003;
int Gi_0005;
double Gd_0003;
double Gd_0006;
int Gi_0007;
int Ii_0020;
double Gd_0007;
double Gd_0008;
int Gi_0009;
bool Ib_0000;
double Id_03F0;
double Gd_0009;
double Gd_000A;
bool Gb_000B;
double Gd_000B;
int Gi_000C;
int Gi_000D;
int Ii_054C;
double Gd_000C;
bool Gb_000E;
int Gi_000E;
string Gs_000E;
int Gi_000F;
string Gs_000F;
int Gi_0010;
string Gs_0010;
int Gi_0011;
string Gs_0011;
int Gi_0012;
string Gs_0012;
int Gi_0013;
string Gs_0013;
int Gi_0014;
string Gs_0014;
bool Gb_0015;
int Gi_0016;
int Gi_0017;
int Gi_0018;
int Gi_0019;
double Gd_0017;
double Gd_001A;
int Gi_001B;
double Gd_001B;
double Gd_001C;
int Gi_001D;
bool Gb_001D;
bool Ib_0538;
bool Ib_0534;
int Gi_001E;
int Gi_001F;
int Gi_0020;
bool Gb_001F;
int Gi_0021;
int Gi_0022;
int Gi_0023;
bool Gb_0022;
double Gd_0022;
int Gi_0024;
int Gi_0025;
bool Gb_0024;
double Gd_0026;
int Gi_0027;
int Gi_0028;
int Ii_057C;
double Id_0058;
double Id_0018;
bool Ib_0024;
long Il_0038;
double Id_0040;
double Id_0048;
double Id_0050;
double Id_0068;
double Id_03C8;
double Id_03D0;
double Id_03D8;
double Id_03E0;
double Id_03E8;
double Id_0428;
double Id_0430;
double Id_0438;
double Id_0440;
double Id_0448;
double Id_0470;
double Id_0478;
double Id_0488;
double Id_0490;
double Id_0498;
double Id_04A0;
double Id_04A8;
double Id_04D0;
double Id_04E0;
int Ii_0524;
bool Ib_052C;
bool Ib_0531;
int Ii_053C;
int Ii_0550;
int Ii_0554;
int Ii_055C;
int Ii_0560;
int Ii_0568;
int Ii_056C;
int Ii_0570;
int Ii_0574;
int Ii_0580;
int Ii_0584;
long Il_C148;
long Gl_0001;
string Gs_0002;
short Gst_0003;
short returned_st;
string Gs_0001;
string Gs_0004;
short Gst_0005;
string Gs_0003;
string Gs_0005;
int Gi_0006;
string Gs_0006;
string Gs_0007;
int Gi_0008;
string Gs_0008;
double Gd_0000;
double Gd_0001;
bool Gb_0001;
bool Gb_0005;
bool Gb_0007;
int Gi_000A;
double Gd_0002;
int Gi_000B;
double Gd_0005;
bool Gb_0004;
double Gd_0004;
bool Gb_000C;
double Ind_001;
double Ind_002;
bool Gb_0002;
long Gl_0005;
long Gl_0006;
long Gl_0007;
long Gl_0008;
long Gl_0009;
bool Gb_0009;
string Gs_000A;
long Gl_0002;
long Gl_0003;
long Gl_000A;
string Gs_000B;
string Gs_000C;
string Gs_000D;
long Gl_0010;
long Gl_0011;
string Gs_0009;
double Gd_000D;
double Gd_000E;
double Gd_000F;
double Gd_0011;
bool Gb_0013;
double Gd_0013;
double Gd_0015;
bool Gb_0016;
double Gd_0016;
double Gd_0018;
int Gi_0015;
double Gd_0014;
int Gi_002F;
long Gl_0017;
double Gd_0019;
int Gi_001A;
int Gi_001C;
double Gd_001D;
int Gi_0029;
double Gd_002B;
int Gi_002C;
int Gi_002D;
double Gd_002C;
double Gd_002E;
int Gi_0030;
double Gd_002F;
int Gi_002A;
int Gi_0026;
double Gd_0021;
double Gd_0023;
double Gd_0024;
double Gd_0025;
double Gd_0027;
double Gd_0029;
double Gd_002A;
long Gl_0004;
bool Gb_001C;
double Gd_001F;
double Gd_0010;
bool Gb_000D;
double Id_00A4[100];
string Is_05C8[4][1000];
double returned_double;
bool order_check;
int init() {
      // код доступен только после оплаты
   }

void OnTick() {
      // код доступен только после оплаты
   }

void OnDeinit(const int reason) {
   ObjectDelete("butN4");
   ObjectDelete("butCAO");
   ObjectDelete("butCAP");
   ObjectDelete("butCAL");
   if (reason != 3) {
      ObjectDelete("butRange");
      ObjectDelete("SupRange");
      ObjectDelete("InfRange");
   }
   ObjectDelete("Market_Price_Label");
   ObjectDelete("Time_Label");
   ObjectDelete("TM");
   ObjectDelete("Porcent_Price_Label");
   ObjectDelete("Spread_Price_Label");
   ObjectDelete("Simbol_Price_Label");
   ObjectDelete("N4BG");
   ObjectDelete("butResDD");
   ObjectDelete("MaxFloatDD_Label");
   ObjectDelete("butMinEquity");
   ObjectDelete("MinEquity_Label");
   ChartSetInteger(0, 12, 1);
   ObjectsDeleteAll(0, 0);
}

void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam) {
   if (sparam == "butCAO") {
      func_1116(1);
   }
   if (sparam == "butCAP") {
      func_1116(2);
   }
   if (sparam == "butCAL") {
      func_1116(3);
   }
   if (sparam == "butN4") {
      func_1116(4);
   }
   if (sparam == "butResDD") {
      func_1116(5);
   }
   if (sparam == "butMinEquity") {
      func_1116(6);
   }
   if (sparam != "butRange") return;
   func_1116(7);

}

double OnTester() {
   string tmp_str0000;
   double Ld_FFF8;

   func_1058(3);
   tmp_str0000 = Is_0518 + "MaxDD: ";
   tmp_str0000 = tmp_str0000 + DoubleToString(Id_0400, 2);
   PrintFormat(tmp_str0000);
   Ld_FFF8 = AccountEquity();
   return Ld_FFF8;
}

bool func_1009(string &Fa_s_00[]) {
   string tmp_str0000;
   string tmp_str0001;
   string tmp_str0002;
   string tmp_str0003;
   string tmp_str0004;
   string tmp_str0005;
   bool Lb_FFFE;
   long Ll_FFF0;
   long Ll_FFE8;
   string Ls_FFD8;
   string Ls_FFC8;
   long Ll_FF58;
   int Li_FF54;
   int Li_FF50;
   int Li_FF4C;
   int Li_FF48;
   bool Lb_FFFF;

   Lb_FFFE = false;
   Ll_FFF0 = 0;
   Ll_FFE8 = 0;
   string Ls_FF94[];
   string Ls_FF60[];
   Ll_FF58 = TimeCurrent();
   Li_FF54 = TimeDayOfWeek(Time[0]) - 1;
   tmp_str0000 = ",";
   tmp_str0001 = Fa_s_00[Li_FF54];
   Gst_0003 = (short)StringGetCharacter(tmp_str0000, 0);
   Li_FF50 = StringSplit(tmp_str0001, Gst_0003, Ls_FF94);
   if (Li_FF50 > 0) {
      Li_FF4C = 0;
      if (Li_FF50 > 0) {
         do {
            tmp_str0002 = "-";
            tmp_str0003 = Ls_FF94[Li_FF4C];
            Gst_0005 = (short)StringGetCharacter(tmp_str0002, 0);
            Li_FF48 = StringSplit(tmp_str0003, Gst_0005, Ls_FF60);
            if (Li_FF48 == 1) {
               if (Li_FF4C == 0) {
                  Ls_FFD8 = "00:00";
                  Ls_FFC8 = Ls_FF60[0];
               } else {
                  Ls_FFD8 = Ls_FF60[0];
                  Ls_FFC8 = "23:59";
               }
            } else {
               if (Li_FF48 == 2) {
                  Ls_FFD8 = Ls_FF60[0];
                  Ls_FFC8 = Ls_FF60[1];
               }
            }
            tmp_str0004 = DoubleToString(Year(), 0);
            tmp_str0004 = tmp_str0004 + ".";
            tmp_str0004 = tmp_str0004 + DoubleToString(Month(), 0);
            tmp_str0004 = tmp_str0004 + ".";
            tmp_str0004 = tmp_str0004 + DoubleToString(Day(), 0);
            tmp_str0004 = tmp_str0004 + " ";
            tmp_str0004 = tmp_str0004 + Ls_FFD8;
            Ll_FFF0 = StringToTime(tmp_str0004);
            tmp_str0005 = DoubleToString(Year(), 0);
            tmp_str0005 = tmp_str0005 + ".";
            tmp_str0005 = tmp_str0005 + DoubleToString(Month(), 0);
            tmp_str0005 = tmp_str0005 + ".";
            tmp_str0005 = tmp_str0005 + DoubleToString(Day(), 0);
            tmp_str0005 = tmp_str0005 + " ";
            tmp_str0005 = tmp_str0005 + Ls_FFC8;
            Ll_FFE8 = StringToTime(tmp_str0005);
            if (Ll_FF58 >= Ll_FFF0 && Ll_FF58 < Ll_FFE8) {
               Lb_FFFE = true;
            }
            Li_FF4C = Li_FF4C + 1;
         } while (Li_FF4C < Li_FF50);
      }
   }
   Lb_FFFF = Lb_FFFE;
   ArrayFree(Ls_FF60);
   ArrayFree(Ls_FF94);
   return Lb_FFFE;
}

bool func_1057() {
   string tmp_str0000;
   string tmp_str0001;
   string tmp_str0002;
   string tmp_str0003;
   string tmp_str0004;
   string tmp_str0005;
   string tmp_str0006;
   string tmp_str0007;
   string tmp_str0008;
   string tmp_str0009;
   string tmp_str000A;
   string tmp_str000B;
   double Ld_FFF0;
   bool Lb_FFFF;
   double Ld_FFE8;
   double Ld_FFE0;

   Gd_0000 = 0;
   Gi_0001 = OrdersTotal() - 1;
   Gi_0002 = Gi_0001;
   if (Gi_0001 >= 0) {
      do {
         Ii_054C = OrderSelect(Gi_0002, 0, 0);
         Gd_0001 = OrderProfit();
         Gd_0000 = ((Gd_0001 + OrderCommission()) + Gd_0000);
         Gi_0002 = Gi_0002 - 1;
      } while (Gi_0002 >= 0);
   }
   Ld_FFF0 = Gd_0000;
   if ((MaxFloatingDDMoney > 0) && (Gd_0000 < 0)) {
      Gd_0001 = -Gd_0000;
      if ((Gd_0001 > MaxFloatingDDMoney)) {
         tmp_str0000 = "STOP OUT because Max Floating DD Money is reached. Drawdown = " + DoubleToString(Gd_0000, 2);
         PrintFormat(tmp_str0000);
         Lb_FFFF = false;
         return Lb_FFFF;
      }
   }
   Ld_FFE8 = ((AccountBalance() * MaxFloatingDDPercent) / 100);
   if ((MaxFloatingDDPercent > 0) && (Ld_FFF0 < 0)) {
      Gd_0001 = -Ld_FFF0;
      if ((Gd_0001 > Ld_FFE8)) {
         tmp_str0001 = "STOP OUT because Max Floating DD Percent is reached. Drawdown = " + DoubleToString(Ld_FFF0, 2);
         PrintFormat(tmp_str0001);
         Lb_FFFF = false;
         return Lb_FFFF;
      }
   }
   if ((EquitySL > 0) && (AccountEquity() <= EquitySL)) {
      Gi_0001 = 0;
      Gi_0003 = OrdersTotal() - 1;
      Gi_0004 = Gi_0003;
      if (Gi_0003 >= 0) {
         do {
            if (OrderSelect(Gi_0004, 0, 0) && OrderSymbol() == _Symbol) {
               if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                  if (OrderSymbol() == _Symbol) {
                     if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                        if (OrderType() == OP_SELL || OrderType() == OP_BUY) {

                           Gi_0001 = Gi_0001 + 1;
                        }
                     }
                  }
               }
            }
            Gi_0004 = Gi_0004 - 1;
         } while (Gi_0004 >= 0);
      }
      if (Gi_0001 > 0) {
         tmp_str0002 = "STOP OUT because Equity is lower than EquitySL. Actual Equity = " + DoubleToString(AccountEquity(), 2);
         PrintFormat(tmp_str0002);
      } else {
         tmp_str0003 = "EA is OFF because Equity is lower than EquitySL. Actual Equity = " + DoubleToString(AccountEquity(), 2);
         PrintFormat(tmp_str0003);
      }
      Lb_FFFF = false;
      return Lb_FFFF;
   }
   if ((AccountEquity() <= Id_03E0) && (MaxDailyDrawDown > 0)) {
      Gi_0003 = 0;
      Gi_0005 = OrdersTotal() - 1;
      Gi_0006 = Gi_0005;
      if (Gi_0005 >= 0) {
         do {
            if (OrderSelect(Gi_0006, 0, 0) && OrderSymbol() == _Symbol) {
               if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                  if (OrderSymbol() == _Symbol) {
                     if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                        if (OrderType() == OP_SELL || OrderType() == OP_BUY) {

                           Gi_0003 = Gi_0003 + 1;
                        }
                     }
                  }
               }
            }
            Gi_0006 = Gi_0006 - 1;
         } while (Gi_0006 >= 0);
      }
      if (Gi_0003 > 0) {
         tmp_str0004 = "STOP OUT because Max Daily DD is reached. Actual Equity = " + DoubleToString(AccountEquity(), 2);
         PrintFormat(tmp_str0004);
      } else {
         tmp_str0005 = "EA is OFF until tomorrow because Max Daily DD was reached. Actual Equity = " + DoubleToString(AccountEquity(), 2);
         PrintFormat(tmp_str0005);
      }
      Lb_FFFF = false;
      return Lb_FFFF;
   }
   if ((MaxFloatingProfitMoney > 0) && (Ld_FFF0 > MaxFloatingProfitMoney)) {
      tmp_str0006 = "TAKE PROFIT because Max Floating Profit Money is reached. Actual Profit = " + DoubleToString(Ld_FFF0, 2);
      PrintFormat(tmp_str0006);
      Lb_FFFF = false;
      return Lb_FFFF;
   }
   Ld_FFE0 = ((AccountBalance() * MaxFloatingProfitPercent) / 100);
   if ((MaxFloatingProfitPercent > 0) && (Ld_FFF0 > Ld_FFE0)) {
      tmp_str0007 = "TAKE PROFIT because Max Floating Profit Percent is reached. Actual Profit = " + DoubleToString(Ld_FFF0, 2);
      tmp_str0007 = tmp_str0007 + " MaxFloating = ";
      tmp_str0007 = tmp_str0007 + DoubleToString(MaxFloatingProfitMoney, 2);
      PrintFormat(tmp_str0007);
      Lb_FFFF = false;
      return Lb_FFFF;
   }
   if ((EquityTP > 0) && (AccountEquity() >= EquityTP)) {
      Gi_0005 = 0;
      Gi_0007 = OrdersTotal() - 1;
      Gi_0008 = Gi_0007;
      if (Gi_0007 >= 0) {
         do {
            if (OrderSelect(Gi_0008, 0, 0) && OrderSymbol() == _Symbol) {
               if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                  if (OrderSymbol() == _Symbol) {
                     if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                        if (OrderType() == OP_SELL || OrderType() == OP_BUY) {

                           Gi_0005 = Gi_0005 + 1;
                        }
                     }
                  }
               }
            }
            Gi_0008 = Gi_0008 - 1;
         } while (Gi_0008 >= 0);
      }
      if (Gi_0005 > 0) {
         tmp_str0008 = "TAKE PROFIT because Equity is higher than EquityTP. Actual Equity = " + DoubleToString(AccountEquity(), 2);
         PrintFormat(tmp_str0008);
      } else {
         tmp_str0009 = "EA is OFF because Equity is higher than EquityTP. Actual Equity = " + DoubleToString(AccountEquity(), 2);
         PrintFormat(tmp_str0009);
      }
      Lb_FFFF = false;
      return Lb_FFFF;
   }
   if ((AccountEquity() < Id_03E8)) return true;
   if ((DailyTarget <= 0)) return true;
   Gi_0007 = 0;
   Gi_0009 = OrdersTotal() - 1;
   Gi_000A = Gi_0009;
   if (Gi_0009 >= 0) {
      do {
         if (OrderSelect(Gi_000A, 0, 0) && OrderSymbol() == _Symbol) {
            if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

               if (OrderSymbol() == _Symbol) {
                  if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                     if (OrderType() == OP_SELL || OrderType() == OP_BUY) {

                        Gi_0007 = Gi_0007 + 1;
                     }
                  }
               }
            }
         }
         Gi_000A = Gi_000A - 1;
      } while (Gi_000A >= 0);
   }
   if (Gi_0007 > 0) {
      tmp_str000A = "TAKE PROFIT because Daily Target is reached. Actual Equity = " + DoubleToString(AccountEquity(), 2);
      PrintFormat(tmp_str000A);
   } else {
      tmp_str000B = "EA is OFF until tomorrow because Daily Target was reached. Actual Equity = " + DoubleToString(AccountEquity(), 2);
      PrintFormat(tmp_str000B);
   }
   Lb_FFFF = false;
   return Lb_FFFF;

   Lb_FFFF = true;

   return Lb_FFFF;
}

void func_1058(int Fa_i_00) {
   string tmp_str0000;
   string tmp_str0001;
   string tmp_str0002;
   string tmp_str0003;
   string tmp_str0004;
   double Ld_FFF8;
   double Ld_FFF0;
   int Li_FFEC;
   int Li_FFE8;
   string Ls_FFD8;

   if (PriceModeDD == 0) {
      Gd_0000 = MaxDailyDrawDown;
   } else {
      Gd_0000 = ((AccountEquity() * MaxDailyDrawDown) / 100);
   }
   Ld_FFF8 = Gd_0000;
   if (PriceModeTP == 0) {
      Gd_0000 = DailyTarget;
   } else {
      Gd_0000 = ((AccountEquity() * DailyTarget) / 100);
   }
   Ld_FFF0 = Gd_0000;
   if ((Id_03F8 > Id_0400)) {
      Id_0400 = Id_03F8;
   }
   Id_0410 = (AccountEquity() - Id_03F0);
   Li_FFEC = TimeDay(TimeCurrent());
   Li_FFE8 = TimeDayOfWeek(TimeCurrent());
   if (Fa_i_00 != 3) {
      if (Li_FFE8 == 1) {
         Li_FFEC = Li_FFEC - 3;
      } else {
         Li_FFEC = Li_FFEC - 1;
      }
   }
   tmp_str0000 = (string)Li_FFEC;
   tmp_str0000 = "\n" + tmp_str0000;
   tmp_str0000 = tmp_str0000 + "/";
   tmp_str0001 = (string)TimeMonth(TimeCurrent());
   tmp_str0000 = tmp_str0000 + tmp_str0001;
   tmp_str0000 = tmp_str0000 + "/";
   tmp_str0001 = (string)TimeYear(TimeCurrent());
   tmp_str0000 = tmp_str0000 + tmp_str0001;
   tmp_str0000 = tmp_str0000 + " ==> ";
   tmp_str0000 = tmp_str0000 + DoubleToString(Id_0410, 2);
   tmp_str0000 = tmp_str0000 + " -> ";
   tmp_str0000 = tmp_str0000 + DoubleToString(Id_0408, 2);
   tmp_str0000 = tmp_str0000 + " TP - ";
   tmp_str0000 = tmp_str0000 + DoubleToString(Id_03F8, 2);
   tmp_str0000 = tmp_str0000 + " DD";
   Ls_FFD8 = tmp_str0000;
   if (Fa_i_00 == 0) {
      tmp_str0001 = "\n\nBalance Inicial: " + DoubleToString(AccountBalance(), 2);
      tmp_str0001 = tmp_str0001 + "\n";
      Is_0518 = tmp_str0001;
   } else {
      if (Fa_i_00 == 2) {
         PrintFormat(Ls_FFD8);
         Is_0518 = Is_0518 + Ls_FFD8;
      } else {
         if (Fa_i_00 == 3) {
            if (TimeDayOfWeek(TimeCurrent()) == 0) {
               Li_FFEC = Li_FFEC - 2;
            }
            if (TimeDayOfWeek(TimeCurrent()) == 6) {
               Li_FFEC = Li_FFEC - 1;
            }
            Is_0518 = Is_0518 + Ls_FFD8;
            tmp_str0001 = "\n\nBalance Final: " + DoubleToString(AccountBalance(), 2);
            tmp_str0001 = tmp_str0001 + " - ";
            Is_0518 = Is_0518 + tmp_str0001;
         }
      }
   }
   if (Fa_i_00 == 2) {
      Id_0410 = 0;
      Id_0408 = 0;
      Id_03F8 = 0;
      returned_double = AccountEquity();
      Id_03F0 = returned_double;
      Id_03E0 = (Id_03F0 - Ld_FFF8);
      Id_03E8 = (returned_double + Ld_FFF0);
      tmp_str0001 = "Actual Equity: " + DoubleToString(AccountEquity(), 2);
      PrintFormat(tmp_str0001);
      tmp_str0002 = "min Equity: " + DoubleToString(Id_03E0, 2);
      PrintFormat(tmp_str0002);
      tmp_str0003 = "max Equity: " + DoubleToString(Id_03E8, 2);
      PrintFormat(tmp_str0003);
      tmp_str0004 = "MaxDD: " + DoubleToString(Id_0400, 2);
      PrintFormat(tmp_str0004);
   }
   Ib_0534 = false;
}

void func_1059() {
   if (Action == 0) {
      PrintFormat("Equity Protection -> Closing all trades");
      Gi_0000 = OrdersTotal() - 1;
      Gi_0001 = Gi_0000;
      if (Gi_0000 >= 0) {
         do {
            if (OrderSelect(Gi_0001, 0, 0)) {
               if (OrderType() == OP_BUY) {
                  Gd_0000 = NormalizeDouble(Bid, _Digits);
               } else {
                  Gd_0000 = NormalizeDouble(Ask, _Digits);
               }
               if (OrderClose(OrderTicket(), OrderLots(), Gd_0000, Ii_0020, 255) != true) {
                  Print("OrderClose Error N", GetLastError());
               }
            }
            Gi_0001 = Gi_0001 - 1;
         } while (Gi_0001 >= 0);
      }
   } else {
      if (Action == 1) {
         PrintFormat("Equity Protection -> Closing only this symbol trades");
         Gi_0003 = OrdersTotal() - 1;
         Gi_0004 = Gi_0003;
         if (Gi_0003 >= 0) {
            do {
               if (OrderSelect(Gi_0004, 0, 0) && OrderSymbol() == _Symbol) {
                  if (OrderSymbol() == _Symbol) {
                     if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                        if (OrderType() == OP_BUY) {
                           order_check = OrderClose(OrderTicket(), OrderLots(), Bid, Ii_0020, 16711680);
                        }
                        if (OrderType() == OP_SELL) {
                           order_check = OrderClose(OrderTicket(), OrderLots(), Ask, Ii_0020, 255);
                        }
                     }
                  }
                  Sleep(1000);
               }
               Gi_0004 = Gi_0004 - 1;
            } while (Gi_0004 >= 0);
         }
      } else {
         if (Action == 2) {
            PrintFormat("Equity Protection -> Closing trades opened by the EA");
            Gi_0008 = OrdersTotal() - 1;
            Gi_0009 = Gi_0008;
            if (Gi_0008 >= 0) {
               do {
                  if (OrderSelect(Gi_0009, 0, 0)) {
                     if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                        if (OrderType() == OP_BUY) {
                           Gd_0008 = NormalizeDouble(Bid, _Digits);
                        } else {
                           Gd_0008 = NormalizeDouble(Ask, _Digits);
                        }
                        if (OrderClose(OrderTicket(), OrderLots(), Gd_0008, Ii_0020, 255) != true) {
                           Print(" OrderClose Error N", GetLastError());
                        }
                     }
                  }
                  Gi_0009 = Gi_0009 - 1;
               } while (Gi_0009 >= 0);
            }
         }
      }
   }
   if (CloseTerminal) {
      PostMessageA(GetParent(GetParent(GetParent(WindowHandle(_Symbol, _Period)))), 16, 0, 0);
   }
   if (CloseChart) {
      ChartClose(0);
   }
   if (AutoTradeOFF == false) return;
   Gi_000B = GetAncestor(WindowHandle(_Symbol, _Period), 2);
   if (Gi_000B != 0) {
      if (TerminalInfoInteger(8) != 0) {
         PostMessageA(Gi_000B, 273, 33020, 0);
         Print("AutoTrading disabled");
         return ;
      }
      Print("AutoTrading already disabled");
      return ;
   }
   Print("GetAncestor error: ", GetLastError());

}

void func_1060() {
   if (NewsAction == 1) {
      PrintFormat("News Filter -> Closing all trades");
      Gi_0000 = OrdersTotal() - 1;
      Gi_0001 = Gi_0000;
      if (Gi_0000 < 0) return;
      do {
         if (OrderSelect(Gi_0001, 0, 0)) {
            if (OrderType() == OP_BUY) {
               Gd_0000 = NormalizeDouble(Bid, _Digits);
            } else {
               Gd_0000 = NormalizeDouble(Ask, _Digits);
            }
            if (OrderClose(OrderTicket(), OrderLots(), Gd_0000, Ii_0020, 255) != true) {
               Print("OrderClose Error N", GetLastError());
            }
         }
         Gi_0001 = Gi_0001 - 1;
      } while (Gi_0001 >= 0);
      return ;
   }
   if (NewsAction == 2) {
      PrintFormat("News Filter -> Closing only this symbol trades");
      Gi_0003 = OrdersTotal() - 1;
      Gi_0004 = Gi_0003;
      if (Gi_0003 < 0) return;
      do {
         if (OrderSelect(Gi_0004, 0, 0) && OrderSymbol() == _Symbol) {
            if (OrderSymbol() == _Symbol) {
               if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

                  if (OrderType() == OP_BUY) {
                     order_check = OrderClose(OrderTicket(), OrderLots(), Bid, Ii_0020, 16711680);
                  }
                  if (OrderType() == OP_SELL) {
                     order_check = OrderClose(OrderTicket(), OrderLots(), Ask, Ii_0020, 255);
                  }
               }
            }
            Sleep(1000);
         }
         Gi_0004 = Gi_0004 - 1;
      } while (Gi_0004 >= 0);
      return ;
   }
   if (NewsAction == 3) {
      PrintFormat("News Filter -> Closing trades opened by the EA");
      Gi_0008 = OrdersTotal() - 1;
      Gi_0009 = Gi_0008;
      if (Gi_0008 < 0) return;
      do {
         if (OrderSelect(Gi_0009, 0, 0)) {
            if (OrderMagicNumber() == InpMagic || OrderMagicNumber() == InpMagic2) {

               if (OrderType() == OP_BUY) {
                  Gd_0008 = NormalizeDouble(Bid, _Digits);
               } else {
                  Gd_0008 = NormalizeDouble(Ask, _Digits);
               }
               if (OrderClose(OrderTicket(), OrderLots(), Gd_0008, Ii_0020, 255) != true) {
                  Print(" OrderClose Error N", GetLastError());
               }
            }
         }
         Gi_0009 = Gi_0009 - 1;
      } while (Gi_0009 >= 0);
      return ;
   }
   if (NewsAction != 0) return;
   PrintFormat("News Filter ON but settings configured to not close trades");

}

int func_1063(int Fa_i_00, double Fa_d_01, double Fa_d_02, int Fa_i_03, string arg4, double Fa_d_05, double Fa_d_06) {
   string tmp_str0000;
   double Ld_FFF0;
   int Li_FFFC;

   Ld_FFF0 = 0;
   if (Fa_i_00 == 0) {
      Gi_0000 = 1;
      Gi_0001 = 0;
      Gi_0002 = OrdersTotal() - 1;
      Gi_0003 = Gi_0002;
      if (Gi_0002 >= 0) {
         do {
            Ii_054C = OrderSelect(Gi_0003, 0, 0);
            if (OrderSymbol() == _Symbol && OrderType() == OP_BUY) {
               Gi_0001 = Gi_0001 + 1;
            }
            Gi_0003 = Gi_0003 - 1;
         } while (Gi_0003 >= 0);
      }
      if (Gi_0001 == 0) {
         if ((GSL == 0)) {
            Gd_0004 = GSL;
         } else {
            Gd_0005 = ((GSL * _Point) * 10);
            Gd_0004 = (Ask - Gd_0005);
         }
         Ld_FFF0 = Gd_0004;
         Id_03D0 = Gd_0004;
      } else {
         Gi_0005 = 1;
         Gd_0006 = 0;
         Gi_0007 = OrdersTotal() - 1;
         if (Gi_0007 >= 0) {
            order_check = OrderSelect(Gi_0007, 0, 0);
            if (OrderSymbol() == _Symbol && OrderType() == OP_BUY && (OrderStopLoss() > 0)) {
               Gd_0006 = OrderStopLoss();
            }
         }
         if (Gi_0005 == 2) {
            Gi_0007 = OrdersTotal() - 1;
            if (Gi_0007 >= 0) {
               order_check = OrderSelect(Gi_0007, 0, 0);
               if (OrderSymbol() == _Symbol && OrderType() == OP_SELL && (OrderStopLoss() > 0)) {
                  Gd_0006 = OrderStopLoss();
               }
            }
         }
         Ld_FFF0 = Gd_0006;
         if ((GSL != 0) && (Gd_0006 == 0)) {
            Gd_0007 = ((GSL * _Point) * 10);
            Ld_FFF0 = (Ask - Gd_0007);
         }
      }
   }
   if (Fa_i_00 == 1) {
      Gi_0007 = 2;
      Gi_0008 = 0;
      Gi_0009 = OrdersTotal() - 1;
      Gi_000A = Gi_0009;
      if (Gi_0009 >= 0) {
         do {
            Ii_054C = OrderSelect(Gi_000A, 0, 0);
            if (OrderSymbol() == _Symbol && OrderType() == OP_SELL) {
               Gi_0008 = Gi_0008 + 1;
            }
            Gi_000A = Gi_000A - 1;
         } while (Gi_000A >= 0);
      }
      if (Gi_0008 == 0) {
         if ((GSL == 0)) {
            Gd_000B = GSL;
         } else {
            Gd_000B = (((GSL * _Point) * 10) + Bid);
         }
         Ld_FFF0 = Gd_000B;
         Id_03D8 = Gd_000B;
      } else {
         Gd_000B = 0;
         Gi_000C = OrdersTotal() - 1;
         if (Gi_000C >= 0) {
            order_check = OrderSelect(Gi_000C, 0, 0);
            if (OrderSymbol() == _Symbol && OrderType() == OP_SELL && (OrderStopLoss() > 0)) {
               Gd_000B = OrderStopLoss();
            }
         }
         Ld_FFF0 = Gd_000B;
         if ((GSL != 0) && (Gd_000B == 0)) {
            Ld_FFF0 = (((GSL * _Point) * 10) + Bid);
         }
      }
   }
   tmp_str0000 = "Order Send: Price = " + DoubleToString(Fa_d_02, 4);
   tmp_str0000 = tmp_str0000 + " GSL = ";
   tmp_str0000 = tmp_str0000 + DoubleToString(GSL, 4);
   tmp_str0000 = tmp_str0000 + "  STOP = ";
   tmp_str0000 = tmp_str0000 + DoubleToString(Ld_FFF0, 4);
   Print(tmp_str0000);
   Li_FFFC = OrderSend(Is_04E8, Fa_i_00, Fa_d_01, Fa_d_02, Ii_0020, Ld_FFF0, Fa_d_06, " ", Fa_i_03, 0, 4294967295);
   return Li_FFFC;
}

void func_1088(int Fa_i_00, int Fa_i_01, double Fa_d_02, int Fa_i_03) {
   string tmp_str0000;
   string tmp_str0001;
   int Li_FFFC;
   double Ld_FFF0;
   double Ld_FFE8;
   double Ld_FFE0;
   bool Lb_FFDF;
   int Li_FFD8;

   Li_FFFC = 0;
   Gi_0000 = _Digits - 1;
   returned_double = MathPow(10, Gi_0000);
   Ld_FFF0 = ((double)1 / returned_double);
   if (_Digits == 3 || _Digits == 5) {

      Gi_0000 = _Digits - 1;
      returned_double = MathPow(10, Gi_0000);
      Ld_FFF0 = ((double)1 / returned_double);
   } else {
      Ld_FFF0 = _Point;
   }
   Ld_FFE8 = 0;
   Ld_FFE0 = 0;
   Lb_FFDF = false;
   if (Fa_i_01 == 0) return;
   Li_FFD8 = OrdersTotal() - 1;
   if (Li_FFD8 < 0) return;
   do {
      if (OrderSelect(Li_FFD8, 0, 0) && OrderSymbol() == _Symbol && OrderMagicNumber() == Fa_i_03) {
         if (OrderSymbol() == _Symbol || OrderMagicNumber() == Fa_i_03) {

            if (OrderType() == OP_BUY) {
               Gd_0000 = (Bid - Fa_d_02);
               Li_FFFC = (int)NormalizeDouble((Gd_0000 / _Point), 0);
               Gd_0000 = (Fa_i_00 * Ld_FFF0);
               if (Li_FFFC >= Gd_0000) {
                  Ld_FFE8 = OrderStopLoss();
                  Gd_0000 = (Fa_i_01 * Ld_FFF0);
                  Ld_FFE0 = (Bid - Gd_0000);
                  Gd_0000 = Ld_FFE0;
                  Gd_0001 = Bid;
                  Gi_0002 = 0;
                  Gd_0003 = 0;
                  Gd_0004 = 0;
                  Gd_0004 = MarketInfo(_Symbol, MODE_STOPLEVEL);
                  if (_Digits == 3 || _Digits == 5) {

                     Gd_0004 = (Gd_0004 / 10);
                  }
                  Gd_0003 = Gd_0000;
                  if (Gi_0002 == 0) {
                     Gd_0005 = (Gd_0001 - Gd_0000);
                     if ((Gd_0005 < (Gd_0004 * _Point))) {
                        Gd_0003 = 0;
                     }
                  }
                  if (Gi_0002 == 1) {
                     Gd_0005 = (Gd_0003 - Gd_0001);
                     if ((Gd_0005 < (Gd_0004 * _Point))) {
                        Gd_0003 = 0;
                     }
                  }
                  returned_double = NormalizeDouble(Gd_0003, (int)MarketInfo(_Symbol, MODE_DIGITS));
                  Ld_FFE0 = returned_double;
                  if (Ld_FFE8 == 0 || (Ld_FFE8 != 0 && returned_double > Ld_FFE8)) {

                     OrderTicket();
                     if (OrdersTotal() > 0 && (Fa_d_02 < Ld_FFE0)) {
                        Lb_FFDF = OrderModify(OrderTicket(), Fa_d_02, Ld_FFE0, OrderTakeProfit(), 0, 16776960);
                        if (Lb_FFDF != true) {
                           tmp_str0000 = "Normal";
                           Gi_0006 = GetLastError();
                           if (Gi_0006 != 1 && Gi_0006 != 130) {
                              Print(tmp_str0000, ": Ordem: ", OrderTicket(), ". Falha ao tentar alterar ordem: ", Gi_0006, " ");
                           }
                        }
                     }
                  }
               }
            }
            if (OrderType() == OP_SELL) {
               Gd_0007 = (Fa_d_02 - Ask);
               Li_FFFC = (int)NormalizeDouble((Gd_0007 / _Point), 0);
               Gd_0007 = (Fa_i_00 * Ld_FFF0);
               if (Li_FFFC >= Gd_0007) {
                  Ld_FFE8 = OrderStopLoss();
                  Ld_FFE0 = ((Fa_i_01 * Ld_FFF0) + Ask);
                  Gd_0007 = Ld_FFE0;
                  Gd_0008 = Ask;
                  Gi_0009 = 1;
                  Gd_000A = 0;
                  Gd_000B = 0;
                  Gd_000B = MarketInfo(_Symbol, MODE_STOPLEVEL);
                  if (_Digits == 3 || _Digits == 5) {

                     Gd_000B = (Gd_000B / 10);
                  }
                  Gd_000A = Gd_0007;
                  if (Gi_0009 == 0) {
                     Gd_000C = (Gd_0008 - Gd_0007);
                     if ((Gd_000C < (Gd_000B * _Point))) {
                        Gd_000A = 0;
                     }
                  }
                  if (Gi_0009 == 1) {
                     Gd_000C = (Gd_000A - Gd_0008);
                     if ((Gd_000C < (Gd_000B * _Point))) {
                        Gd_000A = 0;
                     }
                  }
                  returned_double = NormalizeDouble(Gd_000A, (int)MarketInfo(_Symbol, MODE_DIGITS));
                  Ld_FFE0 = returned_double;
                  if (Ld_FFE8 == 0 || (Ld_FFE8 != 0 && returned_double < Ld_FFE8)) {

                     OrderTicket();
                     if (OrdersTotal() > 0 && (Fa_d_02 > Ld_FFE0)) {
                        Lb_FFDF = OrderModify(OrderTicket(), Fa_d_02, Ld_FFE0, OrderTakeProfit(), 0, 255);
                        if (Lb_FFDF != true) {
                           tmp_str0001 = "Normal";
                           Gi_000D = GetLastError();
                           if (Gi_000D != 1 && Gi_000D != 130) {
                              Print(tmp_str0001, ": Ordem: ", OrderTicket(), ". Falha ao tentar alterar ordem: ", Gi_000D, " ");
                           }
                        }
                     }
                  }
               }
            }
         }
         Sleep(1000);
      }
      Li_FFD8 = Li_FFD8 - 1;
   } while (Li_FFD8 >= 0);

}

bool func_1095() {
   string tmp_str0000;
   string tmp_str0001;
   string tmp_str0002;
   string tmp_str0003;
   string tmp_str0004;
   string tmp_str0005;
   string tmp_str0006;
   string tmp_str0007;
   string tmp_str0008;
   bool Lb_FFFE;
   int Li_FFF8;
   bool Lb_FFFF;

   Lb_FFFE = false;
   Gl_0000 = TimeCurrent() - Il_C148;
   Gl_0001 = Ii_0584;
   if (Gl_0000 >= Gl_0001) {
      Comment("News Loading...");
      Print("News Loading...");
      func_1101();
      Il_C148 = TimeCurrent();
   }
   WindowRedraw();
   func_1096();
   Li_FFF8 = 0;
   if (Ii_0580 <= 0) return Lb_FFFE;
   do {
      tmp_str0000 = Is_05C8[2, Li_FFF8];
      if (NewsHard && StringFind(tmp_str0000, "High", 0) >= 0) {
         Gb_0002 = true;
      } else {
         if (NewsMedium && StringFind(tmp_str0000, "Moderate", 0) >= 0) {
            Gb_0002 = true;
         } else {
            if (NewsLight && StringFind(tmp_str0000, "Low", 0) >= 0) {
               Gb_0002 = true;
            } else {
               Gb_0002 = false;
            }
         }
      }
      if (Gb_0002) {
         Gi_0003 = Li_FFF8;
         tmp_str0001 = Is_05C8[0, Li_FFF8];
         tmp_str0003 = StringSubstr(tmp_str0001, 14, 4);
         tmp_str0004 = StringSubstr(tmp_str0001, 11, 2);
         tmp_str0005 = StringSubstr(tmp_str0001, 8, 2);
         tmp_str0006 = StringSubstr(tmp_str0001, 5, 2);
         tmp_str0007 = StringSubstr(tmp_str0001, 0, 4);
         tmp_str0002 = StringConcatenate(tmp_str0007, ".", tmp_str0006, ".", tmp_str0005, " ", tmp_str0004, ":", tmp_str0003);
         Gl_0005 = StringToTime(tmp_str0002);
         Gi_0006 = offset * 3600;
         Gl_0006 = Gi_0006;
         Gl_0006 = Gl_0005 + Gl_0006;

         Gl_0008 = TimeCurrent();
         Gi_0009 = AfterNewsStop * 60;
         Gl_0009 = Gi_0009;
         Gl_0009 = Gl_0008 - Gl_0009;
         if (TimeCurrent() + BeforeNewsStop * 60 > Gl_0006
               && Gl_0009 < Gl_0006) {
            Gb_0009 = true;
         } else {
            Gb_0009 = false;
         }
         if (Gb_0009) {
            tmp_str0008 = Is_05C8[1, Li_FFF8];
            if (StringFind(Is_0588, tmp_str0008, 0) >= 0) {
               Gb_000B = true;
            } else {
               Gb_000B = false;
            }
            if (Gb_000B) {
               Lb_FFFE = true;
               return Lb_FFFE;
            }
         }
      }
      Li_FFF8 = Li_FFF8 + 1;
   } while (Li_FFF8 < Ii_0580);

   Lb_FFFF = Lb_FFFE;
   return Lb_FFFE;
}

void func_1096() {
   string tmp_str0000;
   string tmp_str0001;
   string tmp_str0002;
   string tmp_str0003;
   string tmp_str0004;
   string tmp_str0005;
   string tmp_str0006;
   string tmp_str0007;
   string tmp_str0008;
   string tmp_str0009;
   string tmp_str000A;
   string tmp_str000B;
   string tmp_str000C;
   string tmp_str000D;
   string tmp_str000E;
   string tmp_str000F;
   string tmp_str0010;
   string tmp_str0011;
   string tmp_str0012;
   string tmp_str0013;
   string tmp_str0014;
   string tmp_str0015;
   int Li_FFFC;
   string Ls_FFF0;
   int Li_FFEC;

   if (DrawLines == false) return;
   Li_FFFC = 0;
   if (Ii_0580 <= 0) return;
   do {
      Gi_0000 = Li_FFFC;
      tmp_str0000 = Is_05C8[0, Li_FFFC];
      tmp_str0002 = StringSubstr(tmp_str0000, 14, 4);
      tmp_str0003 = StringSubstr(tmp_str0000, 11, 2);
      tmp_str0004 = StringSubstr(tmp_str0000, 8, 2);
      tmp_str0005 = StringSubstr(tmp_str0000, 5, 2);
      tmp_str0006 = StringSubstr(tmp_str0000, 0, 4);
      tmp_str0001 = StringConcatenate(tmp_str0006, ".", tmp_str0005, ".", tmp_str0004, " ", tmp_str0003, ":", tmp_str0002);
      Gl_0002 = StringToTime(tmp_str0001);
      Gi_0003 = offset * 3600;
      Gl_0003 = Gi_0003;
      tmp_str0007 = TimeToString((Gl_0002 + Gl_0003), 2);
      tmp_str0007 = tmp_str0007 + "_";
      tmp_str0007 = tmp_str0007 + Is_05C8[1, Li_FFFC];
      tmp_str0007 = tmp_str0007 + "_";
      tmp_str0007 = tmp_str0007 + Is_05C8[3, Li_FFFC];
      Ls_FFF0 = StringSubstr(tmp_str0007, 0, 63);
      if (Is_05C8[3, Li_FFFC] != "" && ObjectFind(Ls_FFF0) == 0) {
      } else {
         if (StringFind(Is_0588, Is_05C8[1, Li_FFFC], 0) < 0) {
         } else {
            Gi_0007 = Li_FFFC;
            tmp_str0008 = Is_05C8[0, Li_FFFC];
            tmp_str000A = StringSubstr(tmp_str0008, 14, 4);
            tmp_str000B = StringSubstr(tmp_str0008, 11, 2);
            tmp_str000C = StringSubstr(tmp_str0008, 8, 2);
            tmp_str000D = StringSubstr(tmp_str0008, 5, 2);
            tmp_str000E = StringSubstr(tmp_str0008, 0, 4);
            tmp_str0009 = StringConcatenate(tmp_str000E, ".", tmp_str000D, ".", tmp_str000C, " ", tmp_str000B, ":", tmp_str000A);
            Gl_0009 = StringToTime(tmp_str0009);
            Gi_000A = offset * 3600;
            Gl_000A = Gi_000A;
            Gl_000A = Gl_0009 + Gl_000A;
            if (Gl_000A < TimeCurrent() && HidePast) {
            } else {
               Li_FFEC = (int)4294967295;
               if (NewsHard && StringFind(Is_05C8[2, Li_FFFC], "High", 0) >= 0) {
                  Li_FFEC = 255;
               }
               if (NewsMedium && StringFind(Is_05C8[2, Li_FFFC], "Moderate", 0) >= 0) {
                  Li_FFEC = 65535;
               }
               if (NewsLight && StringFind(Is_05C8[2, Li_FFFC], "Low", 0) >= 0) {
                  Li_FFEC = 32768;
               }
               if (Li_FFEC == (int)4294967295) {
               } else {
                  if (Is_05C8[3, Li_FFFC] != "") {
                     Gi_000E = Li_FFFC;
                     tmp_str000F = Is_05C8[0, Li_FFFC];
                     tmp_str0011 = StringSubstr(tmp_str000F, 14, 4);
                     tmp_str0012 = StringSubstr(tmp_str000F, 11, 2);
                     tmp_str0013 = StringSubstr(tmp_str000F, 8, 2);
                     tmp_str0014 = StringSubstr(tmp_str000F, 5, 2);
                     tmp_str0015 = StringSubstr(tmp_str000F, 0, 4);
                     tmp_str0010 = StringConcatenate(tmp_str0015, ".", tmp_str0014, ".", tmp_str0013, " ", tmp_str0012, ":", tmp_str0011);
                     Gl_0010 = StringToTime(tmp_str0010);
                     Gi_0011 = offset * 3600;
                     Gl_0011 = Gi_0011;
                     ObjectCreate(0, Ls_FFF0, OBJ_VLINE, 0, (Gl_0010 + Gl_0011), 0, 0, 0, 0, 0);
                     ObjectSet(Ls_FFF0, OBJPROP_COLOR, Li_FFEC);
                     ObjectSet(Ls_FFF0, OBJPROP_STYLE, 2);
                     ObjectSetInteger(0, Ls_FFF0, 9, 1);
                  }
               }
            }
         }
      }
      Li_FFFC = Li_FFFC + 1;
   } while (Li_FFFC < Ii_0580);

}

void func_1101() {
   string tmp_str0000;
   string tmp_str0001;
   string tmp_str0002;
   string tmp_str0003;
   string tmp_str0004;
   string Ls_FFF0;
   int Li_FFEC;
   int Li_FFE8;
   int Li_FFE4;

   tmp_str0001 = NULL;
   tmp_str0002 = "";
   tmp_str0003 = "";
   char Lc_FFB0[];
   char Lc_FF7C[];
   if (WebRequest("GET", tmp_str0003, tmp_str0001, NULL, 5000, Lc_FFB0, 0, Lc_FF7C, tmp_str0000) == -1) {
      Print("WebRequest error, err.code  =", GetLastError());
      tmp_str0004 = "You must add the address ' ";
      tmp_str0004 = "You must add the address '  in the list of allowed URL tab 'Advisors' ";
      MessageBox(tmp_str0004, " Error ", 64);
   } else {
      PrintFormat("File successfully downloaded, the file size in bytes  =%d.", ArraySize(Lc_FF7C));
      Gi_0000 = FileOpen("news-log.html", 6);
      if (Gi_0000 != -1) {
         FileWriteArray(Gi_0000, Lc_FF7C, 0, ArraySize(Lc_FF7C));
         FileClose(Gi_0000);
         Gi_0001 = FileOpen("news-log.html", 5);
         tmp_str0002 = FileReadString(Gi_0001, ArraySize(Lc_FF7C));
         FileClose(Gi_0001);
      } else {
         Print("Error in FileOpen. Error code =", GetLastError());
      }
   }
   ArrayFree(Lc_FF7C);
   ArrayFree(Lc_FFB0);
   Ls_FFF0 = tmp_str0002;
   Li_FFEC = StringFind(Ls_FFF0, "pageStartAt>", 0) + 12;
   Li_FFE8 = StringFind(Ls_FFF0, "</tbody>", 0);
   Ls_FFF0 = StringSubstr(Ls_FFF0, Li_FFEC, (Li_FFE8 - Li_FFEC));
   Li_FFEC = 0;
   if (_StopFlag != 0) return;
   do {
      Li_FFEC = StringFind(Ls_FFF0, "event_timestamp", Li_FFEC) + 17;
      Li_FFE8 = StringFind(Ls_FFF0, "onclick", Li_FFEC) - 2;
      if (Li_FFEC < 17) return;
      if (Li_FFE8 < 0) return;
      Is_05C8[0, Ii_0580] = StringSubstr(Ls_FFF0, Li_FFEC, (Li_FFE8 - Li_FFEC));
      Li_FFEC = StringFind(Ls_FFF0, "flagCur", Li_FFEC) + 10;
      Li_FFE8 = Li_FFEC + 3;
      if (Li_FFEC < 10) return;
      if (Li_FFE8 < 3) return;
      Is_05C8[1, Ii_0580] = StringSubstr(Ls_FFF0, Li_FFEC, (Li_FFE8 - Li_FFEC));
      if (StringFind(Is_0588, Is_05C8[1, Ii_0580], 0) >= 0) {
         Li_FFEC = StringFind(Ls_FFF0, "title", Li_FFEC) + 7;
         Li_FFE8 = StringFind(Ls_FFF0, "Volatility", Li_FFEC) - 1;
         if (Li_FFEC < 7) return;
         if (Li_FFE8 < 0) return;
         Is_05C8[2, Ii_0580] = StringSubstr(Ls_FFF0, Li_FFEC, (Li_FFE8 - Li_FFEC));
         if (StringFind(Is_05C8[2, Ii_0580], "High", 0) < 0
               || NewsHard != false) {

            if (StringFind(Is_05C8[2, Ii_0580], "Moderate", 0) < 0
                  || NewsMedium != false) {

               if (StringFind(Is_05C8[2, Ii_0580], "Low", 0) < 0 || NewsLight) {

                  Li_FFEC = StringFind(Ls_FFF0, "left event", Li_FFEC) + 12;
                  Li_FFE4 = StringFind(Ls_FFF0, "Speaks", Li_FFEC);
                  Li_FFE8 = StringFind(Ls_FFF0, "<", Li_FFEC);
                  if (Li_FFEC < 12) return;
                  if (Li_FFE8 < 0) return;
                  if (Li_FFE4 < 0 || Li_FFE4 > Li_FFE8) {

                     Is_05C8[3, Ii_0580] = StringSubstr(Ls_FFF0, Li_FFEC, (Li_FFE8 - Li_FFEC));
                  } else {
                     Is_05C8[3, Ii_0580] = StringSubstr(Ls_FFF0, Li_FFEC, (Li_FFE4 - Li_FFEC));
                  }
                  Ii_0580 = Ii_0580 + 1;
                  if (Ii_0580 == 300) return;
               }
            }
         }
      }
   } while (_StopFlag == 0);

}

void func_1110(int Fa_i_00, int Fa_i_01, double Fa_d_02, int Fa_i_03) {
   string tmp_str0000;
   string tmp_str0001;
   int Li_FFFC;
   double Ld_FFF0;
   double Ld_FFE8;
   double Ld_FFE0;
   bool Lb_FFDF;
   int Li_FFD8;

   Li_FFFC = 0;
   Gi_0000 = _Digits - 1;
   returned_double = MathPow(10, Gi_0000);
   Ld_FFF0 = ((double)1 / returned_double);
   if (_Digits == 3 || _Digits == 5) {

      Gi_0000 = _Digits - 1;
      returned_double = MathPow(10, Gi_0000);
      Ld_FFF0 = ((double)1 / returned_double);
   } else {
      Ld_FFF0 = _Point;
   }
   Ld_FFE8 = 0;
   Ld_FFE0 = 0;
   Lb_FFDF = false;
   if (Fa_i_00 == 0) return;
   Li_FFD8 = OrdersTotal() - 1;
   if (Li_FFD8 < 0) return;
   do {
      if (OrderSelect(Li_FFD8, 0, 0) && OrderSymbol() == _Symbol && OrderMagicNumber() == Fa_i_03) {
         if (OrderSymbol() == _Symbol || OrderMagicNumber() == Fa_i_03) {

            if (OrderType() == OP_BUY) {
               Gd_0000 = (Bid - Fa_d_02);
               Li_FFFC = (int)NormalizeDouble((Gd_0000 / _Point), 0);
               Gd_0000 = (Fa_i_00 * Ld_FFF0);
               if (Li_FFFC > Gd_0000) {
                  Ld_FFE8 = OrderStopLoss();
                  Ld_FFE0 = ((Fa_i_01 * Ld_FFF0) + Fa_d_02);
                  Gd_0000 = Ld_FFE0;
                  Gd_0001 = Bid;
                  Gi_0002 = 0;
                  Gd_0003 = 0;
                  Gd_0004 = 0;
                  Gd_0004 = MarketInfo(_Symbol, MODE_STOPLEVEL);
                  if (_Digits == 3 || _Digits == 5) {

                     Gd_0004 = (Gd_0004 / 10);
                  }
                  Gd_0003 = Gd_0000;
                  if (Gi_0002 == 0) {
                     Gd_0005 = (Gd_0001 - Gd_0000);
                     if ((Gd_0005 < (Gd_0004 * _Point))) {
                        Gd_0003 = 0;
                     }
                  }
                  if (Gi_0002 == 1) {
                     Gd_0005 = (Gd_0003 - Gd_0001);
                     if ((Gd_0005 < (Gd_0004 * _Point))) {
                        Gd_0003 = 0;
                     }
                  }
                  returned_double = NormalizeDouble(Gd_0003, (int)MarketInfo(_Symbol, MODE_DIGITS));
                  Ld_FFE0 = returned_double;
                  if ((Bid >= ((Fa_i_01 * Ld_FFF0) + Fa_d_02))) {
                     if (Ld_FFE8 == 0 || (Ld_FFE8 != 0 && returned_double > Ld_FFE8)) {

                        OrderTicket();
                        if (OrdersTotal() > 0) {
                           Lb_FFDF = OrderModify(OrderTicket(), Fa_d_02, Ld_FFE0, OrderTakeProfit(), 0, 16776960);
                           if (Lb_FFDF != true) {
                              tmp_str0000 = "Normal";
                              Gi_0006 = GetLastError();
                              if (Gi_0006 != 1 && Gi_0006 != 130) {
                                 Print(tmp_str0000, ": Ordem: ", OrderTicket(), ". Falha ao tentar alterar ordem: ", Gi_0006, " ");
                              }
                           }
                        }
                     }
                  }
               }
            }
            if (OrderType() == OP_SELL) {
               Gd_0007 = (Fa_d_02 - Ask);
               Li_FFFC = (int)NormalizeDouble((Gd_0007 / _Point), 0);
               Gd_0007 = (Fa_i_00 * Ld_FFF0);
               if (Li_FFFC > Gd_0007) {
                  Ld_FFE8 = OrderStopLoss();
                  Gd_0007 = (Fa_i_01 * Ld_FFF0);
                  Ld_FFE0 = (Fa_d_02 - Gd_0007);
                  Gd_0007 = Ld_FFE0;
                  Gd_0008 = Ask;
                  Gi_0009 = 1;
                  Gd_000A = 0;
                  Gd_000B = 0;
                  Gd_000B = MarketInfo(_Symbol, MODE_STOPLEVEL);
                  if (_Digits == 3 || _Digits == 5) {

                     Gd_000B = (Gd_000B / 10);
                  }
                  Gd_000A = Gd_0007;
                  if (Gi_0009 == 0) {
                     Gd_000C = (Gd_0008 - Gd_0007);
                     if ((Gd_000C < (Gd_000B * _Point))) {
                        Gd_000A = 0;
                     }
                  }
                  if (Gi_0009 == 1) {
                     Gd_000C = (Gd_000A - Gd_0008);
                     if ((Gd_000C < (Gd_000B * _Point))) {
                        Gd_000A = 0;
                     }
                  }
                  returned_double = NormalizeDouble(Gd_000A, (int)MarketInfo(_Symbol, MODE_DIGITS));
                  Ld_FFE0 = returned_double;
                  Gd_000C = (Fa_i_01 * Ld_FFF0);
                  if ((Ask <= (Fa_d_02 - Gd_000C))) {
                     if (Ld_FFE8 == 0 || (Ld_FFE8 != 0 && returned_double < Ld_FFE8)) {

                        OrderTicket();
                        if (OrdersTotal() > 0) {
                           Lb_FFDF = OrderModify(OrderTicket(), Fa_d_02, Ld_FFE0, OrderTakeProfit(), 0, 255);
                           if (Lb_FFDF != true) {
                              tmp_str0001 = "Normal";
                              Gi_000D = GetLastError();
                              if (Gi_000D != 1 && Gi_000D != 130) {
                                 Print(tmp_str0001, ": Ordem: ", OrderTicket(), ". Falha ao tentar alterar ordem: ", Gi_000D, " ");
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
         Sleep(1000);
      }
      Li_FFD8 = Li_FFD8 - 1;
   } while (Li_FFD8 >= 0);

}

void func_1111(char Fa_s_00) {
   string tmp_str0000;
   string

Показано первые 50% кода (символов: 100333)

Открыть по тарифу

Купите тариф с пакетом открытий или войдите, если тариф уже есть. Открытый файл останется в вашем кабинете навсегда.

Разовая покупка файла

На этой странице откроется полный исходный код файла вместо ознакомительного фрагмента.

Чтобы оформить заказ, введите email и перейдите к оплате.

Стоимость полного кода
10 033,30₽ ≈ $122.64