iterativv / NostalgiaForInfinity

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

Some question / information - for noob users #394

Open Jorman opened 6 months ago

Jorman commented 6 months ago

Hello, I have recently approached this world and it is all new to me, where I can, I look for information and try to understand how everything works, other times however I feel the need to have to ask those who are more experienced, so I apologize if some of my questions may seem trivial or even stupid. I got to know this site thanks to an old NFI5 strategy, I tried backtests on both the old and X4 and I renew my compliments, really! So I decided to put the X4 version live, replacing the old version, I have two open orders in slight loss, we will see what happens :) From the backtests, both on random coins and on the suggested white list, it seems to me that X4 makes far fewer bets but "fails" significantly less

  1. For the NFIX4 strategy on binance I used the recommended blacklist, however, I have questions about the configuration: I currently use this as an entry/exit price, do you think this is a problem? I saw that the recommended configuration is different, reverses the buy side, I think just to try to close the order as soon as possible, is that right or is there a reason I'm missing?

    "entry_pricing": {
        "price_side": "same",
        "ask_last_balance": 0,
        "use_order_book": true,
        "order_book_top": 1,
        "check_depth_of_market": {
            "enabled": false,
            "bids_to_ask_delta": 1
        }
    },
    "exit_pricing": {
        "price_side": "same",
        "use_order_book": true,
        "order_book_top": 1
    },
  2. In the strategy file, at line 1849, I find for example regular_mode_stake_multiplier_spot, then there are other "configurations", do I have to set something in the strategy configuration file or does the script do everything by itself and decide what to do? These seem to me to be methods of use, but I have not found any information about them

  3. Why is it advisable to use so many coin pairs? I tried with the recommended configuration but I'm afraid that my nas is slow to handle this, if I saw correctly, at every refresh, every minute then, it "shuffles" the coin pairs and downloads all the information again, 1d, 1h, 5m, etc., right? So if for example I have 60 pairs of coins and it takes 1.05 seconds on average for each pair, that means it will never finish downloading and analyzing the data, before the next cycle, and in that case I have to decrease the pairs, is that right or am I doing it wrong?

  4. What happens when it shuffles the pairs? Let me explain, I understand that they are shuffled as an order, but if the setup has a maximum of 5 orders, does the bot only analyze the first 5 pairs and then it makes sense to shuffle them or does it always analyze all 40 or 50 or whatever and then it can open an order even on the pair that occupies position 23 for example? I'm just trying to understand the logic What is "wrong" or not advisable in this list?

    "pairlists": [
        {
            "method": "VolumePairList",
            "number_assets": 100,
            "sort_key": "quoteVolume",
            "refresh_period": 1800
        },
        {"method": "FullTradesFilter"},
        {"method": "AgeFilter", "min_days_listed": 30},
        {"method": "PrecisionFilter"},
        {"method": "PriceFilter", "low_price_ratio": 0.01},
        {"method": "SpreadFilter", "max_spread_ratio": 0.005},
        {
            "method": "RangeStabilityFilter",
            "lookback_days": 10,
            "min_rate_of_change": 0.01,
            "refresh_period": 86400
        },
        {
            "method": "VolatilityFilter",
            "lookback_days": 10,
            "min_volatility": 0.05,
            "max_volatility": 0.50,
            "refresh_period": 86400
        },
        {
            "method": "VolumePairList",
            "number_assets": 75,
            "sort_key": "quoteVolume"
        },
        {"method": "ShuffleFilter"}
    ],

    I take the first 100 coins per volume, remove the new ones that are perhaps unstable and have exaggerated pumps that are likely to cause me to lose, I then apply the PrecisionFilter here this actually can be removed since the stoploss is totally handled by the script! RangeStabilityFilter and VolatilityFilter are not meant to keep only the stable coins? Why is it advisable to remove them instead? I would hazard a guess that all stoplosses handle various situations well and you can risk from unstable coins and maybe even gain something from them. Am I wrong?

