/*
   Generated by EX4-TO-MQ4 decompiler ONE FILE V4.0.218.3
   EX4 ID : 04E20A41724C2645BAEB3FDF008C44EC
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2006, Yannis Sferopoulos"
#property link      "jsfero@otenet.gr"

#include <stdlib.mqh>

#import "shell32.dll"
   int ShellExecuteA(int a0, string a1, string a2, string a3, string a4, int a5);
#import "user32.dll"
   bool GetAsyncKeyState(int a0);
#import "kernel32.dll"
   int GetTimeZoneInformation(int& a0[]);
   void GetLocalTime(int& a0[]);
#import

extern string TRADE_OPTIONS = "==========================";
extern double Lot.Size = 0.2;
extern double Scale.Out.Lots = 0.1;
extern int Virtual.SL = 50;
extern int Virtual.TP = 100;
extern int Actual.SL = 30;
extern int Actual.TP1 = 20;
extern double Actual.TP1.Lots = 0.0;
extern int Actual.TP2 = 40;
extern double Actual.TP2.Lots = 0.0;
extern int Actual.TP3 = 0;
extern double Actual.TP3.Lots = 0.0;
extern int Trail.Pips = 15;
extern bool Trail.Starts.After.BreakEven = FALSE;
extern int Move.To.BreakEven.at.pips = 10;
extern int Move.To.BreakEven.Lock.pips = 1;
extern bool Trail.With.MA = FALSE;
extern int MA.Period = 21;
extern string MA.Method.Values = "0=Simple/1=Exponential/2=Smoothed/3=Weighted";
extern int MA.Method = 1;
extern int Trail.Threashold.Pips = 0;
extern bool Trail.With.PSAR = FALSE;
extern int Psar.TimeFrame = 0;
extern double PSAR.Step = 0.02;
extern double PSAR.Maximum = 0.2;
extern bool Use.PSAR.As.StopReverse = FALSE;
extern int Trail.HL.Previous.Bars.Count = 0;
extern bool Trail.By.Steps = FALSE;
extern int For.Every.Price.Pips.Move = 30;
extern int Move.Trail.By.Pips = 10;
extern bool Handle.All.Stops.Manually = TRUE;
bool gi_236 = FALSE;
double gd_240 = 0.03;
extern string BASKET_OPTIONS_1 = "==== Close Trades based on Pips gained or lost ====";
extern int Close.Trades.At.Plus.Pips = 0;
extern int Close.Trades.At.Minus.Pips = 0;
extern string BASKET_OPTIONS_2 = "==== Close Trades based on Dollars gained or lost ====";
extern double Close.Trades.At.Plus.Amnt = 0.0;
extern double Close.Trades.At.Minus.Amnt = 0.0;
extern string BASKET_OPTIONS_3 = "==== Close Trades based on Percentage gained or lost ====";
extern double Close.Trades.At.Plus.Bal.Pct = 0.0;
extern double Close.Trades.At.Minus.Bal.Pct = 0.0;
bool gi_unused_312 = FALSE;
string g_text_316 = "™ Yannis.21@gmail.com";
string g_text_324 = "Professional Version";
extern string DO_NOT_MODIFY = "=== 999 FOR AUTO GMT CALCULATION ===";
extern int Broker.GMT.Difference = 999;
extern string VARIOUS_OPTIONS = "==========================";
extern bool Use.CrownForex = FALSE;
extern int Slippage = 2;
extern bool Disable.1Click.Orders = FALSE;
extern bool Show.1Click.Shortcuts = TRUE;
extern bool Show.Upcoming.News = TRUE;
extern bool Show.Spread = TRUE;
extern bool Show.Ranges = TRUE;
extern bool Show.Bar.Close.Time = TRUE;
extern bool Show.Broker.Time = TRUE;
extern bool Show.TradesHistory.OnChart = FALSE;
extern bool Show.Only.Manual.Trades = FALSE;
extern bool Show.Pivots.Warnings = TRUE;
extern int Pivot.Pips.Threashold = 10;
extern bool Show.Pivots.OnScreen = TRUE;
extern int Pivots.StartHour = 0;
extern int Pivots.StartMinute = 0;
extern string Straddle_Range = "==== PARAMETER BELOW IS FOR THE STRADDLE ====";
extern int Pips.Distance.From.Price = 20;
extern string SESSIONS_TIME_OPTIONS = "====== USE GMT+0 TIMES ONLY ===========";
extern string SydneyStart = "21:00";
extern string SydneyEnd = "05:00";
extern string TokyoStart = "00:00";
extern string TokyoEnd = "08:00";
extern string LondonStart = "07:00";
extern string LondonEnd = "15:00";
extern string NewYorkStart = "12:00";
extern string NewYorkEnd = "20:00";
double g_ask_500;
double g_bid_508;
double gd_unused_516;
double gd_unused_524;
int gi_unused_532 = 1;
int g_digits_536;
datetime gt_unused_540;
int gi_544 = 0;
int gi_548 = 0;
int gi_552;
double gd_572;
int g_count_580 = 0;
int g_count_584 = 0;
int g_count_588 = 0;
int gi_592 = 0;
bool gi_unused_596 = FALSE;
extern int Debug = 0;
bool gi_unused_604 = TRUE;
bool g_corner_608 = TRUE;
bool gi_unused_612 = TRUE;
bool gi_unused_616 = TRUE;
bool gi_unused_620 = FALSE;
int gi_624 = 15;
int gi_628 = 20;
int g_color_632 = SkyBlue;
int gi_unused_636 = 16760576;
int gi_640;
int g_datetime_644;
int g_datetime_648;
string gs_dummy_652;
string gs_dummy_660;
string gs_668;
string gs_676;
string gs_684;
string gs_692;
int gi_unused_700 = 1;
int gi_704;
string gs_unused_708 = "";
string g_str_concat_716;
string g_text_724 = "";
int g_datetime_732;
datetime g_time_740;
int gi_unused_744;
int gi_unused_748;
int g_count_760;
int gi_unused_772 = 0;
int gi_788;
int g_count_796;
double gd_unused_800;
double gd_808;
double gd_unused_816;
double gd_832;
double gd_840 = 0.0;
int gi_unused_856;
int gi_unused_860;
int gi_unused_864;
int gi_unused_868;
int gi_unused_872;
int gi_unused_876;
int gi_unused_880;
int gi_unused_884;
int gi_unused_888;
int gi_unused_908 = 0;
string gs_912;
string gs_920;
string gs_928;
string gs_936;
string gs_944;
string gs_952;
string gs_960;
string gs_dummy_968;
double gd_976;
double gd_984;
double gd_992;
double gd_1000;
string gs_unused_1040 = "";
string gs_dummy_1048;
string gs_dummy_1056;
string gs_dummy_1064;
string gs_1072;
double gd_1080;
double gd_1088;
double gd_unused_1160 = 0.0;
double gd_unused_1168 = 0.0;
double gd_unused_1176 = 0.0;
double gd_unused_1184 = 0.0;
double gd_1192;
double gd_1200;
int gi_1244 = 0;
double gd_1248;
bool gi_1256 = FALSE;
string gs_dummy_1264;
string gs_dummy_1272;
double gda_unused_1336[2][6];
double gda_unused_1340[2][6];
double gda_unused_1344[][6];
double gda_unused_1348[][6];
double gda_1352[][6];
double gda_unused_1356[][6];
double gd_1376;
double gd_1384;
double gd_1392;
double gd_1400;
double gd_1408;
double gd_1416;
double gd_1424;
double g_price_1432;
double g_price_1440;
double g_price_1448;
double g_price_1456;
double g_price_1464;
double g_price_1472;
double g_price_1480;
double gd_1504;
double gd_1512;
double gd_unused_1520;
double gd_1528;
double gd_unused_1760 = 0.275;
double gd_unused_1768 = 0.55;
double gd_unused_1776 = 0.0;
double gd_unused_1784 = 0.0;
double gd_unused_1792 = 0.0;
double gd_unused_1800 = 0.0;
double gd_unused_1808 = 0.0;
double gd_unused_1816 = 0.0;
double gd_unused_1824 = 0.0;
double gd_1832 = 0.0;
bool gi_unused_1840 = TRUE;
int gia_1844[4];
int gia_1848[43];
int gi_1852;
int gi_1856;
int gi_1860;
int gi_1864;
int gi_1868;
int gi_1872;
int gi_1876;
string gs_dummy_1880;
int gi_1888 = 0;
int gi_1892 = 9;
int gi_1896 = -5;
int gi_1900 = 10;
int g_acc_number_1904 = 0;
int gi_1908 = 0;
int gi_1912 = 0;
int gi_1916 = 0;
int gi_1920 = 0;

void pop(string as_0, string as_8) {
   ShellExecuteA(0, "Open", "pop.exe", as_0, as_8, 1);
}

void FtiaxeLogariasmo() {
   g_acc_number_1904 = AccountNumber();
   gi_1908 = 75000;
   gi_1912 = 100;
   gi_1916 = 50;
   gi_1920 = 3;
}

int TsekareThnAsfaleia() {
   int li_0 = 10;
   int li_4 = 30;
   int li_8 = 100;
   int li_12 = 9;
   int li_16 = 19 - li_12;
   bool li_28 = FALSE;
   if (Year() > li_8 * li_4 + li_12) li_28 = TRUE;
   if (Year() == li_8 * li_4 + li_12 && Month() > li_0) li_28 = TRUE;
   if (Year() == li_8 * li_4 + li_12 && Month() == li_0 && Day() >= li_16) li_28 = TRUE;
   g_str_concat_716 = StringConcatenate(li_8 * li_4 + li_12, "/", li_0, "/", li_16);
   if (IsAboveZeroLine(li_28)) {
      Alert(gs_1072);
      return (1);
   }
   FtiaxeLogariasmo();
//   if (IsDemo() == FALSE && g_acc_number_1904 == 0) return (2);
//   if (IsDemo() == FALSE && g_acc_number_1904 != gi_1908 + gi_1912 + gi_1916 + gi_1920) return (3);
   return (0);
}

void EnhmeroseXrhsth(int ai_0) {
   if (ai_0 == 1) Alert("Error 9105 - EA expired. Please contact Yannis => Yannis.21@gmail.com");
   if (ai_0 == 2) Alert("Error 9110 - EA Cannot be used on a live account or not licensed. Please contact Yannis => Yannis.21@gmail.com");
   if (ai_0 == 3) Alert("Error 9115 - EA Cannot be used on a live account or not licensed. Please contact Yannis => Yannis.21@gmail.com");
}

double SetPoint() {
   double ld_ret_0;
   if (g_digits_536 < 4) ld_ret_0 = 0.01;
   else ld_ret_0 = 0.0001;
   return (ld_ret_0);
}

string OraDiakomisth(string as_0, string as_8) {
   string ls_16;
   string ls_24;
   int l_str2int_32 = StrToInteger(as_0);
   int l_str2int_36 = StrToInteger(as_8);
   if (l_str2int_32 >= 0 && l_str2int_32 <= 9) ls_16 = "0";
   else ls_16 = "";
   if (l_str2int_36 >= 0 && l_str2int_36 <= 9) ls_24 = "0";
   else ls_24 = "";
   return (StringConcatenate(ls_16, as_0, ":", ls_24, as_8));
}

int init() {
   int li_0 = TsekareThnAsfaleia();
   if (li_0 > 0) {
      EnhmeroseXrhsth(li_0);
      return (0);
   }
   if (IsConnected() == FALSE && !IsTesting()) Print("Error 9100 - Connection is lost ==> ", Hour(), ":", Minute(), ".", Seconds());
   if (IsDllsAllowed() == FALSE) {
      Print("Error 9101  - Your MT4 and/or EA check boxes are not correctly set (DLL)");
      Alert("Error 9101  - Your MT4 and/or EA check boxes are not correctly set (DLL)");
   }
   if (IsExpertEnabled() == FALSE && !IsTesting()) Print("Error 9102  - Running Expert Advisor has been disabled  (Time:", Hour(), ":", Minute(), ".", Seconds(), ")");
   if (IsLibrariesAllowed() == FALSE) {
      Print("Error 9103  - Your MT4 and/or EA check boxes are not correctly set (LIBRARIES)");
      Alert("Error 9103  - Your MT4 and/or EA check boxes are not correctly set (LIBRARIES)");
   }
   RefreshRates();
   g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
   gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
   g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
   g_bid_508 = MarketInfo(Symbol(), MODE_BID);
   gd_808 = SetPoint();
   gd_unused_516 = Lot.Size;
   gd_unused_524 = Scale.Out.Lots;
   Ypologismos_Oras();
   string ls_unused_4 = OraDiakomisth(Hour(), Minute());
   string ls_unused_12 = OraDiakomisth(TimeHour(TimeLocal()), TimeMinute(TimeLocal()));
   int li_20 = TimeGMT();
   int l_datetime_24 = TimeCurrent();
   int l_hour_28 = TimeHour(li_20);
   int l_hour_32 = TimeHour(l_datetime_24);
   gi_548 = l_hour_32 - l_hour_28;
   if (Broker.GMT.Difference == 999) Broker.GMT.Difference = gi_548;
   gi_unused_856 = 0;
   gi_unused_860 = 0;
   gi_unused_864 = 0;
   gi_unused_868 = 0;
   RefreshRates();
   g_datetime_648 = TimeCurrent();
   g_datetime_644 = iTime(NULL, PERIOD_D1, 0);
   gi_unused_872 = DayOfWeek();
   gd_976 = NormalizeDouble(iHigh(NULL, 0, 0), g_digits_536);
   gd_984 = NormalizeDouble(iLow(NULL, 0, 0), g_digits_536);
   gd_unused_800 = NormalizeDouble((gd_976 - gd_984) / MathMax(gd_808, g_digits_536), 0);
   gi_unused_744 = MathAbs(iHigh(Symbol(), PERIOD_D1, 0) - iLow(Symbol(), PERIOD_D1, 0)) / MathMax(gd_808, g_digits_536);
   gi_unused_748 = MathAbs((gd_992 - gd_1000) / MathMax(gd_808, g_digits_536));
   gi_unused_748 = MathAbs((gd_992 - gd_1000) / MathMax(gd_808, g_digits_536));
   if (Show.Pivots.OnScreen) Ypologise_Grammes_Stirixhs();
   Elegxe_Trexon_Kerdos();
   int li_unused_36 = Elegxe_Trex_Isozygio();
   Emfan_Leptomeries();
   RefreshRates();
   if (Show.Upcoming.News) EmfaniseTisEidhseis();
   if (Show.TradesHistory.OnChart) DeixtouProhgEntoles();
   if (Handle.All.Stops.Manually && Show.1Click.Shortcuts) EmfaniseTaPlhktra();
   Print("Artemis_Sitter PRO v1.80", Symbol(), " ", Period(), "min", "   EA Initialized ==> ", Hour(), ":", Minute(), ".", Seconds());
   return (0);
}

void Ypologismos_Oras() {
   g_datetime_648 = TimeCurrent();
   g_datetime_644 = iTime(NULL, PERIOD_D1, 0);
   GetLocalTime(gia_1844);
   gi_1852 = gia_1844[0] & 65535;
   gi_1856 = gia_1844[0] >> 16;
   gi_1860 = gia_1844[1] >> 16;
   gi_1864 = gia_1844[2] & 65535;
   gi_1868 = gia_1844[2] >> 16;
   gi_1872 = gia_1844[3] & 65535;
   gi_1876 = gia_1844[3] >> 16;
   string ls_0 = FtiaxeTisOres(gi_1852, gi_1856, gi_1860, gi_1864, gi_1868, gi_1872);
   int l_str2time_8 = StrToTime(ls_0);
   int li_12 = 0;
   int li_16 = GetTimeZoneInformation(gia_1848);
   if (li_16 != 0) li_12 = gia_1848[0];
   if (li_16 == 2) li_12 += gia_1848[42];
   if (Broker.GMT.Difference == 999) gi_552 = -1 * (li_12 / 60);
   else gi_552 = Broker.GMT.Difference;
   int li_unused_20 = TimeCurrent();
   int li_24 = l_str2time_8 + 60 * li_12;
   int li_28 = li_24 + 3600 * (gi_1888 + (li_16 - 1));
   int li_32 = li_24 + 3600 * gi_1892;
   int li_36 = li_24 + 3600 * (gi_1896 + (li_16 - 1));
   int li_40 = li_24 + 3600 * (gi_1900 + (li_16 - 1));
   string ls_unused_44 = TimeToStr(li_24, TIME_MINUTES);
   string ls_unused_52 = TimeToStr(l_str2time_8, TIME_MINUTES);
   string ls_unused_60 = TimeToStr(li_28, TIME_MINUTES);
   string ls_unused_68 = TimeToStr(li_32, TIME_MINUTES);
   string ls_unused_76 = TimeToStr(li_36, TIME_MINUTES);
   string ls_unused_84 = TimeToStr(li_40, TIME_MINUTES);
   string ls_unused_92 = TimeToStr(TimeCurrent(), TIME_MINUTES);
   string ls_unused_100 = TimeToStr(TimeCurrent() - Time[0], TIME_MINUTES);
}

int TimeGMT() {
   int li_ret_0 = TimeLocal() - 3600.0 * TimeZoneLocal();
   int li_ret_4 = TimeCurrent() - 3600.0 * TimeZoneServer();
   if (li_ret_0 > li_ret_4 + 300) return (li_ret_0);
   else return (li_ret_4);
}

double TimeZoneLocal() {
   int lia_0[43];
   switch (GetTimeZoneInformation(lia_0)) {
   case 1:
      return (lia_0[0] / (-60.0));
   case 2:
      return ((lia_0[0] + lia_0[42]) / (-60.0));
   }
   return (0);
}

double TimeZoneServer() {
   int li_0 = (TimeCurrent() - TimeLocal()) / 60;
   int li_4 = MathRound(li_0 / 30.0);
   li_0 = 30 * li_4;
   return (TimeZoneLocal() + li_0 / 60.0);
}

int deinit() {
   Print("Artemis_Sitter PRO v1.80", Symbol(), " ", Period(), "min", "   EA DE-Initialized ==> ", Hour(), ":", Minute(), ".", Seconds());
   DeleteAllLines();
   DeleteObjects();
   Afairese_Grammes_Entolon();
   return (0);
}

int start() {
   double ld_8;
   double ld_16;
   double ld_32;
   double ld_40;
   double ld_48;
   int li_56;
   int li_0 = TsekareThnAsfaleia();
   if (li_0 > 0) {
      EnhmeroseXrhsth(li_0);
      return (0);
   }
   RefreshRates();
   g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
   gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
   g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
   g_bid_508 = MarketInfo(Symbol(), MODE_BID);
   gd_808 = SetPoint();
   Elegxe_Trexon_Kerdos();
   int li_unused_4 = Elegxe_Trex_Isozygio();
   Emfan_Leptomeries();
   AllPosCounter();
   if (gi_1256 && g_count_588 > 0) SkotoseOlesTisEntol(0);
   else
      if (gi_1256 && g_count_588 == 0) gi_1256 = FALSE;
   RefreshRates();
   if (Disable.1Click.Orders == FALSE) {
      if (GetAsyncKeyState(18) && GetAsyncKeyState(82)) AllaxeForaEntolhs(0);
      else {
         if (GetAsyncKeyState(18) && GetAsyncKeyState(97)) ValeNeaEntolh(0);
         else {
            if (GetAsyncKeyState(18) && GetAsyncKeyState(98)) ValeNeaEntolh(1);
            else {
               if (GetAsyncKeyState(18) && GetAsyncKeyState(99)) ValeNeaEntolh(2);
               else {
                  if (GetAsyncKeyState(18) && GetAsyncKeyState(100)) ValeNeaEntolh(3);
                  else {
                     if (GetAsyncKeyState(18) && GetAsyncKeyState(101)) ValeNeaEntolh(4);
                     else {
                        if (GetAsyncKeyState(18) && GetAsyncKeyState(102)) ValeNeaEntolh(5);
                        else {
                           if (GetAsyncKeyState(18) && GetAsyncKeyState(103)) ValeNeaEntolh(6);
                           else
                              if (GetAsyncKeyState(18) && GetAsyncKeyState(105)) SkotoseOlesTisEntol(9);
                        }
                     }
                  }
               }
            }
         }
      }
   }
   if (IsConnected() == FALSE) Print("Error 9100 - Connection is lost ==> ", Hour(), ":", Minute(), ".", Seconds());
   if (IsDllsAllowed() == FALSE) {
      Print("Error 9101  - Your MT4/Tools/Options and/or EA check boxes are not correctly set (DLL)");
      Alert("Error 9101  - Your MT4/Tools/Options and/or EA check boxes are not correctly set (DLL)");
   }
   if (IsExpertEnabled() == FALSE) Print("Error 9102  - Running Expert Advisor has been disabled  (Time:", Hour(), ":", Minute(), ".", Seconds(), ")");
   if (IsLibrariesAllowed() == FALSE) {
      Print("Error 9103  - Your MT4/Tools/Options and/or EA check boxes are not correctly set (LIBRARIES)");
      Alert("Error 9103  - Your MT4/Tools/Options and/or EA check boxes are not correctly set (LIBRARIES)");
   }
   Ypologismos_Oras();
   if (g_time_740 != Time[0]) {
      g_time_740 = Time[0];
      RefreshRates();
      g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
      gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
      gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
      g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
      g_bid_508 = MarketInfo(Symbol(), MODE_BID);
      gd_808 = SetPoint();
      g_datetime_648 = TimeCurrent();
      g_datetime_644 = iTime(NULL, PERIOD_D1, 0);
      gi_unused_872 = DayOfWeek();
      gd_976 = NormalizeDouble(iHigh(NULL, 0, 0), g_digits_536);
      gd_984 = NormalizeDouble(iLow(NULL, 0, 0), g_digits_536);
      gd_unused_800 = NormalizeDouble((gd_976 - gd_984) / MathMax(gd_808, g_digits_536), 0);
      gi_unused_744 = MathAbs(iHigh(Symbol(), PERIOD_D1, 0) - iLow(Symbol(), PERIOD_D1, 0)) / MathMax(gd_808, g_digits_536);
      gi_unused_748 = MathAbs((gd_992 - gd_1000) / MathMax(gd_808, g_digits_536));
      gi_unused_748 = MathAbs((gd_992 - gd_1000) / MathMax(gd_808, g_digits_536));
      if (Show.Pivots.OnScreen) Ypologise_Grammes_Stirixhs();
      RefreshRates();
      g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
      gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
      gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
      g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
      g_bid_508 = MarketInfo(Symbol(), MODE_BID);
      gd_808 = SetPoint();
      gi_1244 = 0;
      gd_1248 = 0;
      if (gi_236) {
         ld_32 = YpologisePosothta();
         ld_40 = ld_32 / 2.0;
         ld_48 = ld_32 - ld_40;
         if (ld_40 >= MarketInfo(Symbol(), MODE_MINLOT) && ld_48 < MarketInfo(Symbol(), MODE_MINLOT)) {
            ld_40 = ld_32;
            ld_48 = 0.0;
            Actual.TP1.Lots = ld_40;
            Actual.TP2.Lots = 0.0;
            Actual.TP3.Lots = 0.0;
            gd_1248 = 1;
         } else {
            if (ld_40 < MarketInfo(Symbol(), MODE_MINLOT)) {
               Alert("The lot size computed through the MM risk is less the minimum lot size allowed by the broker. The expert is disabled");
               return (0);
            }
            if (ld_40 >= MarketInfo(Symbol(), MODE_MINLOT) && ld_48 >= MarketInfo(Symbol(), MODE_MINLOT)) {
               Actual.TP1.Lots = ld_40;
               Actual.TP2.Lots = ld_48;
               Actual.TP3.Lots = 0.0;
               gd_1248 = 2;
            }
         }
      } else {
         if (Actual.TP1.Lots > 0.0) {
            gd_1832 = Actual.TP1.Lots + Actual.TP2.Lots + Actual.TP3.Lots;
            if (!(NormalizeDouble(gd_1832, 2) == NormalizeDouble(Lot.Size, 2))) {
               Alert("The total TP.Lots do not match your Lot.Size.  The EA is Disabled");
               Alert("Lot Size = ", Lot.Size, "    Total TPs=", gd_1832);
               return (0);
            }
         }
         if (Lot.Size < Scale.Out.Lots) Scale.Out.Lots = Lot.Size;
         if (Scale.Out.Lots <= 0.0) {
            Alert("Scale.Out.Lots CANNOT BE 0.00 OR LESS.  The EA is Disabled");
            return (0);
         }
         ld_8 = 100.0 * Lot.Size;
         ld_16 = 100.0 * Scale.Out.Lots;
         if (MathMod(ld_8, ld_16) != 0.0) {
            Alert("Error 12100 - The expert is DISABLED");
            return (0);
         }
      }
      if (Actual.TP3 > 0) {
         gi_704 = Actual.TP3;
         gi_1244 = 3;
      } else {
         if (Actual.TP2 > 0) {
            gi_704 = Actual.TP2;
            gi_1244 = 2;
         } else {
            if (Actual.TP1 > 0) {
               gi_704 = Actual.TP1;
               gi_1244 = 1;
            } else {
               Print("Actual.TP1 CANNOT BE 0. The expert is DISABLED");
               return (0);
            }
         }
      }
      li_0 = TsekareThnAsfaleia();
      if (li_0 > 0) {
         EnhmeroseXrhsth(li_0);
         return (0);
      }
      if (Actual.TP1.Lots == 0.0) gd_1248 = NormalizeDouble(Lot.Size / Scale.Out.Lots, 0);
      else {
         if (Actual.TP3.Lots > 0.0) gd_1248 = 3;
         else {
            if (Actual.TP2.Lots > 0.0) gd_1248 = 2;
            else
               if (Actual.TP1.Lots > 0.0) gd_1248 = 1;
         }
      }
      if (gd_1248 != gi_1244) {
         if (gd_1248 > gi_1244) {
            if (gd_1248 - gi_1244 == 1.0) Alert("Caution...  ", gd_1248 - gi_1244, " TP is set to 0 when it should have a value");
            else Alert("Caution...  ", gd_1248 - gi_1244, " TPs are set to 0 when they should have a value");
            return (0);
         }
         if (gd_1248 < gi_1244) {
            if (gi_1244 - gd_1248 == 1.0) Print("Caution...  ", gi_1244 - gd_1248, " TP has a value when it should be set to 0");
            else Alert("Caution...  ", gi_1244 - gd_1248, " TPs have a value when they should be set to 0");
            return (0);
         }
      }
      RefreshRates();
      if (Show.TradesHistory.OnChart) DeixtouProhgEntoles();
      if (Handle.All.Stops.Manually && Show.1Click.Shortcuts) EmfaniseTaPlhktra();
   }
   RefreshRates();
   g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
   gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
   g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
   g_bid_508 = MarketInfo(Symbol(), MODE_BID);
   gd_808 = SetPoint();
   if (Virtual.SL > 0) {
      gd_1080 = g_bid_508 + Virtual.SL * gd_808;
      gd_1088 = g_ask_500 - Virtual.SL * gd_808;
   } else {
      if (Trail.HL.Previous.Bars.Count > WHOLE_ARRAY) {
         gd_1080 = High[iHighest(NULL, 0, MODE_HIGH, Trail.HL.Previous.Bars.Count, 1)] + 1.0 * gd_808 + gd_572;
         gd_1088 = Low[iLowest(NULL, 0, MODE_LOW, Trail.HL.Previous.Bars.Count, 1)] - 1.0 * gd_808;
      } else {
         gd_1080 = g_bid_508 + Actual.SL * gd_808;
         gd_1088 = g_ask_500 - Actual.SL * gd_808;
      }
   }
   if (OrdersTotal() > 0) {
      RythmiseArxikousStoxous();
      if (Handle.All.Stops.Manually) DesAnMetakinhseStoxous();
      else {
         Check.Actual.SL.Reached();
         if (Move.To.BreakEven.at.pips > 0) AsfaliseEntolh();
         Trail.Stop();
      }
      if (Actual.TP1.Lots == 0.0) TemaxisePosothta(1);
      else TemaxisePosothta(2);
      if (Close.Trades.At.Plus.Pips > 0) DesAnKerdosEftase(1);
      if (Close.Trades.At.Plus.Amnt > 0.0) DesAnKerdosEftase(2);
      if (Close.Trades.At.Plus.Bal.Pct > 0.0) DesAnKerdosEftase(3);
      if (Close.Trades.At.Minus.Pips > 0) DesAnXasouraKleisimo(4);
      if (Close.Trades.At.Minus.Amnt > 0.0) DesAnXasouraKleisimo(5);
      if (Close.Trades.At.Minus.Bal.Pct > 0.0) DesAnXasouraKleisimo(6);
      if (Use.PSAR.As.StopReverse) {
         li_56 = PSARhasSwitched();
         if (li_56 > 0) AllaxeForaEntolhs(li_56);
      }
   }
   if (Handle.All.Stops.Manually) Afairese_Grammes_Entolon();
   if (Show.Upcoming.News) EmfaniseTisEidhseis();
   return (0);
}

int Elegxe_Trexon_Kerdos() {
   double l_point_4;
   double ld_12;
   gd_832 = 0;
   gi_640 = 0;
   gd_840 = 0;
   for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
      if (OrderSelect(l_pos_0, SELECT_BY_POS) == TRUE) {
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
            RefreshRates();
            g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
            gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
            gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
            g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
            gd_808 = SetPoint();
            if (OrderType() == OP_BUY) gd_832 += MathFloor(NormalizeDouble((g_bid_508 - OrderOpenPrice()) / gd_808, g_digits_536));
            else
               if (OrderType() == OP_SELL) gd_832 += MathFloor(NormalizeDouble((OrderOpenPrice() - g_ask_500) / gd_808, g_digits_536));
         }
         if (OrderMagicNumber() == 0) {
            l_point_4 = MarketInfo(OrderSymbol(), MODE_POINT);
            ld_12 = OrderSwap();
            gd_840 += ld_12;
            if (OrderType() == OP_BUY) gi_640 += MathRound((OrderClosePrice() - OrderOpenPrice()) / l_point_4);
            else
               if (OrderType() == OP_SELL) gi_640 += MathRound((OrderOpenPrice() - OrderClosePrice()) / l_point_4);
         }
      }
   }
   int li_20 = MarketInfo(OrderSymbol(), MODE_DIGITS);
   if (li_20 == 3 || li_20 == 5 && gi_640 > 0) gi_640 = MathRound((gi_640 + 10) / 10);
   if (li_20 == 3 || li_20 == 5 && gi_640 < 0) gi_640 = MathRound((gi_640 - 10) / 10);
   return (gd_832);
}

double CheckCurrentEquity() {
   gi_unused_876 = 0;
   gd_1200 = 0;
   double ld_0 = 0;
   for (int l_pos_8 = OrdersTotal() - 1; l_pos_8 >= 0; l_pos_8--) {
      OrderSelect(l_pos_8, SELECT_BY_POS, MODE_TRADES);
      ld_0 = OrderCommission();
      if (ld_0 > 0.0) ld_0 = -1.0 * ld_0;
      if (OrderMagicNumber() == 0)
         if (OrderType() == OP_BUY || OrderType() == OP_SELL) gd_1200 += OrderProfit() + OrderSwap() + ld_0;
   }
   return (gd_1200);
}

int Elegxe_Trex_Isozygio() {
   double ld_0 = 0;
   gd_1192 = 0.0;
   for (int l_pos_8 = OrdersTotal() - 1; l_pos_8 >= 0; l_pos_8--) {
      if (OrderMagicNumber() == 0) {
         OrderSelect(l_pos_8, SELECT_BY_POS);
         if (OrderType() == OP_BUY) ld_0 += OrderProfit();
         else
            if (OrderType() == OP_SELL) ld_0 += OrderProfit();
      }
   }
   if (ld_0 > 0.0) gd_1192 = 100.0 * (1 - AccountBalance() / AccountEquity());
   else
      if (ld_0 < 0.0) gd_1192 = -1.0 * (100.0 * (1 - AccountEquity() / AccountBalance()));
   if (ld_0 > 0.0 && ld_0 >= AccountBalance() * Close.Trades.At.Plus.Bal.Pct / 100.0) return (1);
   if (ld_0 < 0.0 && ld_0 <= (-1.0 * (AccountBalance() * Close.Trades.At.Minus.Bal.Pct / 100.0))) return (2);
   return (0);
}

void SkotoseOlesTisEntol(int ai_0) {
   int li_unused_4;
   int l_count_12;
   AllPosCounter();
   while (g_count_588 > 0) {
      for (int l_pos_8 = OrdersTotal() - 1; l_pos_8 >= 0 || g_count_588 > 0; l_pos_8--) {
         OrderSelect(l_pos_8, SELECT_BY_POS);
         if (OrderMagicNumber() == 0) {
            l_count_12 = 0;
            while (l_count_12 < 5 && !IsTradeAllowed()) {
               l_count_12++;
               Sleep(1000);
            }
            RefreshRates();
            g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
            gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
            gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
            g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
            gd_808 = SetPoint();
            if (OrderType() == OP_BUY) {
               if (ai_0 == 1) Print("## ", OrderTicket(), "   Closing all open orders due to max profit reached by total pips");
               if (ai_0 == 2) Print("## ", OrderTicket(), "   Closing all open orders due to max profit reached by total amount");
               if (ai_0 == 3) Print("## ", OrderTicket(), "   Closing all open orders due to max profit reached by total percentage");
               if (ai_0 == 4) Print("## ", OrderTicket(), "   Closing all open orders due to max loss reached by total pips");
               if (ai_0 == 5) Print("## ", OrderTicket(), "   Closing all open orders due to max loss reached by total amount");
               if (ai_0 == 6) Print("## ", OrderTicket(), "   Closing all open orders due to max loss reached by total percentage");
               if (ai_0 == 0) Print("## ", OrderTicket(), "   Closing all remaining open orders");
               if (ai_0 == 9) Print("## ", OrderTicket(), "   Closing all open orders manually");
               if (OrderTicket() > 0) li_unused_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(g_bid_508, g_digits_536), Slippage, Red);
            } else {
               if (OrderType() == OP_SELL) {
                  if (ai_0 == 1) Print("## ", OrderTicket(), "   Closing all open orders due to max profit reached by total pips");
                  if (ai_0 == 2) Print("## ", OrderTicket(), "   Closing all open orders due to max profit reached by total amount");
                  if (ai_0 == 3) Print("## ", OrderTicket(), "   Closing all open orders due to max profit reached by total percentage");
                  if (ai_0 == 4) Print("## ", OrderTicket(), "   Closing all open orders due to max loss reached by total pips");
                  if (ai_0 == 5) Print("## ", OrderTicket(), "   Closing all open orders due to max loss reached by total amount");
                  if (ai_0 == 6) Print("## ", OrderTicket(), "   Closing all open orders due to max loss reached by total percentage");
                  if (ai_0 == 0) Print("## ", OrderTicket(), "   Closing all remaining open orders");
                  if (ai_0 == 9) Print("## ", OrderTicket(), "   Closing all open orders manually");
                  if (OrderTicket() > 0) li_unused_4 = OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(g_ask_500, g_digits_536), Slippage, Red);
               }
            }
            Sleep(1000);
            AllPosCounter();
            if (g_count_588 == 0) gi_1256 = FALSE;
         }
      }
      AllPosCounter();
      if (g_count_588 == 0) gi_1256 = FALSE;
   }
}

void DesAnKerdosEftase(int ai_0) {
   int li_unused_4 = 0;
   Elegxe_Trexon_Kerdos();
   CheckCurrentEquity();
   Elegxe_Trex_Isozygio();
   if ((ai_0 == 1 && gi_640 >= Close.Trades.At.Plus.Pips) || (ai_0 == 2 && CheckCurrentEquity() >= Close.Trades.At.Plus.Amnt) || (ai_0 == 3 && Elegxe_Trex_Isozygio() == 1)) {
      gi_1256 = TRUE;
      SkotoseOlesTisEntol(ai_0);
   }
}

void DesAnXasouraKleisimo(int ai_0) {
   int li_unused_4 = 0;
   Elegxe_Trexon_Kerdos();
   CheckCurrentEquity();
   Elegxe_Trex_Isozygio();
   if ((ai_0 == 4 && gi_640 <= (-1 * Close.Trades.At.Minus.Pips)) || (ai_0 == 5 && CheckCurrentEquity() <= (-1.0 * Close.Trades.At.Minus.Amnt)) || (ai_0 == 6 && Elegxe_Trex_Isozygio() == 2)) {
      gi_1256 = TRUE;
      SkotoseOlesTisEntol(ai_0);
   }
}

void TemaxisePosothta(int ai_0) {
   double ld_4;
   double ld_12;
   double ld_20;
   double ld_28;
   double ld_36;
   int l_ticket_44;
   int l_ticket_48;
   int l_ticket_52;
   double ld_64;
   double ld_72;
   double ld_80;
   double l_lots_88;
   int li_96;
   int li_56 = TsekareThnAsfaleia();
   if (li_56 > 0) {
      EnhmeroseXrhsth(li_56);
      return;
   }
   if (ai_0 == 1) {
      for (int l_pos_60 = OrdersTotal() - 1; l_pos_60 >= 0; l_pos_60--) {
         OrderSelect(l_pos_60, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
            RefreshRates();
            g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
            gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
            gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
            g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
            gd_808 = SetPoint();
            if (OrderTicket() > 0 && OrderType() == OP_BUY) {
               OrderSelect(OrderTicket(), SELECT_BY_TICKET);
               if (Use.CrownForex) {
                  ld_4 = NormalizeDouble(100000.0 * Lot.Size, 2);
                  ld_12 = NormalizeDouble(100000.0 * Scale.Out.Lots, 2);
                  ld_20 = NormalizeDouble(OrderLots(), 2);
               } else {
                  ld_4 = NormalizeDouble(Lot.Size, 2);
                  ld_12 = NormalizeDouble(Scale.Out.Lots, 2);
                  ld_20 = NormalizeDouble(OrderLots(), 2);
               }
               l_ticket_44 = 100.0 * ld_4;
               l_ticket_48 = 100.0 * ld_12;
               l_ticket_52 = 100.0 * ld_20;
               if (l_ticket_44 == l_ticket_48) {
                  ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP1 * gd_808, g_digits_536);
                  ld_36 = 0;
               }
               if (l_ticket_44 == 2 * l_ticket_48) {
                  if (l_ticket_52 == l_ticket_44) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP1 * gd_808, g_digits_536);
                     ld_36 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                  } else {
                     if (l_ticket_52 == l_ticket_48) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                        ld_36 = 0;
                     }
                  }
               }
               if (l_ticket_44 == 3 * l_ticket_48) {
                  if (l_ticket_52 == l_ticket_44) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP1 * gd_808, g_digits_536);
                     ld_36 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                  } else {
                     if (l_ticket_52 == l_ticket_48) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP3 * gd_808, g_digits_536);
                        ld_36 = 0;
                     } else {
                        ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                        ld_36 = NormalizeDouble(OrderOpenPrice() + Actual.TP3 * gd_808, g_digits_536);
                     }
                  }
               }
               RefreshRates();
               if (g_bid_508 < ld_28) continue;
               g_count_760 = 0;
               while (g_count_760 < 5 && !IsTradeAllowed()) {
                  g_count_760++;
                  Sleep(1000);
               }
               RefreshRates();
               if (Use.CrownForex) {
                  if (OrderClose(OrderTicket(), 100000.0 * Scale.Out.Lots, NormalizeDouble(g_bid_508, g_digits_536), Slippage, LimeGreen)) {
                     Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "  Scaling Out Long ", Scale.Out.Lots, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                     pop(Symbol() + " " + Period() + "min" + "   Scaling Out Long Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                     Sleep(1000);
                     return;
                  }
                  Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7001 Closing Long Entry Target @ ", NormalizeDouble(ld_36, g_digits_536));
                  return;
               }
               if (OrderClose(OrderTicket(), Scale.Out.Lots, NormalizeDouble(g_bid_508, g_digits_536), Slippage, LimeGreen)) {
                  Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "  Scaling Out Long ", Scale.Out.Lots, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                  pop(Symbol() + " " + Period() + "min" + "   Scaling Out Long Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                  Sleep(1000);
                  return;
               }
               Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7002 Closing Long Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
               return;
            }
            if (OrderTicket() > 0 && OrderType() == OP_SELL) {
               OrderSelect(OrderTicket(), SELECT_BY_TICKET);
               if (Use.CrownForex) {
                  ld_4 = NormalizeDouble(100000.0 * Lot.Size, 2);
                  ld_12 = NormalizeDouble(100000.0 * Scale.Out.Lots, 2);
                  ld_20 = NormalizeDouble(OrderLots(), 2);
               } else {
                  ld_4 = NormalizeDouble(Lot.Size, 2);
                  ld_12 = NormalizeDouble(Scale.Out.Lots, 2);
                  ld_20 = NormalizeDouble(OrderLots(), 2);
               }
               l_ticket_44 = 100.0 * ld_4;
               l_ticket_48 = 100.0 * ld_12;
               l_ticket_52 = 100.0 * ld_20;
               if (l_ticket_44 == l_ticket_48) {
                  ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP1 * gd_808, g_digits_536);
                  ld_36 = 0;
               }
               if (l_ticket_44 == 2 * l_ticket_48) {
                  if (l_ticket_52 == l_ticket_44) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP1 * gd_808, g_digits_536);
                     ld_36 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                  } else {
                     if (l_ticket_52 == l_ticket_48) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                        ld_36 = 0;
                     }
                  }
               }
               if (l_ticket_44 == 3 * l_ticket_48) {
                  if (l_ticket_52 == l_ticket_44) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP1 * gd_808, g_digits_536);
                     ld_36 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                  } else {
                     if (l_ticket_52 == l_ticket_48) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP3 * gd_808, g_digits_536);
                        ld_36 = 0;
                     } else {
                        ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                        ld_36 = NormalizeDouble(OrderOpenPrice() - Actual.TP3 * gd_808, g_digits_536);
                     }
                  }
               }
               RefreshRates();
               if (g_ask_500 <= ld_28) {
                  g_count_760 = 0;
                  while (g_count_760 < 5 && !IsTradeAllowed()) {
                     g_count_760++;
                     Sleep(1000);
                  }
                  RefreshRates();
                  if (Use.CrownForex) {
                     if (OrderClose(OrderTicket(), 100000.0 * Scale.Out.Lots, NormalizeDouble(g_ask_500, g_digits_536), Slippage, LimeGreen)) {
                        Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Scaling Out Short ", Scale.Out.Lots, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                        pop(Symbol() + " " + Period() + "min" + "   Scaling Out Short Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                        Sleep(1000);
                        return;
                     }
                     Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7001 Closing Short Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
                     return;
                  }
                  if (OrderClose(OrderTicket(), Scale.Out.Lots, NormalizeDouble(g_ask_500, g_digits_536), Slippage, LimeGreen)) {
                     Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Scaling Out Short ", Scale.Out.Lots, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                     pop(Symbol() + " " + Period() + "min" + "   Scaling Out Short Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                     Sleep(1000);
                     return;
                  }
                  Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7002 Closing Short Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
                  return;
               }
            }
         }
      }
   } else {
      ld_64 = 0.0;
      ld_72 = 0.0;
      ld_80 = 0.0;
      l_lots_88 = 0.0;
      li_96 = 0;
      for (l_pos_60 = OrdersTotal() - 1; l_pos_60 >= 0; l_pos_60--) {
         OrderSelect(l_pos_60, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
            RefreshRates();
            g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
            gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
            gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
            g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
            gd_808 = SetPoint();
            if (OrderTicket() > 0 && OrderType() == OP_BUY) {
               OrderSelect(OrderTicket(), SELECT_BY_TICKET);
               if (Use.CrownForex) {
                  ld_4 = NormalizeDouble(100000.0 * Lot.Size, 2);
                  ld_64 = NormalizeDouble(100000.0 * Actual.TP1.Lots, 2);
                  ld_72 = NormalizeDouble(100000.0 * Actual.TP2.Lots, 2);
                  ld_80 = NormalizeDouble(100000.0 * Actual.TP3.Lots, 2);
               } else {
                  ld_4 = NormalizeDouble(Lot.Size, 2);
                  ld_64 = NormalizeDouble(Actual.TP1.Lots, 2);
                  ld_72 = NormalizeDouble(Actual.TP2.Lots, 2);
                  ld_80 = NormalizeDouble(Actual.TP3.Lots, 2);
               }
               if (gd_1248 == 3.0) {
                  if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_64 + ld_72 + ld_80, 2)) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP1 * gd_808, g_digits_536);
                     li_96 = 1;
                     ld_36 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                  }
                  if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_72 + ld_80, 2)) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                     li_96 = 2;
                     ld_36 = NormalizeDouble(OrderOpenPrice() + Actual.TP3 * gd_808, g_digits_536);
                  }
                  if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_80, 2)) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP3 * gd_808, g_digits_536);
                     li_96 = 3;
                     ld_36 = 0;
                  }
               } else {
                  if (gd_1248 == 2.0) {
                     if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_64 + ld_72, 2)) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP1 * gd_808, g_digits_536);
                        li_96 = 1;
                        ld_36 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                     }
                     if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_72, 2)) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP2 * gd_808, g_digits_536);
                        li_96 = 2;
                        ld_36 = 0;
                     }
                  } else {
                     if (gd_1248 == 1.0) {
                        if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_64, 2)) {
                           ld_28 = NormalizeDouble(OrderOpenPrice() + Actual.TP1 * gd_808, g_digits_536);
                           li_96 = 1;
                           ld_36 = 0;
                        }
                     }
                  }
               }
               if (li_96 == 1) l_lots_88 = Actual.TP1.Lots;
               if (li_96 == 2) l_lots_88 = Actual.TP2.Lots;
               if (li_96 == 3) l_lots_88 = Actual.TP3.Lots;
               if (g_bid_508 < ld_28) continue;
               g_count_760 = 0;
               while (g_count_760 < 5 && !IsTradeAllowed()) {
                  g_count_760++;
                  Sleep(1000);
               }
               RefreshRates();
               if (Use.CrownForex) {
                  if (OrderClose(OrderTicket(), 100000.0 * l_lots_88, NormalizeDouble(g_bid_508, g_digits_536), Slippage, LimeGreen)) {
                     Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "  Scaling Out Long ", l_lots_88, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                     pop(Symbol() + " " + Period() + "min" + "   Scaling Out Long Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                     Sleep(1000);
                     return;
                  }
                  Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7003 Closing Long Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
                  return;
               }
               if (OrderClose(OrderTicket(), l_lots_88, NormalizeDouble(g_bid_508, g_digits_536), Slippage, LimeGreen)) {
                  Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "  Scaling Out Long ", l_lots_88, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                  pop(Symbol() + " " + Period() + "min" + "   Scaling Out Long Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                  Sleep(1000);
                  return;
               }
               Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7004 Closing Long Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
               return;
            }
            if (OrderTicket() > 0 && OrderType() == OP_SELL) {
               OrderSelect(OrderTicket(), SELECT_BY_TICKET);
               if (Use.CrownForex) {
                  ld_4 = NormalizeDouble(100000.0 * Lot.Size, 2);
                  ld_64 = NormalizeDouble(100000.0 * Actual.TP1.Lots, 2);
                  ld_72 = NormalizeDouble(100000.0 * Actual.TP2.Lots, 2);
                  ld_80 = NormalizeDouble(100000.0 * Actual.TP3.Lots, 2);
               } else {
                  ld_4 = NormalizeDouble(Lot.Size, 2);
                  ld_64 = NormalizeDouble(Actual.TP1.Lots, 2);
                  ld_72 = NormalizeDouble(Actual.TP2.Lots, 2);
                  ld_80 = NormalizeDouble(Actual.TP3.Lots, 2);
               }
               if (gd_1248 == 3.0) {
                  if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_64 + ld_72 + ld_80, 2)) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP1 * gd_808, g_digits_536);
                     li_96 = 1;
                     ld_36 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                  }
                  if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_72 + ld_80, 2)) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                     li_96 = 2;
                     ld_36 = NormalizeDouble(OrderOpenPrice() - Actual.TP3 * gd_808, g_digits_536);
                  }
                  if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_80, 2)) {
                     ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP3 * gd_808, g_digits_536);
                     li_96 = 3;
                     ld_36 = 0;
                  }
               } else {
                  if (gd_1248 == 2.0) {
                     if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_64 + ld_72, 2)) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP1 * gd_808, g_digits_536);
                        li_96 = 1;
                        ld_36 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                     }
                     if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_72, 2)) {
                        ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP2 * gd_808, g_digits_536);
                        li_96 = 2;
                        ld_36 = 0;
                     }
                  } else {
                     if (gd_1248 == 1.0) {
                        if (NormalizeDouble(OrderLots(), 2) == NormalizeDouble(ld_64, 2)) {
                           ld_28 = NormalizeDouble(OrderOpenPrice() - Actual.TP1 * gd_808, g_digits_536);
                           li_96 = 1;
                           ld_36 = 0;
                        }
                     }
                  }
               }
               if (li_96 == 1) l_lots_88 = Actual.TP1.Lots;
               if (li_96 == 2) l_lots_88 = Actual.TP2.Lots;
               if (li_96 == 3) l_lots_88 = Actual.TP3.Lots;
               RefreshRates();
               if (g_ask_500 <= ld_28) {
                  g_count_760 = 0;
                  while (g_count_760 < 5 && !IsTradeAllowed()) {
                     g_count_760++;
                     Sleep(1000);
                  }
                  RefreshRates();
                  if (Use.CrownForex) {
                     if (OrderClose(OrderTicket(), 100000.0 * l_lots_88, NormalizeDouble(g_ask_500, g_digits_536), Slippage, LimeGreen)) {
                        Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Scaling Out Short ", l_lots_88, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                        pop(Symbol() + " " + Period() + "min" + "   Scaling Out Short Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                        Sleep(1000);
                        return;
                     }
                     Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7003 Closing Short Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
                     return;
                  }
                  if (OrderClose(OrderTicket(), l_lots_88, NormalizeDouble(g_ask_500, g_digits_536), Slippage, LimeGreen)) {
                     Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Scaling Out Short ", l_lots_88, " lots at ", NormalizeDouble(g_bid_508, g_digits_536), "  Next Target at ", NormalizeDouble(ld_36, g_digits_536));
                     pop(Symbol() + " " + Period() + "min" + "   Scaling Out Short Entry  " + Scale.Out.Lots + " lots at " + NormalizeDouble(g_bid_508, g_digits_536), "C:\\");
                     Sleep(1000);
                     return;
                  }
                  Print("Artemis Sitter PRO v1.80 ", Symbol(), " ", Period(), "min", "   Error 7004 Closing Short Entry Target @ ", NormalizeDouble(ld_28, g_digits_536));
                  return;
               }
            }
         }
      }
   }
}

void Trail.Stop() {
   double ld_0;
   double l_price_8;
   double ld_16;
   double l_price_24;
   double ld_32;
   double ld_48;
   double ld_56;
   double ld_64;
   double ld_72;
   int l_ticket_80;
   int l_ticket_84;
   int li_40 = TsekareThnAsfaleia();
   if (li_40 > 0) {
      EnhmeroseXrhsth(li_40);
      return;
   }
   if (Handle.All.Stops.Manually == 0) {
      for (int l_pos_44 = OrdersTotal() - 1; l_pos_44 >= 0; l_pos_44--) {
         RefreshRates();
         OrderSelect(l_pos_44, SELECT_BY_POS, MODE_TRADES);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
            RefreshRates();
            g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
            gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
            ld_32 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
            g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
            gd_808 = SetPoint();
            if (Trail.Pips > 0) {
               if (OrderType() == OP_BUY && (Trail.Starts.After.BreakEven && g_bid_508 >= OrderOpenPrice() + Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven) {
                  ld_0 = Trail.Pips * gd_808;
                  RefreshRates();
                  if (g_bid_508 > OrderOpenPrice() + ld_0 && OrderStopLoss() < OrderOpenPrice() + (g_bid_508 - (OrderOpenPrice() + ld_0))) {
                     l_price_8 = NormalizeDouble(OrderOpenPrice() + (g_bid_508 - (OrderOpenPrice() + ld_0)), g_digits_536);
                     if (OrderStopLoss() < l_price_8) {
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(OrderTicket(), OrderOpenPrice(), l_price_8, OrderTakeProfit(), OrderExpiration(), LimeGreen);
                        Sleep(1000);
                        return;
                     }
                  }
               }
               if (!(OrderType() == OP_SELL && (Trail.Starts.After.BreakEven && g_ask_500 <= OrderOpenPrice() - Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven)) continue;
               ld_16 = Trail.Pips * gd_808;
               RefreshRates();
               if (!(g_ask_500 < OrderOpenPrice() - ld_16 && OrderStopLoss() > OrderOpenPrice() - (OrderOpenPrice() - ld_16) - g_ask_500)) continue;
               l_price_24 = NormalizeDouble(OrderOpenPrice() - (OrderOpenPrice() - ld_16 - g_ask_500), g_digits_536);
               if (OrderStopLoss() <= l_price_24) continue;
               while (g_count_796 < 5 && !IsTradeAllowed()) {
                  g_count_796++;
                  Sleep(2000);
               }
               OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, OrderTakeProfit(), OrderExpiration(), MediumVioletRed);
               Sleep(1000);
               return;
            }
            if (Trail.With.MA) {
               if (OrderType() == OP_BUY && (Trail.Starts.After.BreakEven && g_bid_508 >= OrderOpenPrice() + Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven) {
                  RefreshRates();
                  ld_48 = iMA(NULL, 0, MA.Period, 0, MA.Method, PRICE_CLOSE, 1) - Trail.Threashold.Pips * gd_808;
                  if (NormalizeDouble(g_bid_508, g_digits_536) > NormalizeDouble(ld_48, g_digits_536) && NormalizeDouble(OrderStopLoss(), g_digits_536) < NormalizeDouble(ld_48, g_digits_536)) {
                     l_price_8 = NormalizeDouble(ld_48, g_digits_536);
                     if (OrderStopLoss() < l_price_8) {
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(OrderTicket(), OrderOpenPrice(), l_price_8, OrderTakeProfit(), OrderExpiration(), LimeGreen);
                        pop(Symbol() + " " + Period() + "min" + "   Long Entry SL now trailed at  " + l_price_8, "C:\\");
                        Sleep(1000);
                        return;
                     }
                  }
               }
               if (!(OrderType() == OP_SELL && (Trail.Starts.After.BreakEven && g_ask_500 <= OrderOpenPrice() - Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven)) continue;
               RefreshRates();
               ld_48 = iMA(NULL, 0, MA.Period, 0, MA.Method, PRICE_CLOSE, 1) + (g_ask_500 - g_bid_508) + Trail.Threashold.Pips * gd_808;
               if (!(NormalizeDouble(g_ask_500, g_digits_536) < NormalizeDouble(ld_48, g_digits_536) && NormalizeDouble(OrderStopLoss(), g_digits_536) > NormalizeDouble(ld_48, g_digits_536))) continue;
               l_price_24 = NormalizeDouble(ld_48, g_digits_536);
               if (OrderStopLoss() <= l_price_24) continue;
               while (g_count_796 < 5 && !IsTradeAllowed()) {
                  g_count_796++;
                  Sleep(2000);
               }
               OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, OrderTakeProfit(), OrderExpiration(), MediumVioletRed);
               pop(Symbol() + " " + Period() + "min" + "   Short Entry SL now trailed at  " + l_price_24, "C:\\");
               Sleep(1000);
               return;
            }
            if (Trail.With.PSAR) {
               ld_56 = NormalizeDouble(iSAR(NULL, Psar.TimeFrame, PSAR.Step, PSAR.Maximum, 1), g_digits_536);
               ld_64 = NormalizeDouble(iHigh(NULL, Psar.TimeFrame, 1), g_digits_536);
               ld_72 = NormalizeDouble(iLow(NULL, Psar.TimeFrame, 1), g_digits_536);
               l_ticket_80 = ld_56 <= ld_72;
               l_ticket_84 = ld_56 >= ld_64;
               if (l_ticket_80 && OrderType() == OP_BUY && (Trail.Starts.After.BreakEven && g_bid_508 >= OrderOpenPrice() + Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven) {
                  RefreshRates();
                  if (NormalizeDouble(g_bid_508, g_digits_536) > NormalizeDouble(ld_56, g_digits_536) && NormalizeDouble(OrderStopLoss(), g_digits_536) < NormalizeDouble(ld_56, g_digits_536)) {
                     l_price_8 = NormalizeDouble(ld_56, g_digits_536);
                     if (OrderStopLoss() < l_price_8) {
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(OrderTicket(), OrderOpenPrice(), l_price_8, OrderTakeProfit(), OrderExpiration(), LimeGreen);
                        pop(Symbol() + " " + Period() + "min" + "   Long Entry SL now trailed at  " + l_price_8, "C:\\");
                        Sleep(1000);
                        return;
                     }
                  }
               }
               if (!(l_ticket_84 && OrderType() == OP_SELL && (Trail.Starts.After.BreakEven && g_ask_500 <= OrderOpenPrice() - Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven)) continue;
               RefreshRates();
               if (!(NormalizeDouble(g_ask_500, g_digits_536) < NormalizeDouble(ld_56, g_digits_536) && NormalizeDouble(OrderStopLoss(), g_digits_536) > NormalizeDouble(ld_56, g_digits_536))) continue;
               l_price_24 = NormalizeDouble(ld_56, g_digits_536);
               if (OrderStopLoss() <= l_price_24) continue;
               while (g_count_796 < 5 && !IsTradeAllowed()) {
                  g_count_796++;
                  Sleep(2000);
               }
               OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, OrderTakeProfit(), OrderExpiration(), MediumVioletRed);
               pop(Symbol() + " " + Period() + "min" + "   Short Entry SL now trailed at  " + l_price_24, "C:\\");
               Sleep(1000);
               return;
            }
            if (Trail.HL.Previous.Bars.Count > WHOLE_ARRAY) {
               gd_1080 = High[iHighest(NULL, 0, MODE_HIGH, Trail.HL.Previous.Bars.Count, 1)] + 1.0 * gd_808 + ld_32;
               gd_1088 = Low[iLowest(NULL, 0, MODE_LOW, Trail.HL.Previous.Bars.Count, 1)] - 1.0 * gd_808;
               if (OrderType() == OP_BUY && (Trail.Starts.After.BreakEven && g_bid_508 >= OrderOpenPrice() + Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven) {
                  RefreshRates();
                  if (NormalizeDouble(g_bid_508, g_digits_536) > NormalizeDouble(gd_1088, g_digits_536) && NormalizeDouble(OrderStopLoss(), g_digits_536) < NormalizeDouble(gd_1088, g_digits_536)) {
                     l_price_8 = NormalizeDouble(gd_1088, g_digits_536);
                     if (OrderStopLoss() < l_price_8) {
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(OrderTicket(), OrderOpenPrice(), l_price_8, OrderTakeProfit(), OrderExpiration(), LimeGreen);
                        pop(Symbol() + " " + Period() + "min" + "   Long Entry SL now trailed at  " + l_price_8, "C:\\");
                        Sleep(1000);
                        return;
                     }
                  }
               }
               if (OrderType() == OP_SELL && (Trail.Starts.After.BreakEven && g_ask_500 <= OrderOpenPrice() - Move.To.BreakEven.at.pips * gd_808) || !Trail.Starts.After.BreakEven) {
                  RefreshRates();
                  if (NormalizeDouble(g_ask_500, g_digits_536) < NormalizeDouble(gd_1080, g_digits_536) && NormalizeDouble(OrderStopLoss(), g_digits_536) > NormalizeDouble(gd_1080, g_digits_536)) {
                     l_price_24 = NormalizeDouble(gd_1080, g_digits_536);
                     if (OrderStopLoss() > l_price_24) {
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, OrderTakeProfit(), OrderExpiration(), MediumVioletRed);
                        pop(Symbol() + " " + Period() + "min" + "   Short Entry SL now trailed at  " + l_price_24, "C:\\");
                        Sleep(1000);
                        return;
                     }
                  }
               }
            }
         }
      }
   }
}

void AsfaliseEntolh() {
   double ld_unused_0;
   int l_error_8;
   int l_ticket_12;
   RefreshRates();
   int li_16 = TsekareThnAsfaleia();
   if (li_16 > 0) {
      EnhmeroseXrhsth(li_16);
      return;
   }
   if (Handle.All.Stops.Manually == 0) {
      for (int l_pos_20 = OrdersTotal() - 1; l_pos_20 >= 0; l_pos_20--) {
         OrderSelect(l_pos_20, SELECT_BY_POS);
         if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
            RefreshRates();
            g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
            gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
            gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
            g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
            g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
            gd_808 = SetPoint();
            l_ticket_12 = OrderTicket();
            if (l_ticket_12 > 0) {
               if (OrderType() == OP_BUY) {
                  RefreshRates();
                  if (OrderStopLoss() < OrderOpenPrice()) {
                     if (g_bid_508 >= OrderOpenPrice() + Move.To.BreakEven.at.pips * gd_808) {
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        ld_unused_0 = OrderStopLoss();
                        OrderModify(l_ticket_12, OrderOpenPrice(), OrderOpenPrice() + Move.To.BreakEven.Lock.pips * gd_808, OrderTakeProfit(), OrderExpiration(), LimeGreen);
                        l_error_8 = GetLastError();
                        if (l_error_8 > 0/* NO_ERROR */) {
                           Print("Artemis Sitter PRO ", Symbol(), " ", Period(), "min", "   Error moving Long StopLoss to BE: ", GetLastError(), " ", ErrorDescription(l_error_8), "   S/L=", OrderOpenPrice() +
                              Move.To.BreakEven.Lock.pips * gd_808, "   T/P=", OrderTakeProfit());
                        } else {
                           if (gi_592 >= 1) Print("Artemis Sitter PRO ", Symbol(), " ", Period(), "min", "   Long StopLoss Moved to BE at : ", OrderOpenPrice() + Move.To.BreakEven.Lock.pips * gd_808);
                           pop(Symbol() + " " + Period() + "min" + "   Long Entry StopLoss Moved to BE at : " + ((OrderOpenPrice() + Move.To.BreakEven.Lock.pips * gd_808)), "C:\\");
                           Sleep(2000);
                        }
                     }
                     Sleep(2000);
                  }
               } else {
                  if (OrderType() == OP_SELL) {
                     RefreshRates();
                     if (OrderStopLoss() > OrderOpenPrice()) {
                        if (g_ask_500 <= OrderOpenPrice() - Move.To.BreakEven.at.pips * gd_808) {
                           while (g_count_796 < 5 && !IsTradeAllowed()) {
                              g_count_796++;
                              Sleep(2000);
                           }
                           ld_unused_0 = OrderStopLoss();
                           OrderModify(l_ticket_12, OrderOpenPrice(), OrderOpenPrice() - Move.To.BreakEven.Lock.pips * gd_808, OrderTakeProfit(), OrderExpiration(), MediumVioletRed);
                           l_error_8 = GetLastError();
                           if (l_error_8 > 0/* NO_ERROR */) Print("Artemis Sitter PRO ", Symbol(), " ", Period(), "min", "   Error moving Short StopLoss to BE: ", GetLastError(), " ", ErrorDescription(l_error_8), "   S/L=", OrderOpenPrice() - Move.To.BreakEven.Lock.pips * gd_808, "   T/P=", OrderTakeProfit());
                           else {
                              if (gi_592 >= 1) Print("Artemis Sitter PRO ", Symbol(), " ", Period(), "min", "   Short StopLoss Moved to BE at : ", OrderOpenPrice() - Move.To.BreakEven.Lock.pips * gd_808);
                              pop(Symbol() + " " + Period() + "min" + "   Short Entry StopLoss Moved to BE at : " + ((OrderOpenPrice() - Move.To.BreakEven.Lock.pips * gd_808)), "C:\\");
                              Sleep(2000);
                           }
                        }
                        Sleep(2000);
                     }
                  }
               }
            }
         }
      }
   }
}

