Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating profits in Backtest but losses in LIVE Mode #255

Closed
hamiz-ahmed opened this issue Oct 16, 2022 · 23 comments
Closed

Generating profits in Backtest but losses in LIVE Mode #255

hamiz-ahmed opened this issue Oct 16, 2022 · 23 comments

Comments

@hamiz-ahmed
Copy link

Hi,
I recently deployed the strategy in live mode with volume trading pairs.
The strategy, in the results of around 24 hrs, has made a loss of over 2% and has still loss trades opened.
I backtested the strategy during the same time frame and same coin pairs and according to backtesting results, the strategy should have made a profit of 1% and would have closed the trades.

The pairs I have tested are
SUN/USDT
ACH/USDT

Following are the results of backtesting:

image
image

image

Following are the results of live testing so far:

image

Any idea, why does this happen?

@iterativv
Copy link
Owner

First, those trades are open. But also closed for most, to my knowledge. You had any sell timeouts ? QI is open. ACH and SUN closed yesterday.

@iterativv
Copy link
Owner

For ACH I got 0.0129 open rate and 0.01305 close rate. Maybe your open is a lot higher that this ? Or a sell time out occurred. You sold anything so far ?

@iterativv
Copy link
Owner

Also, from the trades ID, you had SUN ID = 2 that closed with 2-3% profit ? Patience for QI. ACH, probably you missed the sell. But, providing all go well, it will attempt again.

@hamiz-ahmed
Copy link
Author

I did not have any sell timeouts. SUN closed, ACH and QI are still open with over 10% loss now. It opened further two positions on QI and ACH, so now the stake amount is even more.
Nothing has been sold so far. Yes, SUN made a profit but overall, I am at over 5% loss and for the same backtesting period, I am still supposed to get profits.

@iterativv
Copy link
Owner

I did not have any sell timeouts. SUN closed, ACH and QI are still open with over 10% loss now. It opened further two positions on QI and ACH, so now the stake amount is even more. Nothing has been sold so far. Yes, SUN made a profit but overall, I am at over 5% loss and for the same backtesting period, I am still supposed to get profits.

Yes, if you check QI is as supposed to be. ACH closed for most. I am not sure why yours not. QI is open in backtest too. Note: not anymore, because there were changes, I did not like the QI trade much.

Wait on those, there is stop lower, but there is good chance to make it.

The real problem is why ACH is still open, probably you get a high open rate. It closed for here, for example. QI is still open. And QI was open in backtest, with the version you used in live. You test is SUN & ACH, not QI and ACH.

@iterativv
Copy link
Owner

Also, at the bottom of the main page, there is a link to discord. If you use it, join the server, if you like. To discuss anything there.

@hamiz-ahmed
Copy link
Author

Do you think that the trade not closing, could be a bug in Freqtrade?

@iterativv
Copy link
Owner

Do you think that the trade not closing, could be a bug in Freqtrade?

The ACH trade, no. Just timings. But there is a chance a hour ago for that, especially with rebuy. And even now, it looks fine to me, it should make it shortly. For the QI one we wait. There are times that trades can go for few days and other trades in minutes.

Also, a loss currently is 9-10 wins. Obviously, if better conditions, it can find more big wins, Generally, is 1-10 wins to make for a potential loss.

@EgyptianM
Copy link

I tested it for over than a month and I have the databases with me,
Last version was 475 then I stopped it and switched to another strategy.
It doesn't make any profit in live trading, actually it loses money up to 30% of the capital.
It makes a lot of low profit trades them wipes them all with 2 or 3 stop loss trades.
I reduced number of coins to 50 then 40 to avoid shit coins and it's the same.
Unfortunately I stopped it and I'm searching for another strategy.
See #241

@iterativv
Copy link
Owner

iterativv commented Oct 17, 2022

I tested it for over than a month and I have the databases with me, Last version was 475 then I stopped it and switched to another strategy. It doesn't make any profit in live trading, actually it loses money up to 30% of the capital. It makes a lot of low profit trades them wipes them all with 2 or 3 stop loss trades. I reduced number of coins to 50 then 40 to avoid shit coins and it's the same. Unfortunately I stopped it and I'm searching for another strategy. See #241

There is major reworks the last 3-4 weeks ... try in in dry run. There is nothing that even comes near to NFI.

Sure, the market is not great. But give it a chance with the new reworks.

The major change is the buy signals, more accurate as possible. The other change is stop. More tight now, so it will not hold losing trades. The other is the sell logic, there is potential for more big and bigger wins now.

@iterativv
Copy link
Owner

I tested it for over than a month and I have the databases with me, Last version was 475 then I stopped it and switched to another strategy. It doesn't make any profit in live trading, actually it loses money up to 30% of the capital. It makes a lot of low profit trades them wipes them all with 2 or 3 stop loss trades. I reduced number of coins to 50 then 40 to avoid shit coins and it's the same. Unfortunately I stopped it and I'm searching for another strategy. See #241

Also, while working on current X, I am planning the next version. There will be new buy signals, potential for big/huge wins. Trade the top20 coins or so daily. And much more. But you can set a dry run with the current if you like. Even in this market, you going to notice the difference. I don't think there is a chance to not have profit every week. Even if not, example pretty bad conditions, there should be break even or minimal loss (-1 -2%) for that week.

