PoorRican / tradr-rs

0 stars 0 forks source link

Formally test `process_graph_for_new_candles` #8

Closed PoorRican closed 3 months ago

PoorRican commented 3 months ago

In BBands.process_graph_for_new_candles, there is a small window of the indicator graph which is recalculated to get the indicator graph rows for the new candle data. This functionality should be formally tested to ensure that the calculation of a smaller window is the same as the calculation of the larger window.

The goal is to formally prove that new candles can be processed by passing in a subset of the candles, and that the internals work as expected.

This can be accomplished by creating a large dataframe of random numbers representing the candle data. The tail of the candle data is stored as a separate value. The indicator graph is computed for each. The last rows of the larger indicator graph should equal the smaller subset's computed graph.