void Check.Actual.SL.Reached() {
   int l_ticket_24;
   RefreshRates();
   double ld_4 = 0;
   int li_28 = TsekareThnAsfaleia();
   if (li_28 > 0) {
      EnhmeroseXrhsth(li_28);
      return;
   }
   for (int l_pos_32 = OrdersTotal() - 1; l_pos_32 >= 0; l_pos_32--) {
      OrderSelect(l_pos_32, SELECT_BY_POS);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
         RefreshRates();
         g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
         gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
         gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
         g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
         g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
         gd_808 = SetPoint();
         l_ticket_24 = OrderTicket();
         if (l_ticket_24 > 0) {
            if (OrderType() == OP_BUY) {
               ld_4 = (OrderClosePrice() - OrderOpenPrice()) / gd_808;
               if (!(ld_4 < 0.0 && MathAbs(ld_4) >= Actual.SL)) continue;
               g_count_760 = 0;
               while (g_count_760 < 5 && !IsTradeAllowed()) {
                  g_count_760++;
                  Sleep(2000);
               }
               Print("*** Closing ticket# ", OrderTicket(), TimeToStr(TimeCurrent(), TIME_MINUTES), "   Long at SL     SL=", Actual.SL, "     Position P&L=", MathAbs(ld_4));
               OrderClose(l_ticket_24, OrderLots(), NormalizeDouble(g_bid_508, g_digits_536), Slippage, Pink);
               pop("*** Closing Long  ticket# " + OrderTicket() + " on SL for " + Symbol(), "C:\\");
               Sleep(1000);
               return;
            }
            if (OrderType() == OP_SELL) {
               ld_4 = (OrderOpenPrice() - OrderClosePrice()) / gd_808;
               if (ld_4 < 0.0 && MathAbs(ld_4) >= Actual.SL) {
                  g_count_760 = 0;
                  while (g_count_760 < 5 && !IsTradeAllowed()) {
                     g_count_760++;
                     Sleep(2000);
                  }
                  Print("*** Closing ticket# ", OrderTicket(), TimeToStr(TimeCurrent(), TIME_MINUTES), "   Short at SL     SL=", Actual.SL, "     Position P&L=", MathAbs(ld_4));
                  pop("*** Closing Short  ticket# " + OrderTicket() + " on SL for " + Symbol(), "C:\\");
                  OrderClose(l_ticket_24, OrderLots(), NormalizeDouble(g_ask_500, g_digits_536), Slippage, Pink);
                  Sleep(1000);
                  return;
               }
            }
         }
      }
   }
}