@EgyptianM
Copy link

I tested it for over than a month and I have the databases with me, Last version was 475 then I stopped it and switched to another strategy. It doesn't make any profit in live trading, actually it loses money up to 30% of the capital. It makes a lot of low profit trades them wipes them all with 2 or 3 stop loss trades. I reduced number of coins to 50 then 40 to avoid shit coins and it's the same. Unfortunately I stopped it and I'm searching for another strategy. See #241

There is major reworks the last 3-4 weeks ... try in in dry run. There is nothing that even comes near to NFI.

Sure, the market is not great. But give it a chance with the new reworks.

The major change is the buy signals, more accurate as possible. The other change is stop. More tight now, so it will not hold losing trades. The other is the sell logic, there is potential for more big and bigger wins now.

Indeed there is no strategy comes near NFI but I wonder how it has all this huge amount of technical indicators and so complex logic and still loses money.

I'll give it a try on dry run again and see the results and inform you.

@iterativv
Copy link
Owner

iterativv commented Oct 17, 2022

I tested it for over than a month and I have the databases with me, Last version was 475 then I stopped it and switched to another strategy. It doesn't make any profit in live trading, actually it loses money up to 30% of the capital. It makes a lot of low profit trades them wipes them all with 2 or 3 stop loss trades. I reduced number of coins to 50 then 40 to avoid shit coins and it's the same. Unfortunately I stopped it and I'm searching for another strategy. See #241

There is major reworks the last 3-4 weeks ... try in in dry run. There is nothing that even comes near to NFI.
Sure, the market is not great. But give it a chance with the new reworks.
The major change is the buy signals, more accurate as possible. The other change is stop. More tight now, so it will not hold losing trades. The other is the sell logic, there is potential for more big and bigger wins now.

Indeed there is no strategy comes near NFI but I wonder how it has all this huge amount of technical indicators and so complex logic and still loses money.

I'll give it a try on dry run again and see the results and inform you.

In the last 3-4 weeks there are is major overhaul. 1) most of the buy signals. 2) tight stoploss, no bags and no big losses, in case the conditions is pretty bad. 3) sell logic changes to guarantee some bigger wins.

Of course, strive to make profit in all conditions. And I think it should make profit every week now.

But we have to consider the conditions the previous months too. The big issue was the buy signals, some times the buys were either high or wrong place, during dumps.

@hamiz-ahmed
Copy link
Author

I think the amount of refining being performed in the strategy kind of overfits and not generalize the strategy. That's why it works great during backtests but fails in live modes

@iterativv
Copy link
Owner

iterativv commented Oct 17, 2022

I think the amount of refining being performed in the strategy kind of overfits and not generalize the strategy. That's why it works great during backtests but fails in live modes

These latest changes, don't change anything on the core of the buy signals. It's just protections, as where not to buy. So, not over fitting at all.

As for your trades, just wait, my guess is that those going to close with profit.

But some trades can take few hours, maybe days. it doesn't mean we have always trades that last minutes. The stop is at -18% now. There are trades that last minutes, other trades hours or days. You lost nothing so far, just wait for those to close. -5% or -10% is nothing for open trades.

@iterativv
Copy link
Owner

Also, the tests confirm live trades. I backtest the live trades. Of course, there are changes, if I notice a trade is not optimal.

@hamiz-ahmed
Copy link
Author

Lets see if it closes on profit. I will inform you if it does. For now, I am testing another instance on dry run. Lets see if the strategy works there

@iterativv
Copy link
Owner

Lets see if it closes on profit. I will inform you if it does. For now, I am testing another instance on dry run. Lets see if the strategy works there

I know about QI. But ACH closed for most others. This is different for you, it happens some times. From what I see both look OK now. Just patience.

@EgyptianM
Copy link

Do you think that the trade not closing, could be a bug in Freqtrade?

Which version do you use?
I encountered something like that, the bot missed some exit signals I don't know why.
Some times it misses 2 or 3 exits in a row.
No timeout orders so it's weird.
I'm using latest version 2022.9.1

@hamiz-ahmed
Copy link
Author

Do you think that the trade not closing, could be a bug in Freqtrade?

Which version do you use? I encountered something like that, the bot missed some exit signals I don't know why. Some times it misses 2 or 3 exits in a row. No timeout orders so it's weird. I'm using latest version 2022.9.1

I am using the same so it could be the same issue

@iterativv
Copy link
Owner

Do you think that the trade not closing, could be a bug in Freqtrade?

Which version do you use? I encountered something like that, the bot missed some exit signals I don't know why. Some times it misses 2 or 3 exits in a row. No timeout orders so it's weird. I'm using latest version 2022.9.1

I am using the same so it could be the same issue

No, this is unlikely. What it happened some times, is to sell normal, but FT still calculates that the order is open (with less than 1 USDT stake). In that case, you can check the exchange if there are open orders and delete that trade, if all good.

@iterativv
Copy link
Owner

Note: some others had ACH, that closed overnight. With updated NFI. QI is also near to profit. Sure, this took longer that normal, but profit in the end. Please, join the discord server to discuss to it further, thanks.

@hamiz-ahmed
Copy link
Author

I am still facing loss. My loss has mounted to over 20%.
In live mode, the strategy doesn't perform at all, even in the dry run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants