/// <summary> /// Tries to initialize the User Selected Strategy /// </summary> /// <param name="index">Selected Index</param> public void RunStrategy(int index) { try { // Create new object to pass to event aggregator VerfiyParameters verfiyParameters = new VerfiyParameters(index); // Publish event to notify listeners EventSystem.Publish <VerfiyParameters>(verfiyParameters); } catch (Exception exception) { Logger.Error(exception, _type.FullName, "RunStrategy"); } }
/// <summary> /// Tries to initialize the User Selected Strategy /// </summary> /// <param name="ctorArgs">Constructor Arguments to be verified</param> public void RunStrategy(object[] ctorArgs) { try { // Create new object to pass to event aggregator VerfiyParameters verfiyParameters = new VerfiyParameters(-1); // Add arguments to be verified verfiyParameters.CtrArgs = ctorArgs; // Publish event to notify listeners EventSystem.Publish <VerfiyParameters>(verfiyParameters); } catch (Exception exception) { Logger.Error(exception, _type.FullName, "RunStrategy"); } }
/// <summary> /// Verfies the Selected set of Constructor Parameters for the Loaded Custom Strategy Assembly /// </summary> /// <param name="verfiyParameters">Contains info regarding the parameters to be verified</param> private void VerfiySelectedParameterValues(VerfiyParameters verfiyParameters) { try { // Verify the ctor args if provided to run strategy if (verfiyParameters.SelectedIndex.Equals(-1)) { var ctrArgs = VerfiySelectedArguments(verfiyParameters.CtrArgs); // Start normal strategy execution if (ctrArgs != null) { RunStrategy(ctrArgs); } } // Verify the ctor args if provided to run strategy optimization using GA else if (verfiyParameters.SelectedIndex.Equals(-2)) { var ctrArgs = VerfiySelectedArguments(verfiyParameters.CtrArgs); // Start normal strategy execution if (ctrArgs != null) { RunStrategyOptimizationGeneticAlgo(ctrArgs); } } // Verfiy the selected args from the given index to run strategy optimization using Brute Force else { var ctrArgs = VerfiySelectedArgumentsOnGivenIndex(verfiyParameters.SelectedIndex); // Start brute force optimizataion of the strategy if (ctrArgs != null) { RunStrategyOptimizationBruteForce(ctrArgs); } } } catch (Exception exception) { Logger.Error(exception, _type.FullName, "VerfiySelectedParameterValues"); } }