double AdjustLotsToBroker(double ad_0) {
   double ld_ret_32;
   RefreshRates();
   double l_lotstep_8 = MarketInfo(Symbol(), MODE_LOTSTEP);
   double l_minlot_16 = MarketInfo(Symbol(), MODE_MINLOT);
   double ld_unused_24 = MarketInfo(Symbol(), MODE_MAXLOT);
   if (l_lotstep_8 > 0.0) ld_ret_32 = MathCeil(ad_0 / l_lotstep_8) * l_lotstep_8;
   else ld_ret_32 = 0;
   if (ld_ret_32 < l_minlot_16) {
      if (l_minlot_16 > 0.0) return (l_minlot_16);
      return (ad_0);
   }
   if (ld_ret_32 > 0.0) return (ld_ret_32);
   return (ad_0);
}

double YpologisePosothta() {
   double ld_ret_0;
   RefreshRates();
   double ld_unused_8 = MarketInfo(Symbol(), MODE_LOTSTEP);
   double l_minlot_16 = MarketInfo(Symbol(), MODE_MINLOT);
   double l_maxlot_24 = MarketInfo(Symbol(), MODE_MAXLOT);
   double l_tickvalue_32 = MarketInfo(Symbol(), MODE_TICKVALUE);
   if (Use.CrownForex) {
      if (l_tickvalue_32 * Actual.SL != 0.0) {
         if (gi_236) ld_ret_0 = NormalizeDouble(AccountFreeMargin() * gd_240 / (l_tickvalue_32 * Actual.SL), 2);
         else ld_ret_0 = 100000.0 * Lot.Size;
      } else ld_ret_0 = 100000.0 * Lot.Size;
   } else {
      if (l_tickvalue_32 * Actual.SL != 0.0) {
         if (gi_236) ld_ret_0 = NormalizeDouble(AccountFreeMargin() * gd_240 / (l_tickvalue_32 * Actual.SL), 2);
         else ld_ret_0 = Lot.Size;
      } else ld_ret_0 = Lot.Size;
   }
   if (ld_ret_0 < l_minlot_16) ld_ret_0 = l_minlot_16;
   if (ld_ret_0 > l_maxlot_24) ld_ret_0 = l_maxlot_24;
   if (gi_236) return (AdjustLotsToBroker(ld_ret_0));
   return (ld_ret_0);
}

