example-scalping icon indicating copy to clipboard operation
example-scalping copied to clipboard

Signal Loss Threat

Open mondaysunrise opened this issue 5 years ago • 1 comments

Hey, saw your Medium article. Wonderful project.

Just wanted to clarify a danger of the algorithm with the line of code self._bars.rolling(20).mean().close.values

Assuming that internet connection is lost for a couple of minutes and then reconnected, the algorithm is gonna take all last 20 values and may calculate the timeframe wrong.

The collected bar data should always contain a timestamp to be overprotective here and avoid any wrong signals to be produced by checking if there are all bars of the last 20 minutes available and only calculating under these conditions. Makes your algo saver. :)

Keep up the good work and good luck making money with this.

My kindest regards,

mondaysunrise avatar Feb 18 '20 08:02 mondaysunrise

Anyways, there should not only be this kind of protection in case of connection loss for calculating the signal but in general, or did I oversee this being already implemented?

mondaysunrise avatar Feb 18 '20 08:02 mondaysunrise