<commit_before>﻿/*
 * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
 * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using QuantConnect.Data.UniverseSelection;

namespace QuantConnect.Data.Custom
{
    /// <summary>
    /// Helper data type for FXCM's public macro economic sentiment API.
    /// Data source used to create: https://www.dailyfx.com/calendar
    /// </summary>
    /// <remarks>
    /// Data sourced by <NAME>
    /// DailyFX provides traders with an easy to use and customizable real-time calendar that updates automatically during
    /// announcements.Keep track of significant events that traders care about.As soon as event data is released, the DailyFX
    /// calendar automatically updates to provide traders with instantaneous information that they can use to formulate their trading decisions.
    /// </remarks>
    public class DailyFx : BaseData
    {
        JsonSerializerSettings _jsonSerializerSettings;
        private string _previousContent;
        private readonly Dictionary<string, DailyFx> _previous = new Dictionary<string, DailyFx>();

        /// <summary>
        /// Title of the event.
        /// </summary>
        [JsonProperty(PropertyName = "title")]
        public string Title;

        /// <summary>
        /// Date the event was displayed on DailyFX
        /// </summary>
        [JsonProperty(PropertyName = "displayDate")]
        public DateTimeOffset DisplayDate;

        /// <summary>
        /// Time of the day the event was displayed.
        /// </summary>
        /// <remarks>
        ///  This is dated 1970, ignore the date component.
        /// </remarks>
        [JsonProperty(PropertyName = "displayTime")]
        public DateTimeOffset DisplayTime;

        /// <summary>
        /// Date/time of the event
        /// </summary>
        public DateTimeOffset EventDateTime
        {
            get { return DisplayDate.Date.Add(DisplayTime.TimeOfDay); }
        }

        /// <summary>
        /// Importance assignment from FxDaily API.
        /// </summary>
        [JsonProperty(PropertyName = "importance")]
        public FxDailyImportance Importance;

        /// <summary>
        /// What is the perceived meaning of this announcement result?
        /// </summary>
        [JsonProperty(PropertyName = "better")]
        [JsonConverter(typeof(DailyFxMeaningEnumConverter))]
        public FxDailyMeaning Meaning;

        /// <summary>
        /// Currency for this event.
        /// </summary>
        [JsonProperty(PropertyName = "currency")]
        public string Currency;

        /// <summary>
        /// Realized value of the economic tracker
        /// </summary>
        [JsonProperty(PropertyName = "actual")]<commit_msg>Fix bug in EventDataTime property<commit_after>﻿/*
 * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
 * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using QuantConnect.Data.UniverseSelection;

namespace QuantConnect.Data.Custom
{
    /// <summary>
    /// Helper data type for FXCM's public macro economic sentiment API.
    /// Data source used to create: https://www.dailyfx.com/calendar
    /// </summary>
    /// <remarks>
    /// Data sourced by <NAME>
    /// DailyFX provides traders with an easy to use and customizable real-time calendar that updates automatically during
    /// announcements.Keep track of significant events that traders care about.As soon as event data is released, the DailyFX
    /// calendar automatically updates to provide traders with instantaneous information that they can use to formulate their trading decisions.
    /// </remarks>
    public class DailyFx : BaseData
    {
        JsonSerializerSettings _jsonSerializerSettings;
        private string _previousContent;
        private readonly Dictionary<string, DailyFx> _previous = new Dictionary<string, DailyFx>();

        /// <summary>
        /// Title of the event.
        /// </summary>
        [JsonProperty(PropertyName = "title")]
        public string Title;

        /// <summary>
        /// Date the event was displayed on DailyFX
        /// </summary>
        [JsonProperty(PropertyName = "displayDate")]
        public DateTimeOffset DisplayDate;

        /// <summary>
        /// Time of the day the event was displayed.
        /// </summary>
        /// <remarks>
        ///  This is dated 1970, ignore the date component.
        /// </remarks>
        [JsonProperty(PropertyName = "displayTime")]
        public DateTimeOffset DisplayTime;

        /// <summary>
        /// Date/time of the event
        /// </summary>
        public DateTime EventDateTime
        {
            get { return DisplayDate.Date.Add(DisplayTime.TimeOfDay); }
        }

        /// <summary>
        /// Importance assignment from FxDaily API.
        /// </summary>
        [JsonProperty(PropertyName = "importance")]
        public FxDailyImportance Importance;

        /// <summary>
        /// What is the perceived meaning of this announcement result?
        /// </summary>
        [JsonProperty(PropertyName = "better")]
        [JsonConverter(typeof(DailyFxMeaningEnumConverter))]
        public FxDailyMeaning Meaning;

        /// <summary>
        /// Currency for this event.
        /// </summary>
        [JsonProperty(PropertyName = "currency")]
        public string Currency;

        /// <summary>
        /// Realized value of the economic tracker
        /// </summary>
        [JsonProperty(PropertyName = "actual")]
{'fraction_non_alphanumeric': 0.09886363636363636, 'fraction_numerical': 0.003977272727272727, 'mean_word_length': 2.466765140324963, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6247842', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1693, 'n_words': 633}