int YannisCustomText(string a_name_0, int a_x_8, int a_y_12, int a_corner_16) {
   ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
   ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_16);
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_8);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_12);
   ObjectSet(a_name_0, OBJPROP_BACK, TRUE);
   return (0);
}

void DeleteAllLines() {
   ObjectDelete("Yannis");
   ObjectDelete("Yannis17");
   ObjectDelete("London");
   ObjectDelete("NewYork");
   ObjectDelete("Tokyo");
   ObjectDelete("LBO2Txt");
   ObjectDelete("LBO1Txt");
   ObjectDelete("SBO1Txt");
   ObjectDelete("SBO2Txt");
   ObjectDelete("S3Txt");
   ObjectDelete("S2Txt");
   ObjectDelete("R3Txt");
   ObjectDelete("R2Txt");
   ObjectDelete("LBO2");
   ObjectDelete("LBO1");
   ObjectDelete("SBO1");
   ObjectDelete("SBO2");
   ObjectDelete("STAR");
   ObjectDelete("LTAR");
   ObjectDelete("NTZ");
   ObjectDelete("F1");
   ObjectDelete("F2");
   ObjectDelete("S3");
   ObjectDelete("S2");
   ObjectDelete("R3");
   ObjectDelete("R2");
   ObjectDelete("LBETW");
   ObjectDelete("SBETW");
   ObjectDelete("Bar");
   ObjectDelete("Broker");
   ObjectDelete("Broker1");
   ObjectDelete("Tokyo");
   ObjectDelete("London");
   ObjectDelete("NewYork");
   ObjectDelete("Artemis");
   for (int li_0 = 600; li_0 >= 0; li_0--) {
      ObjectDelete("Reversal" + li_0);
      ObjectDelete("Syd Open " + TimeToStr(Time[li_0]));
      ObjectDelete("Tok Open " + TimeToStr(Time[li_0]));
      ObjectDelete("Lon Open " + TimeToStr(Time[li_0]));
      ObjectDelete("NY Open " + TimeToStr(Time[li_0]));
   }
   ObjectDelete("TARR");
   ObjectDelete("SARR");
   ObjectDelete("NARR");
   ObjectDelete("LARR");
   ObjectDelete("PLRP1");
   ObjectDelete("PSRP1");
   ObjectDelete("PLRP2");
   ObjectDelete("PSRP2");
   ObjectDelete("RangeHighTarget");
   ObjectDelete("RangeLowTarget");
   ObjectDelete("Sep1");
   ObjectDelete("Sep2");
   ObjectDelete("gmt");
   ObjectDelete("Seep1");
   ObjectDelete("Key00");
   ObjectDelete("Seep2");
   ObjectDelete("Key0");
   ObjectDelete("Seep3");
   ObjectDelete("Key1");
   ObjectDelete("Key2");
   ObjectDelete("Seep4");
   ObjectDelete("Key3");
   ObjectDelete("Key4");
   ObjectDelete("Seep5");
   ObjectDelete("Key5");
   ObjectDelete("Key6");
   ObjectDelete("Seep6");
   ObjectDelete("Key7");
   ObjectDelete("Key8");
   ObjectDelete("Seep7");
   ObjectDelete("odpr3");
   ObjectDelete("odpr2");
   ObjectDelete("odpr1");
   ObjectDelete("odppi");
   ObjectDelete("odps1");
   ObjectDelete("odps2");
   ObjectDelete("odps3");
   ObjectDelete("owpr3");
   ObjectDelete("owpr2");
   ObjectDelete("owpr1");
   ObjectDelete("owppi");
   ObjectDelete("owps1");
   ObjectDelete("owps2");
   ObjectDelete("owps3");
   ObjectDelete("odop1");
   ObjectDelete("odhp1");
   ObjectDelete("odlp1");
   ObjectDelete("owhp1");
   ObjectDelete("owlp1");
}

void RythmiseArxikousStoxous() {
   int l_ticket_20;
   bool li_28;
   double l_ord_stoploss_32;
   double l_ord_takeprofit_40;
   int li_0 = 0;
   int li_4 = 0;
   RefreshRates();
   if (Virtual.SL > 0) li_0 = Virtual.SL;
   else li_0 = Actual.SL;
   if (Virtual.TP > 0) li_4 = Virtual.TP;
   else {
      if (Actual.TP3 > 0) li_4 = Actual.TP3;
      else {
         if (Actual.TP2 > 0) li_4 = Actual.TP2;
         else li_4 = Actual.TP1;
      }
   }
   for (int l_pos_24 = OrdersTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
      OrderSelect(l_pos_24, SELECT_BY_POS);
      if (OrderSymbol() == Symbol() && OrderStopLoss() == 0.0 || OrderTakeProfit() == 0.0 && OrderMagicNumber() == 0) {
         RefreshRates();
         g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
         gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
         gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
         g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
         g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
         gd_808 = SetPoint();
         l_ticket_20 = OrderTicket();
         if (l_ticket_20 > 0) {
            li_28 = FALSE;
            if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP || OrderType() == OP_BUYLIMIT) {
               if (li_0 > 0 && OrderStopLoss() == 0.0 && li_4 > 0 && OrderTakeProfit() == 0.0) {
                  g_count_796 = 0;
                  while (g_count_796 < 5 && !IsTradeAllowed()) {
                     g_count_796++;
                     Sleep(2000);
                  }
                  OrderModify(l_ticket_20, OrderOpenPrice(), OrderOpenPrice() - li_0 * gd_808, OrderOpenPrice() + li_4 * gd_808, OrderExpiration(), LimeGreen);
                  if (OrderSelect(l_ticket_20, SELECT_BY_TICKET, MODE_TRADES)) {
                     Print("Initial SL and TP is Set for Long Entry");
                     pop("Initial SL and TP is Set for Long Entry on " + Symbol(), "C:\\");
                     li_28 = TRUE;
                     Sleep(2000);
                  } else Print("Error 8601 - Error setting initial SL and TP for Long Entry");
               } else {
                  if (li_0 > 0 && OrderStopLoss() == 0.0) {
                     g_count_796 = 0;
                     while (g_count_796 < 5 && !IsTradeAllowed()) {
                        g_count_796++;
                        Sleep(2000);
                     }
                     OrderModify(l_ticket_20, OrderOpenPrice(), OrderOpenPrice() - li_0 * gd_808, OrderTakeProfit(), OrderExpiration(), LimeGreen);
                     if (OrderSelect(l_ticket_20, SELECT_BY_TICKET, MODE_TRADES)) {
                        Print("Initial SL is Set for Long Entry");
                        pop("Initial SL is Set for Long Entry on " + Symbol(), "C:\\");
                        li_28 = TRUE;
                        Sleep(2000);
                     } else Print("Error 8602 - Error setting initial SL for Long Entry");
                  } else {
                     if (li_4 > 0 && OrderTakeProfit() == 0.0) {
                        g_count_796 = 0;
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(l_ticket_20, OrderOpenPrice(), OrderStopLoss(), OrderOpenPrice() + li_4 * gd_808, OrderExpiration(), LimeGreen);
                        if (OrderSelect(l_ticket_20, SELECT_BY_TICKET, MODE_TRADES)) {
                           Print("Initial TP is Set for Long Entry");
                           pop("Initial TP is Set for Long Entry on " + Symbol(), "C:\\");
                           li_28 = TRUE;
                           Sleep(2000);
                        } else Print("Error 8603 - Error setting initial TP for Long Entry");
                     }
                  }
               }
            } else {
               if (OrderType() == OP_SELL || OrderType() == OP_SELLSTOP || OrderType() == OP_SELLLIMIT) {
                  if (li_0 > 0 && OrderStopLoss() == 0.0 && li_4 > 0 && OrderTakeProfit() == 0.0) {
                     g_count_796 = 0;
                     while (g_count_796 < 5 && !IsTradeAllowed()) {
                        g_count_796++;
                        Sleep(2000);
                     }
                     OrderModify(l_ticket_20, OrderOpenPrice(), OrderOpenPrice() + li_0 * gd_808, OrderOpenPrice() - li_4 * gd_808, OrderExpiration(), MediumVioletRed);
                     if (OrderSelect(l_ticket_20, SELECT_BY_TICKET, MODE_TRADES)) {
                        Print("Initial SL and TP is Set for Short Entry");
                        pop("Initial SL and TP is Set for Short Entry on " + Symbol(), "C:\\");
                        li_28 = TRUE;
                        Sleep(2000);
                     } else Print("Error 8604 - Error setting initial SL or TP for Short Entry");
                  } else {
                     if (li_0 > 0 && OrderStopLoss() == 0.0) {
                        g_count_796 = 0;
                        while (g_count_796 < 5 && !IsTradeAllowed()) {
                           g_count_796++;
                           Sleep(2000);
                        }
                        OrderModify(l_ticket_20, OrderOpenPrice(), OrderOpenPrice() + li_0 * gd_808, OrderTakeProfit(), OrderExpiration(), MediumVioletRed);
                        if (OrderSelect(l_ticket_20, SELECT_BY_TICKET, MODE_TRADES)) {
                           Print("Initial SL is Set for Short Entry");
                           pop("Initial SL is Set for Short Entry on " + Symbol(), "C:\\");
                           li_28 = TRUE;
                           Sleep(2000);
                        } else Print("Error 8605 - Error setting initial SL for Short Entry");
                     } else {
                        if (li_4 > 0 && OrderTakeProfit() == 0.0) {
                           g_count_796 = 0;
                           while (g_count_796 < 5 && !IsTradeAllowed()) {
                              g_count_796++;
                              Sleep(2000);
                           }
                           OrderModify(l_ticket_20, OrderOpenPrice(), OrderStopLoss(), OrderOpenPrice() - li_4 * gd_808, OrderExpiration(), MediumVioletRed);
                           if (OrderSelect(l_ticket_20, SELECT_BY_TICKET, MODE_TRADES)) {
                              Print("Initial TP is Set for Short Entry");
                              pop("Initial TP is Set for Short Entry on " + Symbol(), "C:\\");
                              li_28 = TRUE;
                              Sleep(2000);
                           } else Print("Error 8606 - Error setting initial TP for Short Entry");
                        }
                     }
                  }
               }
            }
         }
      }
      if (OrderSymbol() == Symbol() && li_28 && Handle.All.Stops.Manually) {
         l_ord_stoploss_32 = OrderStopLoss();
         l_ord_takeprofit_40 = OrderTakeProfit();
         if (l_ord_stoploss_32 > 0.0) {
            if (ObjectFind(OrderTicket() + "_" + "SL") < 0) {
               ObjectCreate(OrderTicket() + "_" + "SL", OBJ_HLINE, 0, Time[0], l_ord_stoploss_32);
               ObjectSet(OrderTicket() + "_" + "SL", OBJPROP_COLOR, SandyBrown);
               ObjectSet(OrderTicket() + "_" + "SL", OBJPROP_WIDTH, 0);
               ObjectSet(OrderTicket() + "_" + "SL", OBJPROP_STYLE, STYLE_DASH);
               if (ObjectFind(OrderTicket() + "_" + "SL_txt") < 0) {
                  ObjectCreate(OrderTicket() + "_" + "SL_txt", OBJ_TEXT, 0, 0, 0);
                  if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) {
                     if (OrderType() == OP_BUY) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - BUY Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "   STOP LOSS LEVEL", 7, "Arial", Orange);
                     if (OrderType() == OP_BUYLIMIT) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - BUY LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "   STOP LOSS LEVEL", 7, "Arial", Orange);
                     if (OrderType() == OP_BUYSTOP) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - BUY STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "   STOP LOSS LEVEL", 7, "Arial", Orange);
                  } else {
                     if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) {
                        if (OrderType() == OP_SELL) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - SELL Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  STOP LOSS LEVEL", 7, "Arial", Orange);
                        if (OrderType() == OP_SELLLIMIT) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - SELL LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  STOP LOSS LEVEL", 7, "Arial", Orange);
                        if (OrderType() == OP_SELLSTOP) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - SELL STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  STOP LOSS LEVEL", 7, "Arial", Orange);
                     }
                  }
               }
            }
         }
         if (l_ord_takeprofit_40 > 0.0) {
            if (ObjectFind(OrderTicket() + "_" + "TP") < 0) {
               ObjectCreate(OrderTicket() + "_" + "TP", OBJ_HLINE, 0, Time[0], l_ord_takeprofit_40);
               ObjectSet(OrderTicket() + "_" + "TP", OBJPROP_COLOR, SpringGreen);
               ObjectSet(OrderTicket() + "_" + "TP", OBJPROP_WIDTH, 0);
               ObjectSet(OrderTicket() + "_" + "TP", OBJPROP_STYLE, STYLE_DASH);
               if (ObjectFind(OrderTicket() + "_" + "TP_txt") < 0) {
                  ObjectCreate(OrderTicket() + "_" + "TP_txt", OBJ_TEXT, 0, 0, 0);
                  if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) {
                     if (OrderType() == OP_BUY) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - BUY Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                     if (OrderType() == OP_BUYLIMIT) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - BUY LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                     if (OrderType() == OP_BUYSTOP) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - BUY STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                  } else {
                     if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) {
                        if (OrderType() == OP_SELL) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - SELL Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                        if (OrderType() == OP_SELLLIMIT) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - SELL LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                        if (OrderType() == OP_SELLSTOP) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - SELL STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                     }
                  }
               }
            }
         }
         if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) ObjectMove(OrderTicket() + "_" + "TP_txt", 0, Time[30], l_ord_takeprofit_40 + 4.0 * Point);
         else
            if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) ObjectMove(OrderTicket() + "_" + "TP_txt", 0, Time[30], l_ord_takeprofit_40 - 2.0 * Point);
         if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) ObjectMove(OrderTicket() + "_" + "SL_txt", 0, Time[30], l_ord_stoploss_32 - 2.0 * Point);
         else
            if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) ObjectMove(OrderTicket() + "_" + "SL_txt", 0, Time[30], l_ord_stoploss_32 + 4.0 * Point);
      }
   }
}

void DesAnMetakinhseStoxous() {
   int l_ticket_4;
   double l_price_8;
   double l_price_16;
   double l_price_24;
   double l_price_32;
   RefreshRates();
   for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
      OrderSelect(l_pos_0, SELECT_BY_POS);
      l_ticket_4 = OrderTicket();
      if (OrderSymbol() == Symbol()) {
         RefreshRates();
         g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
         gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
         gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
         g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
         g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
         gd_808 = SetPoint();
         l_price_8 = NormalizeDouble(OrderStopLoss(), g_digits_536);
         l_price_16 = NormalizeDouble(OrderTakeProfit(), g_digits_536);
         l_price_24 = NormalizeDouble(ObjectGet(OrderTicket() + "_" + "SL", OBJPROP_PRICE1), g_digits_536);
         l_price_32 = NormalizeDouble(ObjectGet(OrderTicket() + "_" + "TP", OBJPROP_PRICE1), g_digits_536);
         if (l_price_8 != l_price_24 && l_price_24 != 0.0) {
            RefreshRates();
            while (g_count_796 < 5 && !IsTradeAllowed()) {
               g_count_796++;
               Sleep(2000);
            }
            OrderModify(OrderTicket(), OrderOpenPrice(), l_price_24, OrderTakeProfit(), OrderExpiration(), LimeGreen);
            Sleep(1000);
            OrderSelect(l_ticket_4, SELECT_BY_TICKET);
         }
         if (l_price_16 != l_price_32 && l_price_32 != 0.0) {
            RefreshRates();
            while (g_count_796 < 5 && !IsTradeAllowed()) {
               g_count_796++;
               Sleep(2000);
            }
            OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), l_price_32, OrderExpiration(), LimeGreen);
            Sleep(1000);
            OrderSelect(l_ticket_4, SELECT_BY_TICKET);
         }
         if (l_price_24 <= 0.0) {
            if (ObjectFind(OrderTicket() + "_" + "SL") < 0) {
               ObjectCreate(OrderTicket() + "_" + "SL", OBJ_HLINE, 0, Time[0], l_price_8);
               ObjectSet(OrderTicket() + "_" + "SL", OBJPROP_COLOR, SandyBrown);
               ObjectSet(OrderTicket() + "_" + "SL", OBJPROP_WIDTH, 0);
               ObjectSet(OrderTicket() + "_" + "SL", OBJPROP_STYLE, STYLE_DASH);
            }
         }
         if (l_price_32 <= 0.0) {
            if (ObjectFind(OrderTicket() + "_" + "TP") < 0) {
               ObjectCreate(OrderTicket() + "_" + "TP", OBJ_HLINE, 0, Time[0], l_price_16);
               ObjectSet(OrderTicket() + "_" + "TP", OBJPROP_COLOR, SpringGreen);
               ObjectSet(OrderTicket() + "_" + "TP", OBJPROP_WIDTH, 0);
               ObjectSet(OrderTicket() + "_" + "TP", OBJPROP_STYLE, STYLE_DASH);
            }
         }
         if (ObjectFind(OrderTicket() + "_" + "SL_txt") < 0) {
            ObjectCreate(OrderTicket() + "_" + "SL_txt", OBJ_TEXT, 0, 0, 0);
            if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) {
               if (OrderType() == OP_BUY) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - BUY Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "   STOP LOSS LEVEL", 7, "Arial", Orange);
               if (OrderType() == OP_BUYLIMIT) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - BUY LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "   STOP LOSS LEVEL", 7, "Arial", Orange);
               if (OrderType() == OP_BUYSTOP) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - BUY STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "   STOP LOSS LEVEL", 7, "Arial", Orange);
            } else {
               if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) {
                  if (OrderType() == OP_SELL) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - SELL Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  STOP LOSS LEVEL", 7, "Arial", Orange);
                  if (OrderType() == OP_SELLLIMIT) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - SELL LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  STOP LOSS LEVEL", 7, "Arial", Orange);
                  if (OrderType() == OP_SELLSTOP) ObjectSetText(OrderTicket() + "_" + "SL_txt", "Ticket " + OrderTicket() + " - SELL STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  STOP LOSS LEVEL", 7, "Arial", Orange);
               }
            }
         }
         if (ObjectFind(OrderTicket() + "_" + "TP_txt") < 0) {
            ObjectCreate(OrderTicket() + "_" + "TP_txt", OBJ_TEXT, 0, 0, 0);
            if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) {
               if (OrderType() == OP_BUY) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - BUY Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
               if (OrderType() == OP_BUYLIMIT) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - BUY LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
               if (OrderType() == OP_BUYSTOP) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - BUY STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
            } else {
               if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) {
                  if (OrderType() == OP_SELL) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - SELL Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                  if (OrderType() == OP_SELLLIMIT) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - SELL LIMIT Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
                  if (OrderType() == OP_SELLSTOP) ObjectSetText(OrderTicket() + "_" + "TP_txt", "Ticket " + OrderTicket() + " - SELL STOP Entry @ " + DoubleToStr(OrderOpenPrice(), g_digits_536) + "  TAKE PROFIT LEVEL", 7, "Arial", MediumSeaGreen);
               }
            }
         }
         if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) ObjectMove(OrderTicket() + "_" + "TP_txt", 0, Time[30], l_price_16 + 4.0 * Point);
         else
            if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) ObjectMove(OrderTicket() + "_" + "TP_txt", 0, Time[30], l_price_16 - 2.0 * Point);
         if (OrderType() == OP_BUY || OrderType() == OP_BUYLIMIT || OrderType() == OP_BUYSTOP) ObjectMove(OrderTicket() + "_" + "SL_txt", 0, Time[30], l_price_8 - 2.0 * Point);
         else
            if (OrderType() == OP_SELL || OrderType() == OP_SELLLIMIT || OrderType() == OP_SELLSTOP) ObjectMove(OrderTicket() + "_" + "SL_txt", 0, Time[30], l_price_8 + 4.0 * Point);
      }
   }
}

