iterativv / NostalgiaForInfinity

Trading strategy for the Freqtrade crypto bot
GNU General Public License v3.0
2k stars 498 forks source link

Buy with even lower price #229

Open avibrazil opened 2 years ago

avibrazil commented 2 years ago

I noticed that after a buy signal, prices almost always drop quite a few more percent points.

So my question is if there is a way to make the buy signal wait a few more price percent point drops to only then actually buy the asset.

iterativv commented 2 years ago

Some times do, some times not. The thing is that we can't predict the future. The algorithm calculated that there is potential for the specific pair.

if we wait, we will miss many trades.

iterativv commented 2 years ago

Plus, after a buy, you have to consider -0.5% -1% drop right away, because the fees (both ways), spread and probably slippage.

avibrazil commented 2 years ago

I understand what your are saying and it makes sense.

But let me insist a bit, because I keep seeing the large amount of trades to drop a lot after buying.

I was thinking to play with unfilledtimeout.entry (increasing it) and with entry_pricing.order_book_top. Something like this in config.json:

"unfilledtimeout": {
        "entry": 25      // freqtrade default is 15 min
},

"entry_pricing": {
        "price_side": "bid",       // default is other
        "use_order_book": true,    // default is false
        "order_book_top": 5        // default is 1
}

This way it will buy with a lower price (5 positions down the order book) and will wait a little longer to fulfill. Even if it loses some opportunities, maybe the profit increase of the optimized trades will pay off.

I guess this is something that can't be simulated because there is no order book data during simulations. But, I'd like to ask you, if you can, in your simulations, to count how many trades (percentage) have a price drop after entry, and the speed of the price drop. This kind of conclusions can optimize these 2 numbers that I came with random values (25 minutes and 4th in order book).

It all depends on what the moving averages are telling you. Even without having the ability to predict the future.

Thank you very much for such an effective strategy.

myNextCoder commented 2 years ago

Hello avibrazil, I thank you for this idea. I currently have a test-bot with NFIX and your above configuration. The bot is not yet able to enter, it cancels all orders. Have you got better results?

avibrazil commented 2 years ago

I tried this config with a real Huobi bot. But this exchange has a freqtrade bug that killed the bot when orders were canceled, so I went back to regular operation. They fixed the Huobi-related bot but I didn't upgrade to newer freqtrade.

I didn't test it enough.