TaLibStandard icon indicating copy to clipboard operation
TaLibStandard copied to clipboard

Not sure, but seems a bug to me

Open lousadacbc opened this issue 1 year ago • 1 comments

https://github.com/phmatray/TaLibStandard/blob/6d23694d4b71866883b369d2222e7e7b5de0a432/src/TechnicalAnalysis.Candles/Candle3WhiteSoldiers/Candle3WhiteSoldiers.cs#L75

I'm trying identify patterns right after market opens, in 5 minutes candles. For instance, when I run GetLookback() for Candle3WhiteSoldiers, I got 12, so What I understand is that I have to have 12 5 minute candles to be able to identify this pattern. In other words, I can only identify it after 60 minutes, and I wanted to identify it in the first 20 to 30 minutes. Is it possible to change it to a shorter interval?

The bug I think exists is:

If we don't have enough candles to identify the pattern, it shouldn't return a success message here, but an error message, am I right?

    // Identify the minimum number of price bar needed to calculate at least one output.
    int lookbackTotal = GetLookback();

    // Move up the start index if there is not enough initial data.
    if (startIdx < lookbackTotal)
    {
        startIdx = lookbackTotal;
    }

    // Make sure there is still something to evaluate.
    if (startIdx > endIdx)
    {
        return new CandleIndicatorResult(**Success**, outBegIdx, outNBElement, outInteger);
    }

If I'm wrong, I apologize, I'm a little rusty with programming. Thanks, and nice job

lousadacbc avatar Nov 13 '23 19:11 lousadacbc

Hello @lousadacbc Here is the original C file wrote by Angelo Ciceri https://github.com/TA-Lib/ta-lib/blob/main/src/ta_func/ta_CDL3WHITESOLDIERS.c

I will investigate.

Thanks

phmatray avatar Nov 27 '23 10:11 phmatray