Now I let X4 go for a few days, should I expect some trades? Or does it need more time to collect the information it needs to trade?

J

iterativv commented 5 months ago

Hello. First thing, X4 will handle old trades. Depends how low, for new trades, if they dip (to around -12% now, there is de-risk it drops all allowed stake, then is going to recovering with grinding - partial entries and exits).

Your config is all right, though, maybe change same to other there. See configs dir here, exampleconfig.

I have some bots on slow VPSs, that each loop take 4+ minutes. That works too, sure this is not ideal, but it can do t he job.

You don't have to change anything in your config, the default settings is what I use too. Just make sure you have updated X4 file.

And yes, new trades should happen, depending on conditions, the pairs currently in list and so on.

Now with latest NFI, you can even remove the two price filters, volatility, volume. Again, check configs dir, blacklists & volume pairlists for many exchanges there. The shuffle meant to randomize the order of pairs, it's not really important for NFI right now.

If there are signals, then you can get trades right after you start the bot. You can restart it anytime too, for NFI updates and so on.

Decide how many pairs to use, just not too low ... 40+ is all right. Depending on your machine. Or if the default 75 work, then everything good.

Jorman commented 5 months ago

Hi, thanks for the replies, I have modified everything to be aligned with what you told me. I will keep X4 updated, with the stable versions I guess, not with the pushes you do daily, am I wrong? It's been doing small position increases for two days now, it's not losing that much but it hasn't recovered yet, as I said it keeps increasing the position

ID     Pair      Since    Profit (USD)      # Entries
-----  --------  -------  --------------  -----------
31     YGG/USDT  2 d      -3.70% (-0.56)            2
35     REI/USDT  1 d      -6.34% (-0.35)            4
36     KEY/USDT  1 d      -3.71% (-0.28)            1
-----  --------  -------  --------------  -----------
Total                     -1.18 USD

However, by doing so, it seems to me that he no longer has enough stack to place more orders, the whole thing was "balanced" for 5 orders, he made 3 and with the increase in positions he eroded the margin to open more. I'm speaking as a non-expert, but in these cases, wouldn't it be better to "free up" slots, maybe the ones that are losing the least and open other positions that are perhaps more profitable?

Can I ask you a question? At line 182 I find grinding_enable = True but I couldn't find any reference in the strategy, is it maybe a new and future function?

Thanks for the suggestions, I'll just let it go like that and see what happens

J

iterativv commented 5 months ago

Yes, as for the grinding_enable now is required. Basically NFI is going to be crippled without.

The extra orders now for the open pairs are going to partial exit, usually at 1.8% + profit. So it will free stake for extra trades or more grinds. There is de-risk also, if drop to about -11% in stake, it's going to exit all allowed, then go on grinding to recover this.

And yes, update with releases is good.

Jorman commented 5 months ago

Ok, thank you for the info. With the actual system, I can handle max 31/33 pairs without having the message for old data, but I'll take a new system. I'll make a simple bash script to retrieve always the latest version and restart my docker, maybe in future I'll switch to a script linked that grab only the latest release by tags.

Thanks

anglol commented 5 months ago

Hi,

Out of context 😬

I have some bots on slow VPSs, that each loop take 4+ minutes.

How can I measure this on my VPS ?

Thanks !

Jorman commented 5 months ago

I think just start freqtrad with in verbose mode -v, --verbose Verbose mode (-vv for more, -vvv to get all messages). then just look in the log, how long it takes between pairs Am I wrong?

Also I've a question I live in euro area, but if I deposit on binance, dollars are credited. Is it better for me to trade in dollars, euros or doesn't it change anything?

Jorman commented 5 months ago

@anglol Yes I think is right, I ran freqtrade in verbose mode, so after I while I opened the log and I searched for a pairs, so I removed all lines from one search and the very next one, what I got is some like this