void Afairese_Grammes_Entolon() {
   string l_name_32;
   int li_unused_0 = 0;
   int li_unused_4 = 0;
   RefreshRates();
   for (int l_pos_24 = OrdersHistoryTotal() - 1; l_pos_24 >= 0; l_pos_24--) {
      OrderSelect(l_pos_24, SELECT_BY_POS, MODE_HISTORY);
      if (OrderSymbol() == Symbol()) {
         ObjectDelete(OrderTicket() + "_" + "SL");
         ObjectDelete(OrderTicket() + "_" + "SL_txt");
         ObjectDelete(OrderTicket() + "_" + "TP");
         ObjectDelete(OrderTicket() + "_" + "TP_txt");
      }
      for (int li_28 = ObjectsTotal() - 1; li_28 >= 0; li_28--) {
         l_name_32 = ObjectName(li_28);
         if (ObjectType(l_name_32) == 22) {
            if (StringFind(l_name_32, DoubleToStr(OrderTicket(), 0), 0) != -1) {
               ObjectDelete(l_name_32);
               break;
            }
         }
      }
   }
}

void DeleteObjects() {
   g_datetime_732 = TimeCurrent();
   int li_unused_0 = g_datetime_732;
   ObjectDelete("MainMessage");
   ObjectDelete("MainMessage1");
   ObjectDelete("MainMessage2");
   ObjectDelete("MainMessage3");
   ObjectDelete("MainMessage4");
   ObjectDelete("MainMessage5");
   ObjectDelete("Yannis");
   ObjectDelete("BoxBreakout");
   ObjectDelete("Bar");
   ObjectDelete("Broker");
   ObjectDelete("BrokerN");
   ObjectDelete("Broker1");
   ObjectDelete("Sydney");
   ObjectDelete("Tokyo");
   ObjectDelete("London");
   ObjectDelete("NewYork");
   ObjectDelete("MyNTZ1");
   ObjectDelete("MyNTZ2");
   ObjectDelete("Yannis");
   ObjectDelete("Sep0");
   ObjectDelete("Sep1");
   ObjectDelete("MT");
   ObjectDelete("DT");
   ObjectDelete("FT");
   ObjectDelete("OU");
   ObjectDelete("ST");
   ObjectDelete("TT");
   ObjectDelete("Numbers");
   ObjectDelete("SSignalMACDM1t");
   ObjectDelete("SSignalMACDM1");
   ObjectDelete("SSignalMACDM5");
   ObjectDelete("SSignalMACDM15");
   ObjectDelete("SSignalMACDM30");
   ObjectDelete("SSignalMACDH1");
   ObjectDelete("SSignalMACDH4");
   ObjectDelete("SSignalMACDD1");
   ObjectDelete("MarketsH");
   ObjectDelete("Sydney");
   ObjectDelete("Tokyo");
   ObjectDelete("London");
   ObjectDelete("NewYork");
   ObjectDelete("DispLBO2");
   ObjectDelete("ValLBO2");
   ObjectDelete("DispLBO1");
   ObjectDelete("ValLBO1");
   ObjectDelete("DispSBO1");
   ObjectDelete("ValSBO1");
   ObjectDelete("DispSBO2");
   ObjectDelete("ValSBO2");
   ObjectDelete("Line1");
   ObjectDelete("BrokerN");
   ObjectDelete("gmt");
   ObjectDelete("Broker");
   ObjectDelete("BrokerTime");
   ObjectDelete("Line2");
   ObjectDelete("Broker2");
   ObjectDelete("BrokerTime2");
   ObjectDelete("Line3");
   ObjectDelete("Bar");
   ObjectDelete("BarT");
   ObjectDelete("Spread");
   ObjectDelete("sSpread");
   ObjectDelete("sSpread0");
   ObjectDelete("sSpread11");
   ObjectDelete("sSpread12");
   ObjectDelete("sSpread121");
   ObjectDelete("sSpread122");
   ObjectDelete("sSpread123");
   ObjectDelete("sSpread124");
   ObjectDelete("Yannis2");
   ObjectDelete("Yannis5");
   ObjectDelete("Yannis4");
   ObjectDelete("Yannis45");
   ObjectDelete("Yannis");
   for (int l_pos_4 = OrdersHistoryTotal() - 1; l_pos_4 >= 0; l_pos_4--) {
      OrderSelect(l_pos_4, SELECT_BY_POS, MODE_HISTORY);
      if (OrderSymbol() == Symbol() && OrderOpenTime() >= g_datetime_644 && OrderMagicNumber() == 0) {
         ObjectDelete("Long Entry: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("Short Entry: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("LongT: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("ShortT: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("Long EntryC: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("Short EntryC: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("PlusOrMinus" + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("PlusOrMinus2" + DoubleToStr(OrderTicket(), 0));
      }
   }
   ObjectDelete("Restrictions");
   ObjectDelete("Restrictions2");
   ObjectDelete("sSSignalMACD1");
   ObjectDelete("sSSignalMACD2");
   ObjectDelete("sSSignalMACD3");
   ObjectDelete("sSSignalMACD4");
   ObjectDelete("sPWR");
   ObjectDelete("iPWR");
   ObjectDelete("sCWR");
   ObjectDelete("iCWR");
   ObjectDelete("sYR");
   ObjectDelete("iYR");
   ObjectDelete("sTR");
   ObjectDelete("iTR");
   ObjectDelete("sBR");
   ObjectDelete("sBR5");
   ObjectDelete("iBR");
   ObjectDelete("sExp");
   ObjectDelete("iExp");
   ObjectDelete("sPL");
   ObjectDelete("iPL");
   ObjectDelete("iPL2");
   ObjectDelete("iPL20");
   ObjectDelete("sPL2");
   ObjectDelete("iPL2");
}

void Emfan_Leptomeries() {
   int li_unused_56;
   int li_unused_60;
   int li_unused_64;
   int li_unused_68;
   int li_unused_72;
   int li_unused_76;
   int li_unused_80;
   color l_color_120;
   string l_text_132;
   string l_text_140;
   double ld_148;
   int li_156;
   int li_160;
   string ls_168;
   string ls_176;
   double ld_184;
   double ld_unused_192;
   string l_dbl2str_200;
   string ls_208;
   string ls_216;
   string l_text_224;
   string l_text_232;
   string l_text_240;
   string ls_unused_248;
   double ld_256;
   int li_unused_320;
   int li_324;
   int l_x_328;
   int l_x_332;
   int l_y_336;
   double l_ihigh_340;
   double l_ilow_348;
   int l_x_356;
   int l_y_360;
   color l_color_364;
   double ld_372;
   double ld_380;
   double ld_388;
   double ld_396;
   double ld_404;
   double ld_412;
   double ld_420;
   double ld_428;
   double ld_436;
   double ld_444;
   double ld_452;
   double ld_460;
   double ld_468;
   double ld_476;
   double ld_484;
   double ld_492;
   double ld_500;
   double ld_508;
   double ld_516;
   double ld_524;
   double ld_532;
   double ld_540;
   double ld_548;
   double ld_556;
   double ld_564;
   double ld_572;
   double ld_580;
   double ld_588;
   string l_text_596;
   RefreshRates();
   g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
   gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
   g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
   g_bid_508 = MarketInfo(Symbol(), MODE_BID);
   gd_808 = SetPoint();
   YannisCustomText("Yannis4", 17, 15, 1);
   ObjectSetText("Yannis4", "Artemis Sitter PRO © v1.80 ", 9, "Tahoma", DarkOrange);
   YannisCustomText("Yannis", 17, 30, 1);
   ObjectSetText("Yannis", g_text_316, 9, "Tahoma", DarkOrange);
   YannisCustomText("Yannis5", 17, 45, 1);
   ObjectSetText("Yannis5", g_text_324, 9, "Comic Sans MS", DarkOrange);
  // YannisCustomText("Yannis45", 5, 15, 2);
  // ObjectSetText("Yannis45", "Exp : " + g_str_concat_716, 9, "Tahoma", DarkOrange);
   string ls_unused_0 = "";
   string ls_unused_8 = "";
   string ls_unused_16 = "";
   string l_text_24 = "";
   string l_text_32 = "";
   string l_text_40 = "";
   string l_text_48 = "";
   if (gs_912 == "Long") {
      l_text_24 = "-";
      li_unused_68 = 65280;
   } else {
      if (gs_912 == "Short") {
         l_text_24 = "-";
         li_unused_68 = 255;
      } else {
         l_text_24 = "-";
         li_unused_68 = 3618615;
      }
   }
   if (gs_920 == "Long") {
      l_text_32 = "-";
      li_unused_72 = 65280;
   } else {
      if (gs_920 == "Short") {
         l_text_32 = "-";
         li_unused_72 = 255;
      } else {
         l_text_32 = "-";
         li_unused_72 = 3618615;
      }
   }
   if (gs_936 == "Long") {
      l_text_40 = "-";
      li_unused_76 = 65280;
   } else {
      if (gs_936 == "Short") {
         l_text_40 = "-";
         li_unused_76 = 255;
      } else {
         l_text_40 = "-";
         li_unused_76 = 3618615;
      }
   }
   if (gs_944 == "Long") {
      l_text_48 = "-";
      li_unused_80 = 65280;
   } else {
      if (gs_944 == "Short") {
         l_text_48 = "-";
         li_unused_80 = 255;
      } else {
         l_text_48 = "-";
         li_unused_80 = 3618615;
      }
   }
   if (gs_952 == "Long") {
      ls_unused_8 = "-";
      li_unused_60 = 65280;
   } else {
      if (gs_952 == "Short") {
         ls_unused_8 = "-";
         li_unused_60 = 255;
      } else {
         ls_unused_8 = "-";
         li_unused_60 = 3618615;
      }
   }
   if (gs_928 == "Long") {
      ls_unused_16 = "-";
      li_unused_64 = 65280;
   } else {
      if (gs_928 == "Short") {
         ls_unused_16 = "-";
         li_unused_64 = 255;
      } else {
         ls_unused_16 = "-";
         li_unused_64 = 14474460;
      }
   }
   if (gs_960 == "Long") {
      ls_unused_0 = "-";
      li_unused_56 = 65280;
   } else {
      if (gs_960 == "Short") {
         ls_unused_0 = "-";
         li_unused_56 = 255;
      } else {
         ls_unused_0 = "-";
         li_unused_56 = 3618615;
      }
   }
   if (g_corner_608 == 1) {
   }
   if (g_corner_608 == 0) {
   }
   int li_84 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + SydneyStart) + 3600 * gi_552;
   int li_88 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + SydneyEnd) + 3600 * gi_552;
   int li_92 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + TokyoStart) + 3600 * gi_552;
   int li_96 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + TokyoEnd) + 3600 * gi_552;
   int li_100 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + LondonStart) + 3600 * gi_552;
   int li_104 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + LondonEnd) + 3600 * gi_552;
   int li_108 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + NewYorkStart) + 3600 * gi_552;
   int li_112 = StrToTime(TimeToStr(g_datetime_644, TIME_DATE) + " " + NewYorkEnd) + 3600 * gi_552;
   int l_datetime_116 = g_datetime_648;
   if (li_84 > li_88) {
      if (l_datetime_116 >= li_84 || l_datetime_116 <= li_88) gs_692 = "Sydney Open";
      else gs_692 = "Sydney Closed";
   } else {
      if (l_datetime_116 >= li_84 && l_datetime_116 <= li_88) gs_692 = "Sydney Open";
      else gs_692 = "Sydney Closed";
   }
   if (li_92 > li_96) {
      if (l_datetime_116 >= li_92 || l_datetime_116 <= li_96) gs_684 = "Tokyo Open";
      else gs_684 = "Tokyo Closed";
   } else {
      if (l_datetime_116 >= li_92 && l_datetime_116 <= li_96) gs_684 = "Tokyo Open";
      else gs_684 = "Tokyo Closed";
   }
   if (li_100 > li_104) {
      if (l_datetime_116 >= li_100 || l_datetime_116 <= li_104) gs_668 = "London Open";
      else gs_668 = "London Closed";
   } else {
      if (l_datetime_116 >= li_100 && l_datetime_116 <= li_104) gs_668 = "London Open";
      else gs_668 = "London Closed";
   }
   if (li_108 > li_112) {
      if (l_datetime_116 >= li_108 || l_datetime_116 <= li_112) gs_676 = "NewYork Open";
      else gs_676 = "NewYork Closed";
   } else {
      if (l_datetime_116 >= li_108 && l_datetime_116 <= li_112) gs_676 = "NewYork Open";
      else gs_676 = "NewYork Closed";
   }
   if (g_corner_608 == 1) {
      ObjectCreate("MarketsH", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("MarketsH", "   Syd  Tok  Lon  NY", 12, "Times New Roman", g_color_632);
      ObjectSet("MarketsH", OBJPROP_CORNER, g_corner_608);
      ObjectSet("MarketsH", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("MarketsH", OBJPROP_YDISTANCE, gi_624 + 50);
   }
   if (g_corner_608 == 0) {
      ObjectCreate("MarketsH", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("MarketsH", "   Syd  Tok  Lon  NY", 12, "Times New Roman", g_color_632);
      ObjectSet("MarketsH", OBJPROP_CORNER, g_corner_608);
      ObjectSet("MarketsH", OBJPROP_XDISTANCE, gi_628 + 15);
      ObjectSet("MarketsH", OBJPROP_YDISTANCE, gi_624 + 50);
   }
   if (gs_692 == "Sydney Open") l_color_120 = Lime;
   else l_color_120 = Red;
   ObjectCreate("Sydney", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Sydney", l_text_24, 45, "Arial", l_color_120);
   ObjectSet("Sydney", OBJPROP_CORNER, g_corner_608);
   ObjectSet("Sydney", OBJPROP_XDISTANCE, gi_628 + 98);
   ObjectSet("Sydney", OBJPROP_YDISTANCE, gi_624 + 35);
   if (gs_684 == "Tokyo Open") l_color_120 = Lime;
   else l_color_120 = Red;
   ObjectCreate("Tokyo", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Tokyo", l_text_32, 45, "Arial", l_color_120);
   ObjectSet("Tokyo", OBJPROP_CORNER, g_corner_608);
   ObjectSet("Tokyo", OBJPROP_XDISTANCE, gi_628 + 66);
   ObjectSet("Tokyo", OBJPROP_YDISTANCE, gi_624 + 35);
   if (gs_668 == "London Open") l_color_120 = Lime;
   else l_color_120 = Red;
   ObjectCreate("London", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("London", l_text_40, 45, "Arial", l_color_120);
   ObjectSet("London", OBJPROP_CORNER, g_corner_608);
   ObjectSet("London", OBJPROP_XDISTANCE, gi_628 + 35);
   ObjectSet("London", OBJPROP_YDISTANCE, gi_624 + 35);
   if (gs_676 == "NewYork Open") l_color_120 = Lime;
   else l_color_120 = Red;
   ObjectCreate("NewYork", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("NewYork", l_text_48, 45, "Arial", l_color_120);
   ObjectSet("NewYork", OBJPROP_CORNER, g_corner_608);
   ObjectSet("NewYork", OBJPROP_XDISTANCE, gi_628 + 3);
   ObjectSet("NewYork", OBJPROP_YDISTANCE, gi_624 + 35);
   ObjectCreate("BrokerN", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("BrokerN", TerminalCompany(), 8, "Tahoma", DarkOrange);
   ObjectSet("BrokerN", OBJPROP_CORNER, g_corner_608);
   ObjectSet("BrokerN", OBJPROP_XDISTANCE, gi_628 + 0);
   ObjectSet("BrokerN", OBJPROP_YDISTANCE, gi_624 + 80);
   ObjectCreate("gmt", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("gmt", "TimeShift GMT +" + DoubleToStr(gi_552, 0), 8, "Tahoma", DarkOrange);
   ObjectSet("gmt", OBJPROP_CORNER, g_corner_608);
   ObjectSet("gmt", OBJPROP_XDISTANCE, gi_628 + 0);
   ObjectSet("gmt", OBJPROP_YDISTANCE, gi_624 + 90);
   int li_124 = 90;
   int li_128 = 15;
   if (Show.Broker.Time) {
      l_text_132 = OraDiakomisth(Hour(), Minute());
      l_text_140 = OraDiakomisth(TimeHour(TimeLocal()), TimeMinute(TimeLocal()));
      ObjectCreate("Broker", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Broker", "Broker\'s Time", 9, "Arial", IndianRed);
      ObjectSet("Broker", OBJPROP_CORNER, g_corner_608);
      ObjectSet("Broker", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("Broker", OBJPROP_YDISTANCE, li_124 + li_128 + gi_624);
      ObjectCreate("BrokerTime", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("BrokerTime", l_text_132, 10, "Arial", OrangeRed);
      ObjectSet("BrokerTime", OBJPROP_CORNER, g_corner_608);
      ObjectSet("BrokerTime", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("BrokerTime", OBJPROP_YDISTANCE, li_124 + li_128 + 13 + gi_624);
      ObjectCreate("Broker2", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Broker2", "Local Time", 9, "Arial", LimeGreen);
      ObjectSet("Broker2", OBJPROP_CORNER, g_corner_608);
      ObjectSet("Broker2", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("Broker2", OBJPROP_YDISTANCE, li_124 + li_128 + 30 + gi_624);
      ObjectCreate("BrokerTime2", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("BrokerTime2", l_text_140, 10, "Arial", LimeGreen);
      ObjectSet("BrokerTime2", OBJPROP_CORNER, g_corner_608);
      ObjectSet("BrokerTime2", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("BrokerTime2", OBJPROP_YDISTANCE, li_124 + li_128 + 42 + gi_624);
      li_124 = 155;
      li_128 = 14;
   }
   if (Show.Bar.Close.Time) {
      li_156 = Time[0] + 60 * Period() - TimeCurrent();
      ld_148 = li_156 / 60.0;
      li_160 = li_156 % 60;
      li_156 = (li_156 - li_156 % 60) / 60;
      ObjectCreate("Bar", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("Bar", "Bar Time to Close", 10, "Arial", IndianRed);
      ObjectSet("Bar", OBJPROP_CORNER, g_corner_608);
      ObjectSet("Bar", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("Bar", OBJPROP_YDISTANCE, li_124 + li_128 + gi_624);
      if (li_156 >= 0 && li_156 <= 9) ls_168 = "0";
      else ls_168 = "";
      if (li_160 >= 0 && li_160 <= 9) ls_176 = "0";
      else ls_176 = "";
      ObjectCreate("BarT", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("BarT", ls_168 + li_156 + ":" + ls_176 + li_160, 14, "Arial", OrangeRed);
      ObjectSet("BarT", OBJPROP_CORNER, g_corner_608);
      ObjectSet("BarT", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("BarT", OBJPROP_YDISTANCE, li_124 + li_128 + 15 + gi_624);
      li_128 = 25;
      if (Show.Broker.Time) li_124 = 190;
      else li_124 = 130;
   }
   if (Show.Spread) {
      RefreshRates();
      ObjectCreate("sSpread0", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sSpread0", Symbol(), 12, "Comic Sans MS", MediumPurple);
      ObjectSet("sSpread0", OBJPROP_CORNER, g_corner_608);
      ObjectSet("sSpread0", OBJPROP_XDISTANCE, gi_628 + 0);
      ObjectSet("sSpread0", OBJPROP_YDISTANCE, li_124 + li_128 + gi_624);
      li_124 += 17;
      ObjectCreate("sSpread", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sSpread", "Spread", 10, "Comic Sans MS", MediumPurple);
      ObjectSet("sSpread", OBJPROP_CORNER, g_corner_608);
      ObjectSet("sSpread", OBJPROP_XDISTANCE, gi_628 + 10);
      ObjectSet("sSpread", OBJPROP_YDISTANCE, li_124 + li_128 + gi_624);
      ld_184 = (g_ask_500 - g_bid_508) / gd_808;
      ld_unused_192 = NormalizeDouble(g_bid_508, g_digits_536);
      ObjectCreate("sSpread11", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sSpread11", DoubleToStr(ld_184, 1), 14, "Comic Sans MS", Plum);
      ObjectSet("sSpread11", OBJPROP_CORNER, g_corner_608);
      ObjectSet("sSpread11", OBJPROP_XDISTANCE, gi_628 + 10);
      ObjectSet("sSpread11", OBJPROP_YDISTANCE, li_124 + li_128 + 15 + gi_624);
      if (g_digits_536 == 2) li_unused_320 = 0;
      else {
         if (g_digits_536 == 3) li_unused_320 = 1;
         else {
            if (g_digits_536 == 4) li_unused_320 = 2;
            else
               if (g_digits_536 == 5) li_unused_320 = 3;
         }
      }
      if (g_digits_536 == 5) ld_256 = 100000.0 * (g_bid_508 / 100000.0);
      else {
         if (g_digits_536 == 4) ld_256 = 10000.0 * (g_bid_508 / 10000.0);
         else {
            if (g_digits_536 == 3) ld_256 = 1000.0 * (g_bid_508 / 1000.0);
            else
               if (g_digits_536 == 2) ld_256 = 100.0 * (g_bid_508 / 100.0);
         }
      }
      l_dbl2str_200 = DoubleToStr(ld_256, g_digits_536);
      li_324 = StringFind(l_dbl2str_200, ".", 0);
      ls_208 = StringSubstr(l_dbl2str_200, 0, li_324);
      ls_216 = StringSubstr(l_dbl2str_200, li_324 + 1, StringLen(l_dbl2str_200) - 2);
      if (g_digits_536 == 2) {
         l_text_224 = ls_216;
         ObjectCreate("sSpread12", OBJ_LABEL, 0, 0, 0);
         ObjectSetText("sSpread12", ls_208 + ".", 16, "Tahoma", IndianRed);
         ObjectSet("sSpread12", OBJPROP_CORNER, g_corner_608);
         ObjectSet("sSpread12", OBJPROP_XDISTANCE, gi_628 + 35);
         ObjectSet("sSpread12", OBJPROP_YDISTANCE, li_124 + li_128 + 40 + gi_624);
         ObjectCreate("sSpread121", OBJ_LABEL, 0, 0, 0);
         ObjectSetText("sSpread121", l_text_224, 20, "Tahoma", OrangeRed);
         ObjectSet("sSpread121", OBJPROP_CORNER, g_corner_608);
         ObjectSet("sSpread121", OBJPROP_XDISTANCE, gi_628 + 8);
         ObjectSet("sSpread121", OBJPROP_YDISTANCE, li_124 + li_128 + 35 + gi_624);
      } else {
         if (g_digits_536 == 3) {
            l_text_224 = StringSubstr(ls_216, 0, 2);
            l_text_232 = StringSubstr(ls_216, 2, 1);
            ObjectCreate("sSpread12", OBJ_LABEL, 0, 0, 0);
            ObjectSetText("sSpread12", ls_208 + ".", 16, "Tahoma", IndianRed);
            ObjectSet("sSpread12", OBJPROP_CORNER, g_corner_608);
            ObjectSet("sSpread12", OBJPROP_XDISTANCE, gi_628 + 35);
            ObjectSet("sSpread12", OBJPROP_YDISTANCE, li_124 + li_128 + 40 + gi_624);
            ObjectCreate("sSpread122", OBJ_LABEL, 0, 0, 0);
            ObjectSetText("sSpread122", l_text_224, 20, "Tahoma", OrangeRed);
            ObjectSet("sSpread122", OBJPROP_CORNER, g_corner_608);
            ObjectSet("sSpread122", OBJPROP_XDISTANCE, gi_628 + 8);
            ObjectSet("sSpread122", OBJPROP_YDISTANCE, li_124 + li_128 + 35 + gi_624);
            ObjectCreate("sSpread121", OBJ_LABEL, 0, 0, 0);
            ObjectSetText("sSpread121", l_text_232, 10, "Tahoma", OrangeRed);
            ObjectSet("sSpread121", OBJPROP_CORNER, g_corner_608);
            ObjectSet("sSpread121", OBJPROP_XDISTANCE, gi_628 + 0);
            ObjectSet("sSpread121", OBJPROP_YDISTANCE, li_124 + li_128 + 48 + gi_624);
         } else {
            if (g_digits_536 == 4) {
               l_text_224 = StringSubstr(ls_216, 0, 2);
               l_text_232 = StringSubstr(ls_216, 2, 2);
               ObjectCreate("sSpread12", OBJ_LABEL, 0, 0, 0);
               ObjectSetText("sSpread12", ls_208 + ".", 16, "Tahoma", IndianRed);
               ObjectSet("sSpread12", OBJPROP_CORNER, g_corner_608);
               ObjectSet("sSpread12", OBJPROP_XDISTANCE, gi_628 + 53);
               ObjectSet("sSpread12", OBJPROP_YDISTANCE, li_124 + li_128 + 40 + gi_624);
               ObjectCreate("sSpread121", OBJ_LABEL, 0, 0, 0);
               ObjectSetText("sSpread121", l_text_224, 16, "Tahoma", IndianRed);
               ObjectSet("sSpread121", OBJPROP_CORNER, g_corner_608);
               ObjectSet("sSpread121", OBJPROP_XDISTANCE, gi_628 + 29);
               ObjectSet("sSpread121", OBJPROP_YDISTANCE, li_124 + li_128 + 40 + gi_624);
               ObjectCreate("sSpread122", OBJ_LABEL, 0, 0, 0);
               ObjectSetText("sSpread122", l_text_232, 20, "Tahoma", OrangeRed);
               ObjectSet("sSpread122", OBJPROP_CORNER, g_corner_608);
               ObjectSet("sSpread122", OBJPROP_XDISTANCE, gi_628 + 0);
               ObjectSet("sSpread122", OBJPROP_YDISTANCE, li_124 + li_128 + 35 + gi_624);
            } else {
               if (g_digits_536 == 5) {
                  l_text_224 = StringSubstr(ls_216, 0, 2);
                  l_text_232 = StringSubstr(ls_216, 2, 2);
                  l_text_240 = StringSubstr(ls_216, 4, 1);
                  ObjectCreate("sSpread12", OBJ_LABEL, 0, 0, 0);
                  ObjectSetText("sSpread12", ls_208 + ".", 16, "Tahoma", IndianRed);
                  ObjectSet("sSpread12", OBJPROP_CORNER, g_corner_608);
                  ObjectSet("sSpread12", OBJPROP_XDISTANCE, gi_628 + 63);
                  ObjectSet("sSpread12", OBJPROP_YDISTANCE, li_124 + li_128 + 40 + gi_624);
                  ObjectCreate("sSpread121", OBJ_LABEL, 0, 0, 0);
                  ObjectSetText("sSpread121", l_text_224, 16, "Tahoma", IndianRed);
                  ObjectSet("sSpread121", OBJPROP_CORNER, g_corner_608);
                  ObjectSet("sSpread121", OBJPROP_XDISTANCE, gi_628 + 40);
                  ObjectSet("sSpread121", OBJPROP_YDISTANCE, li_124 + li_128 + 40 + gi_624);
                  ObjectCreate("sSpread122", OBJ_LABEL, 0, 0, 0);
                  ObjectSetText("sSpread122", l_text_232, 20, "Tahoma", OrangeRed);
                  ObjectSet("sSpread122", OBJPROP_CORNER, g_corner_608);
                  ObjectSet("sSpread122", OBJPROP_XDISTANCE, gi_628 + 10);
                  ObjectSet("sSpread122", OBJPROP_YDISTANCE, li_124 + li_128 + 35 + gi_624);
                  ObjectCreate("sSpread123", OBJ_LABEL, 0, 0, 0);
                  ObjectSetText("sSpread123", l_text_240, 10, "Tahoma", OrangeRed);
                  ObjectSet("sSpread123", OBJPROP_CORNER, g_corner_608);
                  ObjectSet("sSpread123", OBJPROP_XDISTANCE, gi_628 + 0);
                  ObjectSet("sSpread123", OBJPROP_YDISTANCE, li_124 + li_128 + 48 + gi_624);
               }
            }
         }
      }
   }
   if (Show.Ranges) {
      l_x_328 = (iHigh(NULL, PERIOD_W1, 1) - iLow(NULL, PERIOD_W1, 1)) / gd_808;
      l_x_332 = (iHigh(NULL, PERIOD_W1, 0) - iLow(NULL, PERIOD_W1, 0)) / gd_808;
      if (TimeDayOfWeek(iTime(NULL, PERIOD_D1, 1)) == 0) {
         l_ihigh_340 = MathMax(iHigh(NULL, PERIOD_D1, 1), iHigh(NULL, PERIOD_D1, 2));
         l_ilow_348 = MathMin(iLow(NULL, PERIOD_D1, 1), iLow(NULL, PERIOD_D1, 2));
         l_y_336 = (l_ihigh_340 - l_ilow_348) / gd_808;
      } else {
         l_ihigh_340 = iHigh(NULL, PERIOD_D1, 1);
         l_ilow_348 = iLow(NULL, PERIOD_D1, 1);
         l_y_336 = (l_ihigh_340 - l_ilow_348) / gd_808;
      }
      l_x_356 = (iHigh(NULL, PERIOD_D1, 0) - iLow(NULL, PERIOD_D1, 0)) / gd_808;
      l_y_360 = MathAbs(iHigh(Symbol(), Period(), 0) - iLow(Symbol(), Period(), 0)) / gd_808;
      ObjectCreate("sPWR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sPWR", "Prev Week Range", 9, "Arial", g_color_632);
      ObjectSet("sPWR", OBJPROP_CORNER, 0);
      ObjectSet("sPWR", OBJPROP_XDISTANCE, 240);
      ObjectSet("sPWR", OBJPROP_YDISTANCE, 2);
      ObjectCreate("iPWR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("iPWR", DoubleToStr(l_x_328, 0), 9, "Arial", Plum);
      ObjectSet("iPWR", OBJPROP_CORNER, 0);
      ObjectSet("iPWR", OBJPROP_XDISTANCE, 350);
      ObjectSet("iPWR", OBJPROP_YDISTANCE, 2);
      ObjectCreate("sCWR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sCWR", "This Week Range", 9, "Arial", g_color_632);
      ObjectSet("sCWR", OBJPROP_CORNER, 0);
      ObjectSet("sCWR", OBJPROP_XDISTANCE, 240);
      ObjectSet("sCWR", OBJPROP_YDISTANCE, 15);
      ObjectCreate("iCWR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("iCWR", DoubleToStr(l_x_332, 0), 9, "Arial", Plum);
      ObjectSet("iCWR", OBJPROP_CORNER, 0);
      ObjectSet("iCWR", OBJPROP_XDISTANCE, 350);
      ObjectSet("iCWR", OBJPROP_YDISTANCE, 15);
      ObjectCreate("sYR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sYR", "Yesterday Range", 9, "Arial", g_color_632);
      ObjectSet("sYR", OBJPROP_CORNER, 0);
      ObjectSet("sYR", OBJPROP_XDISTANCE, 390);
      ObjectSet("sYR", OBJPROP_YDISTANCE, 2);
      ObjectCreate("iYR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("iYR", DoubleToStr(l_y_336, 0), 9, "Arial", Plum);
      ObjectSet("iYR", OBJPROP_CORNER, 0);
      ObjectSet("iYR", OBJPROP_XDISTANCE, 490);
      ObjectSet("iYR", OBJPROP_YDISTANCE, 2);
      ObjectCreate("sTR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sTR", "Today Range", 9, "Arial", LimeGreen);
      ObjectSet("sTR", OBJPROP_CORNER, 0);
      ObjectSet("sTR", OBJPROP_XDISTANCE, 390);
      ObjectSet("sTR", OBJPROP_YDISTANCE, 15);
      ObjectCreate("iTR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("iTR", DoubleToStr(l_x_356, 0), 9, "Arial", LimeGreen);
      ObjectSet("iTR", OBJPROP_CORNER, 0);
      ObjectSet("iTR", OBJPROP_XDISTANCE, 490);
      ObjectSet("iTR", OBJPROP_YDISTANCE, 15);
      ObjectCreate("sBR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sBR", "Curr Bar Range", 9, "Arial", g_color_632);
      ObjectSet("sBR", OBJPROP_CORNER, 0);
      ObjectSet("sBR", OBJPROP_XDISTANCE, 520);
      ObjectSet("sBR", OBJPROP_YDISTANCE, 2);
      ObjectCreate("iBR", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("iBR", DoubleToStr(l_y_360, 0), 9, "Arial", Plum);
      ObjectSet("iBR", OBJPROP_CORNER, 0);
      ObjectSet("iBR", OBJPROP_XDISTANCE, 615);
      ObjectSet("iBR", OBJPROP_YDISTANCE, 2);
      if (gd_832 >= 0.0) l_color_364 = Lime;
      else l_color_364 = Orange;
      ObjectCreate("sPL", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sPL", "Curr P&L (pips)", 9, "Arial", g_color_632);
      ObjectSet("sPL", OBJPROP_CORNER, 0);
      ObjectSet("sPL", OBJPROP_XDISTANCE, 520);
      ObjectSet("sPL", OBJPROP_YDISTANCE, 15);
      ObjectCreate("iPL", OBJ_LABEL, 0, 0, 0);
      if (g_digits_536 == 3 || g_digits_536 == 5) ObjectSetText("iPL", DoubleToStr(gd_832, 0), 9, "Arial", l_color_364);
      else ObjectSetText("iPL", DoubleToStr(gd_832, 0), 9, "Arial", l_color_364);
      ObjectSet("iPL", OBJPROP_CORNER, 0);
      ObjectSet("iPL", OBJPROP_XDISTANCE, 615);
      ObjectSet("iPL", OBJPROP_YDISTANCE, 15);
      ObjectCreate("sBR5", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sBR5", "Total PnL", 9, "Arial", g_color_632);
      ObjectSet("sBR5", OBJPROP_CORNER, 0);
      ObjectSet("sBR5", OBJPROP_XDISTANCE, 650);
      ObjectSet("sBR5", OBJPROP_YDISTANCE, 2);
      if (gi_640 >= 0) l_color_364 = Lime;
      else l_color_364 = Orange;
      ObjectCreate("iPL20", OBJ_LABEL, 0, 0, 0);
      if (g_digits_536 == 3 || g_digits_536 == 5) ObjectSetText("iPL20", DoubleToStr(gi_640, 0), 9, "Arial", l_color_364);
      else ObjectSetText("iPL20", DoubleToStr(gi_640, 0), 9, "Arial", l_color_364);
      ObjectSet("iPL20", OBJPROP_CORNER, 0);
      ObjectSet("iPL20", OBJPROP_XDISTANCE, 735);
      ObjectSet("iPL20", OBJPROP_YDISTANCE, 2);
      if (gd_1192 >= 0.0) l_color_364 = Lime;
      else l_color_364 = Orange;
      ObjectCreate("sPL2", OBJ_LABEL, 0, 0, 0);
      ObjectSetText("sPL2", "Acc. Exposure ", 9, "Arial", g_color_632);
      ObjectSet("sPL2", OBJPROP_CORNER, 0);
      ObjectSet("sPL2", OBJPROP_XDISTANCE, 650);
      ObjectSet("sPL2", OBJPROP_YDISTANCE, 15);
      ObjectCreate("iPL2", OBJ_LABEL, 0, 0, 0);
      if (OrdersTotal() > 0) {
         if (gd_1192 >= 0.0) ObjectSetText("iPL2", "+" + DoubleToStr(gd_1192, 2) + " %", 9, "Arial", l_color_364);
         else ObjectSetText("iPL2", DoubleToStr(gd_1192, 2) + " %", 9, "Arial", l_color_364);
      } else ObjectSetText("iPL2", "No trades", 9, "Arial", l_color_364);
      ObjectSet("iPL2", OBJPROP_CORNER, 0);
      ObjectSet("iPL2", OBJPROP_XDISTANCE, 735);
      ObjectSet("iPL2", OBJPROP_YDISTANCE, 15);
   }
   if (Show.Pivots.Warnings) {
      ld_372 = gd_1376 + Pivot.Pips.Threashold * gd_808;
      ld_380 = gd_1376 - Pivot.Pips.Threashold * gd_808;
      ld_388 = gd_1384 + Pivot.Pips.Threashold * gd_808;
      ld_396 = gd_1384 - Pivot.Pips.Threashold * gd_808;
      ld_404 = gd_1392 + Pivot.Pips.Threashold * gd_808;
      ld_412 = gd_1392 - Pivot.Pips.Threashold * gd_808;
      ld_420 = gd_1400 + Pivot.Pips.Threashold * gd_808;
      ld_428 = gd_1400 - Pivot.Pips.Threashold * gd_808;
      ld_436 = gd_1408 + Pivot.Pips.Threashold * gd_808;
      ld_444 = gd_1408 - Pivot.Pips.Threashold * gd_808;
      ld_452 = gd_1416 + Pivot.Pips.Threashold * gd_808;
      ld_460 = gd_1416 - Pivot.Pips.Threashold * gd_808;
      ld_468 = gd_1424 + Pivot.Pips.Threashold * gd_808;
      ld_476 = gd_1424 - Pivot.Pips.Threashold * gd_808;
      ld_484 = g_price_1432 + Pivot.Pips.Threashold * gd_808;
      ld_492 = g_price_1432 - Pivot.Pips.Threashold * gd_808;
      ld_500 = g_price_1440 + Pivot.Pips.Threashold * gd_808;
      ld_508 = g_price_1440 - Pivot.Pips.Threashold * gd_808;
      ld_516 = g_price_1448 + Pivot.Pips.Threashold * gd_808;
      ld_524 = g_price_1448 - Pivot.Pips.Threashold * gd_808;
      ld_532 = g_price_1456 + Pivot.Pips.Threashold * gd_808;
      ld_540 = g_price_1456 - Pivot.Pips.Threashold * gd_808;
      ld_548 = g_price_1464 + Pivot.Pips.Threashold * gd_808;
      ld_556 = g_price_1464 - Pivot.Pips.Threashold * gd_808;
      ld_564 = g_price_1472 + Pivot.Pips.Threashold * gd_808;
      ld_572 = g_price_1472 - Pivot.Pips.Threashold * gd_808;
      ld_580 = g_price_1480 + Pivot.Pips.Threashold * gd_808;
      ld_588 = g_price_1480 - Pivot.Pips.Threashold * gd_808;
      l_text_596 = "";
      if (g_bid_508 < ld_484 && g_bid_508 > ld_492) {
         if (g_bid_508 <= g_price_1432) l_text_596 = "Caution: Price below Weekly Pivot (" + DoubleToStr(g_price_1432, g_digits_536) + ")";
         if (g_bid_508 > g_price_1432) l_text_596 = "Caution: Price above Weekly Pivot (" + DoubleToStr(g_price_1432, g_digits_536) + ")";
      } else {
         if (g_bid_508 < ld_500 && g_bid_508 > ld_508) {
            if (g_bid_508 <= g_price_1440) l_text_596 = "Caution: Price below Weekly S1 (" + DoubleToStr(g_price_1440, g_digits_536) + ")";
            if (g_bid_508 > g_price_1440) l_text_596 = "Caution: Price above Weekly S1 (" + DoubleToStr(g_price_1440, g_digits_536) + ")";
         } else {
            if (g_bid_508 < ld_516 && g_bid_508 > ld_524) {
               if (g_bid_508 <= g_price_1448) l_text_596 = "Caution: Price below Weekly S2 (" + DoubleToStr(g_price_1448, g_digits_536) + ")";
               if (g_bid_508 > g_price_1448) l_text_596 = "Caution: Price above Weekly S2 (" + DoubleToStr(g_price_1448, g_digits_536) + ")";
            } else {
               if (g_bid_508 < ld_532 && g_bid_508 > ld_540) {
                  if (g_bid_508 <= g_price_1456) l_text_596 = "Caution: Price below Weekly S3 (" + DoubleToStr(g_price_1456, g_digits_536) + ")";
                  if (g_bid_508 > g_price_1456) l_text_596 = "Caution: Price above Weekly S3 (" + DoubleToStr(g_price_1456, g_digits_536) + ")";
               } else {
                  if (g_bid_508 < ld_548 && g_bid_508 > ld_556) {
                     if (g_bid_508 <= g_price_1464) l_text_596 = "Caution: Price below Weekly R1 (" + DoubleToStr(g_price_1464, g_digits_536) + ")";
                     if (g_bid_508 > g_price_1464) l_text_596 = "Caution: Price above Weekly R1 (" + DoubleToStr(g_price_1464, g_digits_536) + ")";
                  } else {
                     if (g_bid_508 < ld_564 && g_bid_508 > ld_572) {
                        if (g_bid_508 <= g_price_1472) l_text_596 = "Caution: Price below Weekly R2 (" + DoubleToStr(g_price_1472, g_digits_536) + ")";
                        if (g_bid_508 > g_price_1472) l_text_596 = "Caution: Price above Weekly R2 (" + DoubleToStr(g_price_1472, g_digits_536) + ")";
                     } else {
                        if (g_bid_508 < ld_580 && g_bid_508 > ld_588) {
                           if (g_bid_508 <= g_price_1480) l_text_596 = "Caution: Price below Weekly R3 (" + DoubleToStr(g_price_1480, g_digits_536) + ")";
                           if (g_bid_508 > g_price_1480) l_text_596 = "Caution: Price above Weekly R3 (" + DoubleToStr(g_price_1480, g_digits_536) + ")";
                        } else {
                           if (g_bid_508 < ld_372 && g_bid_508 > ld_380) {
                              if (g_bid_508 <= gd_1376) l_text_596 = "Caution: Price below Daily Pivot (" + DoubleToStr(gd_1376, g_digits_536) + ")";
                              if (g_bid_508 > gd_1376) l_text_596 = "Caution: Price above Daily Pivot (" + DoubleToStr(gd_1376, g_digits_536) + ")";
                           } else {
                              if (g_bid_508 < ld_388 && g_bid_508 > ld_396) {
                                 if (g_bid_508 <= gd_1384) l_text_596 = "Caution: Price below Daily S1 (" + DoubleToStr(gd_1384, g_digits_536) + ")";
                                 if (g_bid_508 > gd_1384) l_text_596 = "Caution: Price above Daily S1 (" + DoubleToStr(gd_1384, g_digits_536) + ")";
                              } else {
                                 if (g_bid_508 < ld_404 && g_bid_508 > ld_412) {
                                    if (g_bid_508 <= gd_1392) l_text_596 = "Caution: Price below Daily S2 (" + DoubleToStr(gd_1392, g_digits_536) + ")";
                                    if (g_bid_508 > gd_1392) l_text_596 = "Caution: Price above Daily S2 (" + DoubleToStr(gd_1392, g_digits_536) + ")";
                                 } else {
                                    if (g_bid_508 < ld_420 && g_bid_508 > ld_428) {
                                       if (g_bid_508 <= gd_1400) l_text_596 = "Caution: Price below Daily S3 (" + DoubleToStr(gd_1400, g_digits_536) + ")";
                                       if (g_bid_508 > gd_1400) l_text_596 = "Caution: Price above Daily S3 (" + DoubleToStr(gd_1400, g_digits_536) + ")";
                                    } else {
                                       if (g_bid_508 < ld_436 && g_bid_508 > ld_444) {
                                          if (g_bid_508 <= gd_1408) l_text_596 = "Caution: Price below Daily R1 (" + DoubleToStr(gd_1408, g_digits_536) + ")";
                                          if (g_bid_508 > gd_1408) l_text_596 = "Caution: Price above Daily R1 (" + DoubleToStr(gd_1408, g_digits_536) + ")";
                                       } else {
                                          if (g_bid_508 < ld_452 && g_bid_508 > ld_460) {
                                             if (g_bid_508 <= gd_1416) l_text_596 = "Caution: Price below Daily R2 (" + DoubleToStr(gd_1416, g_digits_536) + ")";
                                             if (g_bid_508 > gd_1416) l_text_596 = "Caution: Price above Daily R2 (" + DoubleToStr(gd_1416, g_digits_536) + ")";
                                          } else {
                                             if (g_bid_508 < ld_468 && g_bid_508 > ld_476) {
                                                if (g_bid_508 <= gd_1424) l_text_596 = "Caution: Price below Daily R3 (" + DoubleToStr(gd_1424, g_digits_536) + ")";
                                                if (g_bid_508 > gd_1424) l_text_596 = "Caution: Price above Daily R3 (" + DoubleToStr(gd_1424, g_digits_536) + ")";
                                             }
                                          }
                                       }
                                    }
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      YannisCustomText("Yannis17", 15, 25, 3);
      ObjectSetText("Yannis17", l_text_596, 10, "Tahoma", Lime);
   }
}

void EmfaniseTisEidhseis() {
   int li_8;
   int li_12;
   int li_unused_16;
   int li_unused_20;
   string ls_24;
   string ls_32;
   gi_unused_880 = TimeHour(TimeCurrent());
   gi_unused_884 = TimeMinute(TimeCurrent());
   gi_unused_888 = TimeSeconds(TimeCurrent());
   int li_0 = iCustom(NULL, 0, "FFCal", 1, 1, 0, 1, 1, 1, -1, -1, 0, 0, 0, 1, 10, 13882323, 3329330, 255, 42495, 65535, 21, 600, 600, 16748574, 12632256, 10, 0, 0, 1, 1);
   int li_4 = iCustom(NULL, 0, "FFCal", 1, 1, 0, 1, 1, 1, -1, -1, 0, 0, 0, 1, 10, 13882323, 3329330, 255, 42495, 65535, 21, 600, 600, 16748574, 12632256, 10, 0, 0, 2, 1);
   if (li_0 >= 0) {
      if (li_0 >= 1440) {
         li_0 = -1;
         g_text_724 = "No Upcoming news for next 24 hours";
         YannisCustomText("Yannis2", 15, 5, 3);
         ObjectSetText("Yannis2", g_text_724, 12, "Tahoma", LightGray);
         return;
      }
      if (li_0 < 60) {
         li_8 = 0;
         li_12 = li_0 + 1;
      } else {
         li_8 = MathFloor(li_0 / 60);
         li_12 = MathAbs(60.0 * MathFloor(li_0 / 60) - li_0) + 1.0;
      }
      li_unused_16 = li_8;
      li_unused_20 = li_12;
      if (li_8 >= 0 && li_8 <= 9) ls_24 = "0";
      else ls_24 = "";
      if (li_12 >= 0 && li_12 <= 9) ls_32 = "0";
      else ls_32 = "";
      if (li_4 == 3) g_text_724 = "NEXT UPCOMING NEWS EVENT IN " + ls_24 + DoubleToStr(li_8, 0) + " hrs " + ls_32 + DoubleToStr(li_12, 0) + " min";
      else g_text_724 = "Next Upcoming news event in " + ls_24 + DoubleToStr(li_8, 0) + " hrs " + ls_32 + DoubleToStr(li_12, 0) + " min";
      YannisCustomText("Yannis2", 15, 5, 3);
      if (li_4 == 3) {
         ObjectSetText("Yannis2", g_text_724, 10, "Tahoma", Red);
         return;
      }
      if (li_4 == 2) {
         ObjectSetText("Yannis2", g_text_724, 10, "Tahoma", DarkOrange);
         return;
      }
      ObjectSetText("Yannis2", g_text_724, 10, "Tahoma", Yellow);
   }
}

void DeixtouProhgEntoles() {
   int li_unused_24;
   int li_unused_28;
   color l_color_40;
   bool li_44;
   double l_point_48;
   int li_unused_56;
   int li_60;
   double ld_64;
   int li_0 = 15;
   int li_4 = 10;
   int li_unused_8 = 6;
   int l_cmd_12 = 0;
   int li_16 = 0;
   int li_20 = 0;
   int l_datetime_32 = 0;
   for (int l_pos_36 = OrdersHistoryTotal() - 1; l_pos_36 >= 0; l_pos_36--) {
      OrderSelect(l_pos_36, SELECT_BY_POS, MODE_HISTORY);
      RefreshRates();
      g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
      gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
      gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
      g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
      g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
      gd_808 = SetPoint();
      if ((OrderSymbol() == Symbol() && OrderMagicNumber() == 0 && Show.Only.Manual.Trades) || (OrderSymbol() == Symbol() && OrderMagicNumber() > 0 && !Show.Only.Manual.Trades)) {
         if (l_datetime_32 != OrderCloseTime() || l_cmd_12 != OrderType()) {
            l_datetime_32 = OrderCloseTime();
            l_cmd_12 = OrderType();
            li_0 = 15;
            li_4 = 10;
            li_unused_8 = 6;
         }
         if (OrderProfit() >= 0.0) {
            l_color_40 = LimeGreen;
            li_44 = TRUE;
         } else {
            l_color_40 = Orange;
            li_44 = FALSE;
         }
         l_point_48 = MarketInfo(OrderSymbol(), MODE_POINT);
         li_unused_56 = iBarShift(NULL, 0, OrderCloseTime(), FALSE);
         if (OrderType() == OP_BUY) li_60 = MathRound((OrderClosePrice() - OrderOpenPrice()) / l_point_48);
         else
            if (OrderType() == OP_SELL) li_60 = MathRound((OrderOpenPrice() - OrderClosePrice()) / l_point_48);
         if (OrderLots() < 1.0) {
            if (OrderLots() < 0.1) ld_64 = 100.0 * OrderLots();
            else ld_64 = 10.0 * OrderLots();
         } else ld_64 = OrderLots();
         if (OrderType() == OP_BUY) {
            li_16 = 1 - li_16;
            if (li_16 == 0) li_unused_28 = 5;
            else li_unused_28 = 6;
            ObjectCreate("Long Entry: " + DoubleToStr(OrderTicket(), 0), OBJ_ARROW, 0, OrderOpenTime(), OrderOpenPrice());
            ObjectSet("Long Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("Long Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_WIDTH, 1);
            ObjectSet("Long Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_COLOR, CornflowerBlue);
            ObjectSet("Long Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_ANGLE, 45);
            ObjectCreate("LongT: " + DoubleToStr(OrderTicket(), 0), OBJ_TREND, 0, OrderOpenTime(), OrderOpenPrice(), OrderCloseTime(), OrderClosePrice());
            ObjectSet("LongT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_STYLE, STYLE_DOT);
            ObjectSet("LongT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_WIDTH, 1);
            ObjectSet("LongT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_RAY, FALSE);
            ObjectSet("LongT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_COLOR, l_color_40);
            if (li_44) {
               ObjectCreate("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJ_TEXT, 0, OrderCloseTime() - 60 * (1 * Period()), OrderClosePrice() + 1.0 * gd_808);
               ObjectSetText("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), " + " + DoubleToStr(li_60 * ld_64, 0), 10, "Tahoma", LimeGreen);
               ObjectSet("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJPROP_ANGLE, 90);
            } else {
               ObjectCreate("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJ_TEXT, 0, OrderCloseTime() - 60 * (1 * Period()), OrderClosePrice() - 1.0 * gd_808);
               ObjectSetText("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), " - " + DoubleToStr(li_60 * ld_64, 0), 10, "Tahoma", OrangeRed);
               ObjectSet("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJPROP_ANGLE, 90);
            }
            li_0 += li_4;
         }
         if (OrderType() == OP_SELL) {
            li_20 = 1 - li_20;
            if (li_20 == 0) li_unused_24 = 5;
            else li_unused_24 = 6;
            ObjectCreate("Short Entry: " + DoubleToStr(OrderTicket(), 0), OBJ_ARROW, 0, OrderOpenTime(), OrderOpenPrice());
            ObjectSet("Short Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("Short Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_WIDTH, 1);
            ObjectSet("Short Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_COLOR, HotPink);
            ObjectSet("Short Entry: " + DoubleToStr(OrderTicket(), 0), OBJPROP_ANGLE, 45);
            ObjectCreate("ShortT: " + DoubleToStr(OrderTicket(), 0), OBJ_TREND, 0, OrderOpenTime(), OrderOpenPrice(), OrderCloseTime(), OrderClosePrice());
            ObjectSet("ShortT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_STYLE, STYLE_DOT);
            ObjectSet("ShortT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_WIDTH, 1);
            ObjectSet("ShortT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_RAY, FALSE);
            ObjectSet("ShortT: " + DoubleToStr(OrderTicket(), 0), OBJPROP_COLOR, l_color_40);
            if (li_44) {
               ObjectCreate("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJ_TEXT, 0, OrderCloseTime() - 60 * (1 * Period()), OrderClosePrice() - 1.0 * gd_808);
               ObjectSetText("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), " + " + DoubleToStr(li_60 * ld_64, 0), 10, "Tahoma", LimeGreen);
               ObjectSet("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJPROP_ANGLE, 90);
            } else {
               ObjectCreate("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJ_TEXT, 0, OrderCloseTime() - 60 * (1 * Period()), OrderClosePrice() + 1.0 * gd_808);
               ObjectSetText("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), " - " + DoubleToStr(li_60 * ld_64, 0), 10, "Tahoma", OrangeRed);
               ObjectSet("PlusOrMinus" + DoubleToStr(OrderTicket(), 0), OBJPROP_ANGLE, 90);
            }
            li_0 += li_4;
         }
      } else {
         ObjectDelete("Long Entry: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("LongT: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("PlusOrMinus" + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("PlusOrMinus" + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("Short Entry: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("ShortT: " + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("PlusOrMinus" + DoubleToStr(OrderTicket(), 0));
         ObjectDelete("PlusOrMinus" + DoubleToStr(OrderTicket(), 0));
      }
   }
   li_0 = 0;
   for (l_pos_36 = OrdersTotal() - 1; l_pos_36 >= 0; l_pos_36--) {
      OrderSelect(l_pos_36, SELECT_BY_POS, MODE_TRADES);
      if (Symbol() == OrderSymbol() && OrderMagicNumber() == 0) {
         if (OrderType() == OP_BUY) {
            ObjectCreate("Long Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJ_ARROW, 0, OrderOpenTime(), OrderOpenPrice());
            ObjectSet("Long Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("Long Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJPROP_WIDTH, 1);
            ObjectSet("Long Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJPROP_COLOR, CornflowerBlue);
         }
         if (OrderType() == OP_SELL) {
            ObjectCreate("Short Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJ_ARROW, 0, OrderOpenTime(), OrderOpenPrice());
            ObjectSet("Short Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("Short Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJPROP_WIDTH, 1);
            ObjectSet("Short Entry: " + DoubleToStr(OrderOpenTime(), 0), OBJPROP_COLOR, HotPink);
         }
      }
   }
}

void AllaxeForaEntolhs(int ai_0) {
   int l_count_4 = 0;
   int l_count_8 = 0;
   for (int l_pos_12 = OrdersTotal() - 1; l_pos_12 >= 0; l_pos_12--) {
      OrderSelect(l_pos_12, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0 && OrderType() == OP_BUY) l_count_4++;
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0 && OrderType() == OP_SELL) l_count_8++;
   }
   if (l_count_4 == 0 && l_count_8 == 0) return;
   if (l_count_4 > 0 && l_count_8 > 0 && ai_0 == 0) {
      Alert("You have trades opened in opposite direction. Cannot enable Stop and Reverse");
      return;
   }
   if (ai_0 == 0 && l_count_4 > 0) {
      ShutDownTheTrades(1);
      OpenNewTrade(2);
      return;
   }
   if (ai_0 == 0 && l_count_8 > 0) {
      ShutDownTheTrades(2);
      OpenNewTrade(1);
      return;
   }
   if (ai_0 == 1 && l_count_8 > 0) {
      ShutDownTheTrades(2);
      OpenNewTrade(1);
   }
   if (ai_0 == 2 && l_count_4 > 0) {
      ShutDownTheTrades(1);
      OpenNewTrade(2);
   }
}

void OpenNewTrade(int ai_0) {
   int l_ticket_28;
   bool li_4 = FALSE;
   bool li_8 = FALSE;
   if (Virtual.SL > 0) li_4 = Virtual.SL;
   else li_4 = Actual.SL;
   if (Virtual.TP > 0) li_8 = Virtual.TP;
   else {
      if (Actual.TP3 > 0) li_8 = Actual.TP3;
      else {
         if (Actual.TP2 > 0) li_8 = Actual.TP2;
         else li_8 = Actual.TP1;
      }
   }
   RefreshRates();
   g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
   gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(Symbol(), MODE_POINT);
   g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
   g_bid_508 = MarketInfo(Symbol(), MODE_BID);
   gd_808 = SetPoint();
   if (ai_0 == 1) {
      g_count_760 = 0;
      while (g_count_760 < 5 && !IsTradeAllowed()) {
         g_count_760++;
         Sleep(1000);
      }
      RefreshRates();
      l_ticket_28 = OrderSend(Symbol(), OP_BUY, YpologisePosothta(), NormalizeDouble(g_ask_500, g_digits_536), Slippage, NormalizeDouble(g_ask_500 - li_4 * gd_808, g_digits_536), NormalizeDouble(g_ask_500 +
         li_8 * gd_808, g_digits_536), Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_28 < 1) {
         Print("ERROR Opening Long Position on S&R : ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(g_ask_500, g_digits_536), "     SL=", NormalizeDouble(g_ask_500 - li_4 * gd_808, g_digits_536), "    TP=", NormalizeDouble(g_ask_500 +
            li_8 * gd_808, g_digits_536), "   ", Period() + " min  S&R");
      } else Sleep(1000);
   }
   if (ai_0 == 2) {
      g_count_760 = 0;
      while (g_count_760 < 5 && !IsTradeAllowed()) {
         g_count_760++;
         Sleep(1000);
      }
      RefreshRates();
      l_ticket_28 = OrderSend(Symbol(), OP_SELL, YpologisePosothta(), NormalizeDouble(g_bid_508, g_digits_536), Slippage, NormalizeDouble(g_bid_508 + li_4 * gd_808, g_digits_536), NormalizeDouble(g_bid_508 - li_8 * gd_808, g_digits_536), Period() +
         " min  S&R", 0, 0, Fuchsia);
      if (l_ticket_28 < 1) {
         Print("ERROR Opening Short Position: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(g_bid_508, g_digits_536), "     SL=", NormalizeDouble(g_bid_508 +
            li_4 * gd_808, g_digits_536), "    TP=", NormalizeDouble(g_bid_508 - li_8 * gd_808, g_digits_536), "   ", Period() + " min  S&R");
         return;
      }
      Sleep(1000);
   }
}

void ShutDownTheTrades(int ai_0) {
   for (int l_pos_4 = OrdersTotal() - 1; l_pos_4 >= 0; l_pos_4--) {
      OrderSelect(l_pos_4, SELECT_BY_POS, MODE_TRADES);
      if (OrderSymbol() == Symbol() && OrderMagicNumber() == 0) {
         RefreshRates();
         g_digits_536 = MarketInfo(OrderSymbol(), MODE_DIGITS);
         gd_unused_816 = MarketInfo(OrderSymbol(), MODE_STOPLEVEL);
         gd_572 = MarketInfo(OrderSymbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
         g_ask_500 = MarketInfo(OrderSymbol(), MODE_ASK);
         g_bid_508 = MarketInfo(OrderSymbol(), MODE_BID);
         gd_808 = SetPoint();
         if (OrderType() == OP_BUY && ai_0 == 1) {
            g_count_796 = 0;
            while (g_count_796 < 5 && !IsTradeAllowed()) {
               g_count_796++;
               Sleep(1000);
            }
            RefreshRates();
            Print("Closing Long ## ", OrderTicket(), "   Manual Stop and Reverse (Alt+R) has been pressed");
            OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(g_bid_508, g_digits_536), Slippage, Yellow);
            Sleep(1000);
         }
         if (OrderType() == OP_SELL && ai_0 == 2) {
            g_count_796 = 0;
            while (g_count_796 < 5 && !IsTradeAllowed()) {
               g_count_796++;
               Sleep(1000);
            }
            RefreshRates();
            Print("Closing Short ## ", OrderTicket(), "   Manual Stop and Reverse (Alt+R) has been pressed");
            OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(g_ask_500, g_digits_536), Slippage, Yellow);
            Sleep(1000);
         }
      }
   }
}

int PSARhasSwitched() {
   int li_ret_0 = 0;
   double ld_4 = NormalizeDouble(iSAR(NULL, Psar.TimeFrame, PSAR.Step, PSAR.Maximum, 1), g_digits_536);
   double ld_12 = NormalizeDouble(iSAR(NULL, Psar.TimeFrame, PSAR.Step, PSAR.Maximum, 2), g_digits_536);
   double ld_20 = NormalizeDouble(iHigh(NULL, Psar.TimeFrame, 1), g_digits_536);
   double ld_28 = NormalizeDouble(iHigh(NULL, Psar.TimeFrame, 2), g_digits_536);
   double ld_36 = NormalizeDouble(iLow(NULL, Psar.TimeFrame, 1), g_digits_536);
   double ld_44 = NormalizeDouble(iLow(NULL, Psar.TimeFrame, 2), g_digits_536);
   if (ld_4 <= ld_36 && ld_12 <= ld_44) li_ret_0 = 0;
   if (ld_4 >= ld_20 && ld_12 >= ld_28) li_ret_0 = 0;
   if (ld_4 <= ld_36 && ld_12 >= ld_28) li_ret_0 = 1;
   if (ld_4 >= ld_20 && ld_12 <= ld_44) li_ret_0 = 2;
   return (li_ret_0);
}

void Ypologise_Grammes_Stirixhs() {
   color l_color_116;
   color l_color_120;
   color l_color_124;
   color l_color_128;
   color l_color_132;
   color l_color_136;
   color l_color_140;
   color l_color_144;
   color l_color_148;
   color l_color_152;
   color l_color_156;
   color l_color_160;
   color l_color_164;
   color l_color_168;
   int li_4 = Bars - gi_788;
   int li_0 = Pivots.StartHour + gi_552;
   if (li_0 < 0) li_0 = 24 - MathAbs(gi_552);
   if (li_0 > 24) li_0 -= 24;
   int li_8 = 60 * li_0 + Pivots.StartMinute;
   int li_12 = li_8 - Period();
   if (li_12 < 0) li_12 += 1440;
   int li_16 = 1440 / Period();
   int li_20 = 0;
   int li_24 = VresTelHmnia(li_12, li_20 + 1);
   int li_28 = VresTelHmnia(li_8, li_24 + 1);
   double ld_32 = High[li_24];
   double ld_40 = Low[li_24];
   double ld_48 = Close[li_24];
   for (int li_56 = li_24; li_56 < li_28 + 1; li_56++) {
      if (High[li_56] > ld_32) ld_32 = High[li_56];
      if (Low[li_56] < ld_40) ld_40 = Low[li_56];
   }
   double l_price_60 = (ld_32 + ld_40 + ld_48) / 3.0;
   double l_price_68 = 2.0 * l_price_60 - ld_40;
   double l_price_76 = 2.0 * l_price_60 - ld_32;
   double l_price_84 = l_price_60 + (ld_32 - ld_40);
   double l_price_92 = l_price_60 - (ld_32 - ld_40);
   double l_price_100 = 2.0 * l_price_60 + (ld_32 - 2.0 * ld_40);
   double l_price_108 = 2.0 * l_price_60 - (2.0 * ld_32 - ld_40);
   gt_unused_540 = Time[gi_544];
   ArrayCopyRates(gda_1352, Symbol(), PERIOD_W1);
   gd_1504 = gda_1352[1][3];
   gd_1512 = gda_1352[1][2];
   gd_1528 = gda_1352[1][4];
   gd_unused_1520 = gda_1352[1][1];
   g_price_1432 = (gd_1504 + gd_1512 + gd_1528) / 3.0;
   g_price_1464 = 2.0 * g_price_1432 - gd_1512;
   g_price_1440 = 2.0 * g_price_1432 - gd_1504;
   g_price_1472 = g_price_1432 + (g_price_1464 - g_price_1440);
   g_price_1448 = g_price_1432 - (g_price_1464 - g_price_1440);
   g_price_1456 = gd_1512 - 2.0 * (gd_1504 - g_price_1432);
   g_price_1480 = gd_1504 + 2.0 * (g_price_1432 - gd_1512);
   if (Show.Pivots.OnScreen) {
      l_color_116 = SeaGreen;
      l_color_120 = Lime;
      l_color_124 = LawnGreen;
      l_color_128 = DeepPink;
      l_color_132 = LightSalmon;
      l_color_136 = Coral;
      l_color_140 = Tomato;
      l_color_144 = SeaGreen;
      l_color_148 = Lime;
      l_color_152 = LawnGreen;
      l_color_156 = DeepPink;
      l_color_160 = LightSalmon;
      l_color_164 = Coral;
      l_color_168 = Tomato;
      if (ObjectFind("odpr3") == -1) {
         ObjectCreate("odpr3", OBJ_TEXT, 0, Time[10], l_price_100);
         ObjectSetText("odpr3", "R3  " + DoubleToStr(l_price_100, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_116);
         ObjectMove("odpr3", 0, Time[10], l_price_100);
      } else ObjectMove("odpr3", 0, Time[10], l_price_100);
      if (ObjectFind("odpr2") == -1) {
         ObjectCreate("odpr2", OBJ_TEXT, 0, Time[10], l_price_84);
         ObjectSetText("odpr2", "R2  " + DoubleToStr(l_price_84, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_120);
         ObjectMove("odpr2", 0, Time[10], l_price_84);
      } else ObjectMove("odpr2", 0, Time[10], l_price_84);
      if (ObjectFind("odpr1") == -1) {
         ObjectCreate("odpr1", OBJ_TEXT, 0, Time[10], l_price_68);
         ObjectSetText("odpr1", "R1  " + DoubleToStr(l_price_68, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_124);
         ObjectMove("odpr1", 0, Time[10], l_price_68);
      } else ObjectMove("odpr1", 0, Time[10], l_price_68);
      if (ObjectFind("odppi") == -1) {
         ObjectCreate("odppi", OBJ_TEXT, 0, Time[10], l_price_60);
         ObjectSetText("odppi", "DP  " + DoubleToStr(l_price_60, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_128);
         ObjectMove("odppi", 0, Time[10], l_price_60);
      } else ObjectMove("odppi", 0, Time[10], l_price_60);
      if (ObjectFind("odps1") == -1) {
         ObjectCreate("odps1", OBJ_TEXT, 0, Time[10], l_price_76);
         ObjectSetText("odps1", "S1  " + DoubleToStr(l_price_76, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_132);
         ObjectMove("odps1", 0, Time[10], l_price_76);
      } else ObjectMove("odps1", 0, Time[10], l_price_76);
      if (ObjectFind("odps2") == -1) {
         ObjectCreate("odps2", OBJ_TEXT, 0, Time[10], l_price_92);
         ObjectSetText("odps2", "S2  " + DoubleToStr(l_price_92, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_136);
         ObjectMove("odps2", 0, Time[10], l_price_92);
      } else ObjectMove("odps2", 0, Time[10], l_price_92);
      if (ObjectFind("odps3") == -1) {
         ObjectCreate("odps3", OBJ_TEXT, 0, Time[10], l_price_108);
         ObjectSetText("odps3", "S3  " + DoubleToStr(l_price_108, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_140);
         ObjectMove("odps3", 0, Time[10], l_price_108);
      } else ObjectMove("odps3", 0, Time[10], l_price_108);
      if (ObjectFind("odop1") == -1) {
         ObjectCreate("odop1", OBJ_TEXT, 0, Time[20], iOpen(NULL, PERIOD_D1, 0));
         ObjectSetText("odop1", "Daily Open  " + DoubleToStr(iOpen(NULL, PERIOD_D1, 0), g_digits_536) + " ----------------------------------------------------------", 8, "Broadway ", Gold);
         ObjectMove("odop1", 0, Time[20], iOpen(NULL, PERIOD_D1, 0));
      } else ObjectMove("odop1", 0, Time[20], iOpen(NULL, PERIOD_D1, 0));
      if (ObjectFind("odhp1") == -1) {
         ObjectCreate("odhp1", OBJ_TEXT, 0, Time[20], iHigh(NULL, PERIOD_D1, 0));
         ObjectSetText("odhp1", "Daily High  " + DoubleToStr(iHigh(NULL, PERIOD_D1, 0), g_digits_536) + " ----------------------------------------------------------", 8, "Broadway ", Gold);
         ObjectMove("odhp1", 0, Time[20], iHigh(NULL, PERIOD_D1, 0));
      } else ObjectMove("odhp1", 0, Time[20], iHigh(NULL, PERIOD_D1, 0));
      if (ObjectFind("odlp1") == -1) {
         ObjectCreate("odlp1", OBJ_TEXT, 0, Time[20], iLow(NULL, PERIOD_D1, 0));
         ObjectSetText("odlp1", "Daily Low  " + DoubleToStr(iLow(NULL, PERIOD_D1, 0), g_digits_536) + " ------------------------------------------------------------", 8, "Broadway ", Gold);
         ObjectMove("odlp1", 0, Time[20], iLow(NULL, PERIOD_D1, 0));
      } else ObjectMove("odlp1", 0, Time[20], iLow(NULL, PERIOD_D1, 0));
      if (ObjectFind("owhp1") == -1) {
         ObjectCreate("owhp1", OBJ_TEXT, 0, Time[40], iHigh(NULL, PERIOD_W1, 0));
         ObjectSetText("owhp1", "Weekly High  " + DoubleToStr(iHigh(NULL, PERIOD_W1, 0), g_digits_536) + " ---------------------------------------------------------", 8, "Broadway ", SteelBlue);
         ObjectMove("owhp1", 0, Time[40], iHigh(NULL, PERIOD_W1, 0));
      } else ObjectMove("owhp1", 0, Time[40], iHigh(NULL, PERIOD_W1, 0));
      if (ObjectFind("owlp1") == -1) {
         ObjectCreate("owlp1", OBJ_TEXT, 0, Time[40], iLow(NULL, PERIOD_W1, 0));
         ObjectSetText("owlp1", "Weekly Low  " + DoubleToStr(iLow(NULL, PERIOD_W1, 0), g_digits_536) + " -----------------------------------------------------------", 8, "Broadway ", SteelBlue);
         ObjectMove("owlp1", 0, Time[40], iLow(NULL, PERIOD_W1, 0));
      } else ObjectMove("owlp1", 0, Time[40], iLow(NULL, PERIOD_W1, 0));
      if (ObjectFind("owpr3") == -1) {
         ObjectCreate("owpr3", OBJ_TEXT, 0, Time[30], g_price_1480);
         ObjectSetText("owpr3", "WR3  " + DoubleToStr(g_price_1480, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_144);
         ObjectMove("owpr3", 0, Time[30], g_price_1480);
      } else ObjectMove("owpr3", 0, Time[30], g_price_1480);
      if (ObjectFind("owpr2") == -1) {
         ObjectCreate("owpr2", OBJ_TEXT, 0, Time[30], g_price_1472);
         ObjectSetText("owpr2", "WR2  " + DoubleToStr(g_price_1472, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_148);
         ObjectMove("owpr2", 0, Time[30], g_price_1472);
      } else ObjectMove("owpr2", 0, Time[30], g_price_1472);
      if (ObjectFind("owpr1") == -1) {
         ObjectCreate("owpr1", OBJ_TEXT, 0, Time[30], g_price_1464);
         ObjectSetText("owpr1", "WR1  " + DoubleToStr(g_price_1464, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_152);
         ObjectMove("owpr1", 0, Time[30], g_price_1464);
      } else ObjectMove("owpr1", 0, Time[30], g_price_1464);
      if (ObjectFind("owppi") == -1) {
         ObjectCreate("owppi", OBJ_TEXT, 0, Time[30], g_price_1432);
         ObjectSetText("owppi", "WP  " + DoubleToStr(g_price_1432, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_156);
         ObjectMove("owppi", 0, Time[30], g_price_1432);
      } else ObjectMove("owppi", 0, Time[30], g_price_1432);
      if (ObjectFind("owps1") == -1) {
         ObjectCreate("owps1", OBJ_TEXT, 0, Time[30], g_price_1440);
         ObjectSetText("owps1", "WS1  " + DoubleToStr(g_price_1440, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_160);
         ObjectMove("owps1", 0, Time[30], g_price_1440);
      } else ObjectMove("owps1", 0, Time[30], g_price_1440);
      if (ObjectFind("owps2") == -1) {
         ObjectCreate("owps2", OBJ_TEXT, 0, Time[30], g_price_1448);
         ObjectSetText("owps2", "WS2  " + DoubleToStr(g_price_1448, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_164);
         ObjectMove("owps2", 0, Time[30], g_price_1448);
      } else ObjectMove("owps2", 0, Time[30], g_price_1448);
      if (ObjectFind("owps3") == -1) {
         ObjectCreate("owps3", OBJ_TEXT, 0, Time[30], g_price_1456);
         ObjectSetText("owps3", "WS3  " + DoubleToStr(g_price_1456, g_digits_536) + " -------------------------------------------", 8, "Tahoma ", l_color_168);
         ObjectMove("owps3", 0, Time[30], g_price_1456);
         return;
      }
      ObjectMove("owps3", 0, Time[30], g_price_1456);
   }
}

int VresTelHmnia(int ai_0, int ai_4) {
   int li_40;
   int li_44;
   int li_48;
   int li_8 = 60 * TimeHour(Time[ai_4]) + TimeMinute(Time[ai_4]);
   if (li_8 < ai_0) li_8 += 1440;
   int li_12 = li_8 - ai_0;
   int li_16 = li_12 / Period();
   int li_ret_20 = ai_4 + li_16;
   int li_24 = 60 * TimeHour(Time[li_ret_20]) + TimeMinute(Time[li_ret_20]);
   if (li_24 == ai_0) return (li_ret_20);
   int li_28 = ai_0 - li_24;
   int li_32 = li_28 / Period();
   if (li_28 > 0) {
      for (int li_ret_36 = li_ret_20; li_ret_36 > li_ret_20 - li_32 - 2; li_ret_36--) {
         li_40 = 60 * TimeHour(Time[li_ret_36 + 1]) + TimeMinute(Time[li_ret_36 + 1]);
         li_44 = 60 * TimeHour(Time[li_ret_36]) + TimeMinute(Time[li_ret_36]);
         li_48 = 60 * TimeHour(Time[li_ret_36 - 1]) + TimeMinute(Time[li_ret_36 - 1]);
         if (li_44 == ai_0) return (li_ret_36);
         if (li_40 > li_44) li_40 -= 1440;
         if (li_48 < li_44) li_48 += 1440;
         if (li_40 < ai_0 && ai_0 < li_48) return (li_ret_36);
      }
   }
   return (li_ret_20);
}

void AllPosCounter() {
   g_count_580 = 0;
   g_count_584 = 0;
   g_count_588 = 0;
   for (int l_pos_0 = OrdersTotal() - 1; l_pos_0 >= 0; l_pos_0--) {
      OrderSelect(l_pos_0, SELECT_BY_POS, MODE_TRADES);
      if (OrderMagicNumber() == 0) {
         if (OrderType() == OP_BUY) g_count_580++;
         if (OrderType() == OP_SELL) g_count_584++;
         g_count_588++;
      }
   }
}

bool IsAboveZeroLine(int ai_0) {
   if (ai_0 == 1) return (TRUE);
   else return (FALSE);
}

void EmfaniseTaPlhktra() {
   YannisCustomText("Seep1", 5, 25, 0);
   ObjectSetText("Seep1", "=====================", 9, "Tahoma", IndianRed);
   YannisCustomText("Key00", 5, 35, 0);
   ObjectSetText("Key00", "1 CLICK TRADE TRIGGERS (Use Keypad)", 9, "Tahoma", SandyBrown);
   YannisCustomText("Seep2", 5, 45, 0);
   ObjectSetText("Seep2", "=====================", 9, "Tahoma", IndianRed);
   YannisCustomText("Key0", 5, 60, 0);
   ObjectSetText("Key0", "Alt + 1 = Open a STRADDLE", 9, "Tahoma", HotPink);
   YannisCustomText("Seep3", 5, 65, 0);
   ObjectSetText("Seep3", "___________________________", 9, "Tahoma", IndianRed);
   YannisCustomText("Key1", 5, 80, 0);
   ObjectSetText("Key1", "Alt + 2 = Open a BUY  (Market)", 9, "Tahoma", Red);
   YannisCustomText("Key2", 5, 95, 0);
   ObjectSetText("Key2", "Alt + 3 = Open a SELL (Market)", 9, "Tahoma", Red);
   YannisCustomText("Seep4", 5, 100, 0);
   ObjectSetText("Seep4", "___________________________", 9, "Tahoma", IndianRed);
   YannisCustomText("Key3", 5, 115, 0);
   ObjectSetText("Key3", "Alt + 4 = Open a BUY  STOP", 9, "Tahoma", Orange);
   YannisCustomText("Key4", 5, 130, 0);
   ObjectSetText("Key4", "Alt + 5 = Open a SELL STOP", 9, "Tahoma", Orange);
   YannisCustomText("Seep5", 5, 135, 0);
   ObjectSetText("Seep5", "___________________________", 9, "Tahoma", IndianRed);
   YannisCustomText("Key5", 5, 150, 0);
   ObjectSetText("Key5", "Alt + 6 = Open a BUY  LIMIT", 9, "Tahoma", DarkSalmon);
   YannisCustomText("Key6", 5, 165, 0);
   ObjectSetText("Key6", "Alt + 7 = Open a SELL LIMIT", 9, "Tahoma", DarkSalmon);
   YannisCustomText("Seep6", 5, 170, 0);
   ObjectSetText("Seep6", "___________________________", 9, "Tahoma", IndianRed);
   YannisCustomText("Key7", 5, 185, 0);
   ObjectSetText("Key7", "Alt + R = STOP & REVERSE", 9, "Tahoma", HotPink);
   YannisCustomText("Seep7", 5, 190, 0);
   ObjectSetText("Seep7", "___________________________", 9, "Tahoma", IndianRed);
   YannisCustomText("Key8", 5, 205, 0);
   ObjectSetText("Key8", "Alt + 9 = Close ALL", 9, "Tahoma", HotPink);
}

void ValeNeaEntolh(int ai_0) {
   double ld_8;
   int l_ticket_16;
   int li_4 = TsekareThnAsfaleia();
   if (li_4 > 0) {
      EnhmeroseXrhsth(li_4);
      return;
   }
   RefreshRates();
   g_digits_536 = MarketInfo(Symbol(), MODE_DIGITS);
   gd_unused_816 = MarketInfo(Symbol(), MODE_STOPLEVEL);
   gd_572 = MarketInfo(Symbol(), MODE_SPREAD) * MarketInfo(OrderSymbol(), MODE_POINT);
   g_ask_500 = MarketInfo(Symbol(), MODE_ASK);
   g_bid_508 = MarketInfo(Symbol(), MODE_BID);
   gd_808 = SetPoint();
   Alert("MyDigits=", g_digits_536, "  dSpread=", gd_572, "  MyAsk=", g_ask_500, "   MyBid=", g_bid_508);
   if (ai_0 == 0) {
      ld_8 = g_ask_500 + Pips.Distance.From.Price * gd_808;
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_BUYSTOP, YpologisePosothta(), NormalizeDouble(ld_8, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Buy Stop Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(ld_8, g_digits_536), "     SL=", NormalizeDouble(gd_1088, g_digits_536), "    TP=", NormalizeDouble(ld_8 +
            gi_704 * gd_808, g_digits_536), "   ", Period() + " min  S&R");
         return;
      }
      gi_unused_772 = 1;
      Sleep(2000);
      ld_8 = g_bid_508 - Pips.Distance.From.Price * gd_808;
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_SELLSTOP, YpologisePosothta(), NormalizeDouble(ld_8, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Sell Stop Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(ld_8, g_digits_536), "     SL=", NormalizeDouble(gd_1080, g_digits_536), "    TP=", NormalizeDouble(ld_8 - gi_704 * gd_808, g_digits_536), "   ", Period() +
            " min  S&R");
         return;
      }
      gi_unused_772 = 2;
      Sleep(1000);
      return;
   }
   if (ai_0 == 1) {
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_BUY, YpologisePosothta(), NormalizeDouble(g_ask_500, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Buy Market Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(g_ask_500, g_digits_536), "     SL=", NormalizeDouble(gd_1088, g_digits_536), "    TP=", NormalizeDouble(g_ask_500 +
            gi_704 * gd_808, g_digits_536), "   ", Period() + " min  S&R");
         return;
      }
      gi_unused_772 = 1;
      Sleep(1000);
      return;
   }
   if (ai_0 == 2) {
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_SELL, YpologisePosothta(), NormalizeDouble(g_bid_508, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Sell Market Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(g_ask_500, g_digits_536), "     SL=", NormalizeDouble(gd_1080, g_digits_536), "    TP=", NormalizeDouble(g_bid_508 - gi_704 * gd_808, g_digits_536), "   ", Period() +
            " min  S&R");
         return;
      }
      gi_unused_772 = 2;
      Sleep(1000);
      return;
   }
   if (ai_0 == 3) {
      ld_8 = g_ask_500 + Pips.Distance.From.Price * gd_808;
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_BUYSTOP, YpologisePosothta(), NormalizeDouble(ld_8, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Buy Stop Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(ld_8, g_digits_536), "     SL=", NormalizeDouble(gd_1088, g_digits_536), "    TP=", NormalizeDouble(ld_8 +
            gi_704 * gd_808, g_digits_536), "   ", Period() + " min  S&R");
         return;
      }
      gi_unused_772 = 1;
      Sleep(1000);
      return;
   }
   if (ai_0 == 4) {
      ld_8 = g_bid_508 - Pips.Distance.From.Price * gd_808;
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_SELLSTOP, YpologisePosothta(), NormalizeDouble(ld_8, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Sell Stop Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(ld_8, g_digits_536), "     SL=", NormalizeDouble(gd_1080, g_digits_536), "    TP=", NormalizeDouble(ld_8 - gi_704 * gd_808, g_digits_536), "   ", Period() +
            " min  S&R");
         return;
      }
      gi_unused_772 = 2;
      Sleep(1000);
      return;
   }
   if (ai_0 == 5) {
      ld_8 = g_bid_508 - Pips.Distance.From.Price * gd_808;
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_BUYLIMIT, YpologisePosothta(), NormalizeDouble(ld_8, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Buy Limit Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(ld_8, g_digits_536), "     SL=", NormalizeDouble(gd_1088, g_digits_536), "    TP=", NormalizeDouble(ld_8 +
            gi_704 * gd_808, g_digits_536), "   ", Period() + " min  S&R");
         return;
      }
      gi_unused_772 = 1;
      Sleep(1000);
      return;
   }
   if (ai_0 == 6) {
      ld_8 = g_ask_500 + Pips.Distance.From.Price * gd_808;
      g_count_760 = 0;
      while (g_count_760 < 10 && !IsTradeAllowed() || IsTradeContextBusy()) {
         g_count_760++;
         Sleep(1000);
         Print("Trade context busy... Waiting for broker");
      }
      l_ticket_16 = OrderSend(Symbol(), OP_SELLLIMIT, YpologisePosothta(), NormalizeDouble(ld_8, g_digits_536), Slippage, 0, 0, Period() + " min  S&R", 0, 0, Aqua);
      if (l_ticket_16 < 1) {
         Print("ERROR Opening Sell Limit Order: ", GetLastError(), "  Lots=", YpologisePosothta(), "   Entry=", NormalizeDouble(ld_8, g_digits_536), "     SL=", NormalizeDouble(gd_1080, g_digits_536), "    TP=", NormalizeDouble(ld_8 - gi_704 * gd_808, g_digits_536), "   ", Period() +
            " min  S&R");
         return;
      }
      gi_unused_772 = 2;
      Sleep(1000);
   }
}

string FtiaxeTisOres(int ai_0, int ai_4, int ai_8, int ai_12, int ai_16, int ai_20) {
   string ls_24 = ai_4 + 100;
   ls_24 = StringSubstr(ls_24, 1);
   string ls_32 = ai_8 + 100;
   ls_32 = StringSubstr(ls_32, 1);
   string ls_40 = ai_12 + 100;
   ls_40 = StringSubstr(ls_40, 1);
   string ls_48 = ai_16 + 100;
   ls_48 = StringSubstr(ls_48, 1);
   string ls_56 = ai_20 + 100;
   ls_56 = StringSubstr(ls_56, 1);
   return (StringConcatenate(ai_0, ".", ls_24, ".", ls_32, " ", ls_40, ":", ls_48, ":", ls_56));
}