Esempio n. 1
0
        public void CheckVersion()
        {
            Tasks.ForEach(t => t.Port(Version));
            Targets.ForEach(t => t.Port(Version));

            Version = ProgramVersion.Basic101;
        }
 /// <summary>
 /// The default constructor.
 /// </summary>
 static Data()
 {
     IndicatorsForBacktestOnly = new[]
     {
         "Random Filter",
         "Date Filter",
         "Data Bars Filter",
         "Lot Limiter"
     };
     PositionOpenTime = DateTime.MinValue;
     PositionType     = -1;
     BalanceData      = new BalanceChartUnit[BalanceLenght];
     LibraryVersion   = "unknown";
     ExpertVersion    = "unknown";
     TerminalName     = "MetaTrader";
     PointChar        = '.';
     DFS = "dd.MM";
     DF  = "dd.MM.yy";
     AutoUsePrvBarValue  = true;
     SourceFolder        = @"Custom Indicators\";
     LoadedSavedStrategy = "";
     FirstBar            = 40;
     StrategyName        = "New.xml";
     StrategyDir         = @"Strategies\";
     DefaultStrategyDir  = @"Strategies\";
     ColorDir            = @"Colors\";
     LanguageDir         = @"Languages\";
     SystemDir           = @"System\";
     ProgramDir          = @"";
     IsProgramBeta       = false;
     IsStrategyChanged   = false;
     Debug       = false;
     IsData      = false;
     IsConnected = false;
     IsAutoStart = false;
     StartAutotradeWhenConnected = false;
     ConnectionID       = 0;
     PositionComment    = "";
     PositionProfit     = 0;
     PositionTakeProfit = 0;
     PositionStopLoss   = 0;
     PositionOpenPrice  = 0;
     PositionLots       = 0;
     PositionTicket     = 0;
     WrongStopsRetry    = 0;
     WrongTakeProf      = 0;
     WrongStopLoss      = 0;
     SecondsLiveTrading = 0;
     SavedStrategies    = 0;
     SecondsDemoTrading = 0;
     LiveTradeStartTime = DateTime.Now;
     DemoTradeStartTime = DateTime.Now;
     ProgramName        = "Forex Strategy Trader";
     ProgramVersion     = Application.ProductVersion;
     string[] asVersion = ProgramVersion.Split('.');
     ProgramID = 1000000 * int.Parse(asVersion[0]) + 10000 * int.Parse(asVersion[1]) +
                 100 * int.Parse(asVersion[2]) + int.Parse(asVersion[3]);
     Strategy.GenerateNew();
     StackStrategy = new Stack <Strategy>();
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes the main form
        /// </summary>
        /// <param name="version">The user-selected program version</param>
        public frmMain(ProgramVersion version)
        {
            InitializeComponent();

            // Finally, initialize the program
            Initialize(version);
        }
Esempio n. 4
0
        private void CheckProgramVersion()
        {
            LOG.Debug("CheckProgramVersion()-RandomizerVersion: " + Application.ProductVersion);
            ProgramVersion versionInfo = WGAPI.GetProgramVersion();

            ChangeLog         = versionInfo.ChangeLog;
            RandomizerVersion = versionInfo.Version;

            DateTime updateDate = new DateTime();

            updateDate = DateTime.Parse(versionInfo.Updated);
            if (!versionInfo.Version.Equals(Application.ProductVersion))
            {
                LOG.Debug("New version available.");
                string cc        = Properties.Settings.Default.Locale;
                string msg       = "The new version " + RandomizerVersion + " is available as per " + Commons.ConvertDateToLocalFormat(updateDate, cc) + "\nDo You want to download it now?";
                var    userInput = MessageBox.Show(msg, "New version of the WoWs Randomizer available!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (userInput == DialogResult.Yes)
                {
                    LOG.Debug("User requested download of new Randomizer version");
                    string downloadsPath = KnownFolders.GetPath(KnownFolder.Downloads);
                    string fileName      = downloadsPath + "\\" + Path.GetFileName(System.Reflection.Assembly.GetEntryAssembly().Location);
                    using (WebClient wc = new WebClient())
                    {
                        wc.DownloadFile(versionInfo.URL, fileName);
                        MessageBox.Show("The new version has been downloaded to Your download folder.\n(" + fileName + ")\nClose this program and replace the EXE-file in this folder with the downloaded one.", "New version downloaded", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        LOG.Debug("Download complete.");
                    }
                }
            }
        }
Esempio n. 5
0
        public ProgramFinder Add(ProgramVersion program)
        {
            ProgramFinder finder = new ProgramFinder(program);

            InnerList[program] = finder;
            return(finder);
        }
Esempio n. 6
0
 /// <summary>
 /// Format the data section of a SEEVSE startup record.
 /// </summary>
 /// <returns>String representation of a SEEVSE startup record.</returns>
 public override string ToString()
 {
     return(CpuId.PadRight(17, ' ')
            + "  " + ProgramId.PadRight(8 + 2, ' ')
            + "  " + ProgramVersion.PadRight(8, ' ')
            + "  " + DateFormatter(StartTime).PadRight(FIELD_DATE_LENGTH, ' '));
 }
Esempio n. 7
0
        public void Port(ProgramVersion oldVersion)
        {
            if (oldVersion > ProgramVersion.Basic10)
            {
                return;
            }

            Condition.Port(oldVersion);
        }
Esempio n. 8
0
        /// <summary>
        ///     The default constructor.
        /// </summary>
        static Data()
        {
            Icon                      = Resources.Icon;
            PointChar                 = '.';
            Dfs                       = "dd.MM";
            Df                        = "dd.MM.yy";
            AutoUsePrvBarValue        = true;
            FirstBar                  = 40;
            PeriodColor               = new Dictionary <DataPeriod, Color>();
            AdditionalFolder          = "Additional" + Path.DirectorySeparatorChar;
            SourceFolder              = "Indicators" + Path.DirectorySeparatorChar;
            DefaultStrategyDir        = "Strategies" + Path.DirectorySeparatorChar;
            ColorDir                  = "Colors" + Path.DirectorySeparatorChar;
            LanguageDir               = "Languages" + Path.DirectorySeparatorChar;
            SystemDir                 = "System" + Path.DirectorySeparatorChar;
            LibraryDir                = "Libraries" + Path.DirectorySeparatorChar;
            UserFilesDir              = "User Files";
            ProgramName               = "Forex Strategy Builder";
            IsProgramReleaseCandidate = false;
            IsProgramBeta             = false;
            LoadedSavedStrategy       = "";
            StrategyName              = "New.xml";
            StrategyDir               = "Strategies" + Path.DirectorySeparatorChar;
            OfflineDocsDir            = "Docs" + Path.DirectorySeparatorChar;
            DefaultOfflineDataDir     = "Data" + Path.DirectorySeparatorChar;
            OfflineDataDir            = "Data" + Path.DirectorySeparatorChar;
            Debug                     = false;
            IsData                    = false;
            IsResult                  = false;
            IsStrategyChanged         = false;
            StackStrategy             = new Stack <Strategy>();
            GeneratorHistory          = new List <Strategy>();
            ProgStats                 = new ProgStats {
                AppLicenseType = LicenseType.Valid
            };
            ProgStats.AppStart("980834a958e961563091a670660243e7dd17d543");
            IsIntrabarData = false;
            SingleOrder    = false;
            WorkingMinutes = 0;
            MaxDD          = 100;
            MM             = 0;
            AutoSave       = false;
            AutoMM         = false;
            AutoOptimize   = "";

            // Program's Major, Minor, Version and Build numbers must be <= 99.
            ProgramVersion = Application.ProductVersion;
            string[] version = ProgramVersion.Split('.');
            ProgramId = 1000000 * int.Parse(version[0]) +
                        10000 * int.Parse(version[1]) +
                        100 * int.Parse(version[2]) +
                        1 * int.Parse(version[3]);
            Strategy.GenerateNew();
        }
Esempio n. 9
0
        /// <summary>
        ///     The default constructor.
        /// </summary>
        static Data()
        {
            Icon                      = Resources.Icon;
            PointChar                 = '.';
            Dfs                       = "dd.MM";
            Df                        = "dd.MM.yy";
            AutoUsePrvBarValue        = true;
            FirstBar                  = 40;
            PeriodColor               = new Dictionary <DataPeriod, Color>();
            AdditionalFolder          = "Additional" + Path.DirectorySeparatorChar;
            SourceFolder              = "Indicators" + Path.DirectorySeparatorChar;
            DefaultStrategyDir        = "Strategies" + Path.DirectorySeparatorChar;
            ColorDir                  = "Colors" + Path.DirectorySeparatorChar;
            LanguageDir               = "Languages" + Path.DirectorySeparatorChar;
            SystemDir                 = "System" + Path.DirectorySeparatorChar;
            LibraryDir                = "Libraries" + Path.DirectorySeparatorChar;
            UserFilesDir              = "User Files";
            ProgramName               = "Forex Strategy Builder";
            IsProgramReleaseCandidate = false;
            IsProgramBeta             = false;
            LoadedSavedStrategy       = "";
            StrategyName              = "New.xml";
            StrategyDir               = "Strategies" + Path.DirectorySeparatorChar;
            OfflineDocsDir            = "Docs" + Path.DirectorySeparatorChar;
            DefaultOfflineDataDir     = "Data" + Path.DirectorySeparatorChar;
            OfflineDataDir            = "Data" + Path.DirectorySeparatorChar;
            Debug                     = false;
            IsData                    = false;
            IsResult                  = false;
            IsStrategyChanged         = false;
            StackStrategy             = new Stack <Strategy>();
            GeneratorHistory          = new List <Strategy>();
            IsIntrabarData            = false;

            // Program's Major, Minor, Version and Build numbers must be <= 99.
            ProgramVersion = Application.ProductVersion;
            string[] version = ProgramVersion.Split('.');
            ProgramId = 1000000 * int.Parse(version[0]) +
                        10000 * int.Parse(version[1]) +
                        100 * int.Parse(version[2]) +
                        1 * int.Parse(version[3]);

            if (int.Parse(version[1]) % 2 != 0)
            {
                IsProgramBeta = true;
            }

            Strategy.GenerateNew();
        }
        private void VersionCheck()
        {
            if (ProgramVersion.IsLastestVer())
            {
                return;
            }

            MessageBoxResult MsgRes = MessageBox.Show("최신 버전이 아닙니다.최신 버전을 다운받으시겠습니까?", "VersionCheck", MessageBoxButton.YesNo);

            if (MsgRes == MessageBoxResult.Yes)
            {
                System.Diagnostics.Process.Start(ProgramVersion.GetLeastURL());
                this.Close();
            }
        }
Esempio n. 11
0
        public void Port(ProgramVersion oldVersion)
        {
            if (oldVersion > ProgramVersion.Basic10)
            {
                return;
            }

            if (Symbol == '-')
            {
                Symbol = BlockedSymbol;
            }

            if (Symbol == 'X')
            {
                Symbol = FailedSymbol;
            }
        }
Esempio n. 12
0
        private static ProgramVersion ConvertFromOldVersion(string jsonText)
        {
            ProgramVersion    imp = new ProgramVersion();
            ProgramVersionOLD old = JsonConvert.DeserializeObject <ProgramVersionOLD>(jsonText);

            imp.Status  = old.Status;
            imp.Version = old.Version;
            imp.Updated = old.Updated;
            imp.URL     = old.URL;
            ProgramVersionLog log = new ProgramVersionLog();

            log.Date    = old.Updated;
            log.Version = old.Version;
            log.Log     = new List <string>();
            log.Log.AddRange(old.ChangeLog);

            imp.ChangeLog = new List <ProgramVersionLog>();
            imp.ChangeLog.Add(log);
            return(imp);
        }
Esempio n. 13
0
        public static ProgramVersion GetProgramVersion()
        {
            using (WebClient wc = new WebClient())
            {
                String jsonFile = Commons.GetCurrentDirectory() + "/randomizer.json";
                wc.DownloadFile("https://onedrive.live.com/download?cid=919CD8D21AC2180D&resid=919CD8D21AC2180D%2116427&authkey=AOg1igxPEZw9EWw", jsonFile);
                string jsonText = File.ReadAllText(jsonFile);

                ProgramVersion Import = null;
                if (IsOldVersion(jsonText))
                {
                    Import = ConvertFromOldVersion(jsonText);
                }
                else
                {
                    Import = JsonConvert.DeserializeObject <ProgramVersion>(jsonText);
                }
                return(Import);
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Initializes the Dragonium UI
        /// </summary>
        private void InitializeUI(ProgramVersion version)
        {
            if (version == ProgramVersion.Metro)
            {
                var stripRenderer = new DragoniumStripRenderer();

                this.menuMain.Renderer = stripRenderer;
                this.statusMain.Renderer = stripRenderer;
                this.toolsMain.Renderer = stripRenderer;
            }
            else if (version == ProgramVersion.OldFashioned)
            {
                foreach (Control control in this.Controls)
                {
                    if (control is MenuStrip || control is ToolStrip || control is StatusStrip)
                        (control as ToolStrip).RenderMode = ToolStripRenderMode.System;
                }
            }
        }
Esempio n. 15
0
 public ProgramFinder Add(ProgramVersion program) {
     ProgramFinder finder = new ProgramFinder(program);
     InnerList[program] = finder;
     return finder;
 }
 private void Label_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     MessageBox.Show(ProgramVersion.CopyRight());
 }
Esempio n. 17
0
 public void Port(ProgramVersion oldVersion)
 {
 }
Esempio n. 18
0
        /// <summary>
        /// Initializes stuff.
        /// </summary>
        /// <param name="version"></param>
        private void Initialize(ProgramVersion version)
        {
            this.AboutForm = new frmAbout();

            // Finally, initialize the UI
            InitializeUI(version);
        }