Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined properties & setup idx increments #1

Open
zapphyre opened this issue Apr 21, 2019 · 0 comments
Open

undefined properties & setup idx increments #1

zapphyre opened this issue Apr 21, 2019 · 0 comments

Comments

@zapphyre
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant