Algorithm #3 logic corrected.
Added optional arguments for setting thresholds

Now when using algorithm #3 it's possible to set buy and sell
thresholds, -tb and -ts accordingly.