joeldg / bowhead

PHP trading bot framework
Apache License 2.0
801 stars 288 forks source link

Fix downcross upcross calculation #41

Closed lploumen closed 7 years ago

lploumen commented 7 years ago

Should fix issue #21 Seems downcross and upcross and not correctly computed. @joeldg Can you check ?

lploumen commented 7 years ago

Hi Joel,

Problem is the current code does not correctly detect line crosses. For instance, in this chart ETH/EUR kraken of today: image

Current code does not detect any line cross at 16:30: image

With the proposed solution it gives perfects results:

image

For me it seems clear that if the priorsma40 <= priorsma6 and the current sma40 is > current sma6, lines just crossed. Or am I missing something ?

rxmg-joeldg commented 7 years ago

oh.. you are correct in this, the naming scheme messed me up here.