//**************************************************************************************

    /// <summary>
    /// Returns true if given parameter exist in provided list.
    /// </summary>
    public static bool Exist(List <ClassifierParameter> iParameters, ClassifierParameter iParameter)
    => !(iParameters.FirstOrDefault(x => x.Equals(iParameter)) is null);
Beispiel #2
0
    //**************************************************************************************

    /// <summary>
    /// Calculates and returns prediction using provided candlesticks and their last values as current time.
    /// </summary>
    /// <param name="iCurrentPrice">Last known price.</param>
    public Prediction Predict(CandlestickCollection iCandlesticks, float iCurrentPrice, CandlestickIndexCollection iCandlestickIndex = null)
    {
        WaitTillModelReady();

        return(Predict(ClassifierParameter.CalculateParameters(Parameters, iCandlesticks, Period, iCurrentPrice, iCandlestickIndex)));
    }
    //**************************************************************************************

    public bool Equals(ClassifierParameter iOther)
    {
        return(Type == iOther.Type && Periods == iOther.Periods &&
               Attributes.Count == iOther.Attributes.Count &&
               Attributes.SequenceEqual(iOther.Attributes));
    }