joeldg / bowhead

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

Too much false buy/sell signal with macd in live trading #74

Closed vitoo closed 6 years ago

vitoo commented 6 years ago

Hello @rxmg-joeldg & happy new year ;)

When doing live crypto trading (period 2h) the macd sometime cross and uncross the signal line many times during 5 minutes

https://www.coinigy.com/s/i/5a4ac08784b39/

https://www.coinigy.com/s/i/5a4ac0c5c4f0f/

So it gives me false signal, a lot of buy,sell, buy, sell in some minutes

It's easy in backtesting there is only one signal per candle, in live testing, the signal can change during the candle.

Maybe i should use a 15 min period and multiply the macd period (15x8 = 2h) and not count the last candle in signal as it's changing too much.

I dont know how to handle this, have you any idea ?

Thanks for your help

rxmg-joeldg commented 6 years ago

A lot of this could be the data source you are using. I will add a note to look at this.

On Mon, Jan 1, 2018 at 6:20 PM, Victorien Plancke notifications@github.com wrote:

Hello @rxmg-joeldg https://github.com/rxmg-joeldg & happy new year ;)

When doing live crypto trading (period 2h) the macd sometime cross and uncross the signal line many times during 5 minutes

https://www.coinigy.com/s/i/5a4ac08784b39/

https://www.coinigy.com/s/i/5a4ac0c5c4f0f/

So it gives me false signal, a lot of buy,sell, buy, sell in some minutes

I dont know how to handle this

It's easy in backtesting there is only one signal per candle, in live testing, the signal can change during the candle.

Maybe i should use a 15 min period and multiply the macd period (8x15 = 2h) and not count the last candle in signal as it's changing too much.

Thanks for your help

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/joeldg/bowhead/issues/74, or mute the thread https://github.com/notifications/unsubscribe-auth/AOT1lfU1Fwd8KA7uqcO54NZ0jeab1kX8ks5tGWg6gaJpZM4RQM4N .

-- Joel De Gan Vice President of Technology


Mobile: (646) 724-0451 Email: joeldg@rxmg.com Skype: joel-dg

2320 Abbot Kinney Blvd, Suite A Venice, CA 90291 www.RxMG.com http://www.rxmg.com/

vitoo commented 6 years ago

I use real candle data from bittrex / coinigy (url is in coinigy chart page, look for xhr call)

vitoo commented 6 years ago

The thing is in live, macd may cross up (histogram positive), but candle suddenly turn red (dump) and macd de-cross (histo negativ)

vitoo commented 6 years ago

So i think the solution may be

sleep 30 min (for my 2 hour period) at the end of the bot loop

The same for lower period ex : 1h > 15 min wait

rxmg-joeldg commented 6 years ago

So, I am doing some heavy work to integrate coinigy and also ccxt (mutually exclusive however) to Bowhead... so if you are a coinigy user, this will be a good experience for you.. I am looking for some coinigy testers if you are interested..

vitoo commented 6 years ago

I will test and feedback if you need