2024-04-10 19:18:00,953 - freqtrade.strategy.interface - DEBUG - Populating indicators for pair REI/USDT.
2024-04-10 19:22:46,594 - freqtrade.strategy.interface - DEBUG - Populating indicators for pair REI/USDT.
2024-04-10 19:27:10,484 - freqtrade.strategy.interface - DEBUG - Populating indicators for pair REI/USDT.
2024-04-10 19:31:52,346 - freqtrade.strategy.interface - DEBUG - Populating indicators for pair REI/USDT.
2024-04-10 19:36:17,964 - freqtrade.strategy.interface - DEBUG - Populating indicators for pair REI/USDT.
2024-04-10 19:40:51,779 - freqtrade.strategy.interface - DEBUG - Populating indicators for pair REI/USDT.

So in my case, about 4.5 minutes pass from one populating to the next, so with my 31 pairs I am within a 5-minute timeframe.

anglol commented 5 months ago

Thank you @Jorman

I live in euro area, but if I deposit on binance, dollars are credited. Is it better for me to trade in dollars, euros or doesn't it change anything?

Maybe you have change fees or something, but at the end the difference is not very important.

All your trades are in stable coin like USDT, not directly in EURO or USD.

Was that your question ?

Jorman commented 5 months ago

Yes, exactly, do you think it is better to trade with stable coins? Currently I am "stuck" for 4 days with 3 orders in slight loss, the fact is that there is not enough stack to open new orders 3/5 but sometimes increase the position by a few orders, so I find myself in a "limbo" I am thinking of increasing the availability to "unlock" at least I hope, the situation, so that then I can place new orders while waiting for these 3 to go positive. Am I wrong? Would you force the situation differently? Any advice? This is the updated situation

ID     Pair      Since    Profit (USD)       # Entries
-----  --------  -------  ---------------  -----------
31     YGG/USDT  4 d      -11.16% (-1.68)            2
35     REI/USDT  3 d      -6.55% (-0.56)             6
36     KEY/USDT  3 d      -2.37% (-0.18)             1
-----  --------  -------  ---------------  -----------
Total                     -2.42 USD
iterativv commented 5 months ago

NFI is meant to handle those ... there is no worry there. let it handle it.

Jorman commented 5 months ago

Certainly, I am hopeful, anxiously waiting but hopeful!

anglol commented 5 months ago

When i'm stuck with negative trades, I open 1 or 2 new slots temporarily to unlock the situation and reduce it when its ok.

Jorman commented 5 months ago

@anglol How do you do that? I know how open slots, at least I think, but I mean: Let's say the budget is $60 and max open trades is 6, so about $10 for each slot, let's say you have 3 orders in loosing position, not so much, so you wait, after one day more or less the same, then at the 3rd day you decide to open new slots but: you still have 3 slots open you don't have $10 for each trade because in meanwhile the bot increase some positions and use some of the existing budget and no extra order are placed during those 3 days

I don't know if I explained the situation well

anglol commented 5 months ago

I get it.

I increase max_open_trades only if I have enough $ to open new position. Obviously, If you have already spent everything to increase negative positions, you can't !

I don't know if it's a good way to do 🤔

I think you can discuss all this with the community on discord: https://github.com/iterativv/NostalgiaForInfinity?tab=readme-ov-file#discord-link

It’s a gold mine!

Jorman commented 5 months ago

@anglol Thank you, I'll take a look at the discord channel, for now I increased the budget but like always I do all in the wrong time, lol!

@iterativv I made a small script to automatically update the selected strategy, but without the need to clone the repository locally, but yes, git is still needed, can I post it here?

One last question about the strategy: In fine-tuning I gradually lowered the number of pairs to find the right number for my machine power, sometimes I saw Outdated data... message. If it happens, for example, once every one or two hours, does it impair the operation of the strategy? If the strategy has been running for say 2 days and I have to restart the bot, do I lose the progress of the analysis it has done or does nothing happen? The longer it has been running, the better it predicts trends, or does it have a limited "timeframe"? I mean the strategy does not seem to me to save any files with the analyses, it all stays in memory and/or in swap, so I ask if there are any tips for using the strategy