Design of Function of Technical Analysis (Part I)

As the basic atom for indicator computation, the function design for TA should consider:

  • It can be computed at any idx or time point, whenever -- computeSpot(int idx) or computeSpot(long time)
  • It can correspond to the Options change (Options are transfered in by the caller as reference)
  • It can remember the intermedial status of function instance to avoid redundant computation. The status includes
    • backward values (as it's a TimeSeries's variable)
    • the based Variables
    • the Options
    • the caller

Then an indicator instance can call it to:

  • compute from 'begIdx' to 'endIdx'
  • compute at point 'idx'
We can define an indicator's computing procedure as a computing session by provide a sessionId to it. The sessionId will also be the representer of function instance's caller mentioned above.

Comments

No comments.