Skip to content

undefined properties & setup idx increments #1

@zapphyre

Description

@zapphyre

I have two insides for you:

in your countdown methods you are referring to item's TDSTBuy/TDSTSell propertis, but item here is the ohlc bar so you have them undefined.

you may notice, your setup indexes are all zeros up to nine iteration. (that's from your test). This is because you have implemented conditions needed to turn true quite complex. I refer to these lines:

      let closeLessThanCloseOf4BarsEarlier = ohlc[i].close < ohlc[i - 4].close;
...
      resultObj.bearishFlip = ohlc[i - 1].close > ohlc[i - 5].close && closeLessThanCloseOf4BarsEarlier;
...
      if (resultObj.bearishFlip || (result[i - 1].buySetupIndex > 0 && closeLessThanCloseOf4BarsEarlier)) 
        resultObj.buySetupIndex = (result[i - 1].buySetupIndex + 1 - 1) % 9 + 1;

as I understand TDSequential you don't need that complex conditions. if you would have setup increments based on the closeLessThanCloseOf4BarsEarlier conditions, you will have setup numbers after first four candles.
So can you give me your reasoning for this implementation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions