Comments (10)
Please reformat your post properly (wrap code snippets in tripple backticks (`)).
It's also completely unclear what you're trying to accomplish with this issue - it seems quite messy and some "i did this and then that" - but it's unclear what the actual issue is you're seeing / trying to fix.
from technical.
"dropping" is not the same as what #4073 points at points at.
That's shifting the timeframes so the candle close dates align. Not doing that will delay the signal by 1 minor candle.
in backtesting - this is not problematic - in live, it'll be, as you'll be using the longer candle not at 00:00 - but only at 00:15 (assuming 15m/1h candles) - which is 15m later than when the candle would've been available.
Please find a detailed explanation of this problem here.
It's simply because the dates we work with are candle open dates.
It's not a problem - and nothing that should be optional. Systems not respecting this must be considered wrong - and should therefore be fixed.
considering it's binance - it's most likely a missconfiguration of the indicator - not a systematic problem - although i have to admit, i've never used indicators from a different timeframe, and am not sure how that'd be added.
from technical.
I don't really understand why you've removed the issue content / your response now.
it's a valid question (this IS a difficult topic) - and a very frequent point of concern.
seeing that binance missaligns (maybe in certain conditions?) may also help other users - would the content have remained.
from technical.
The issue for me was caused by removal/shifting of the candle in resampled_merge and merge_informative_pair. Not binance.
You are doing an amazing project to help all, I felt I should not get into an argument with you.
from technical.
i don't really see it as an argument though - it's a fact that without that logic, the signals will be delayed by 1 "minor candle" (smaller timeframe). That's not subjective, but a mathematical fact as we're dealing with candle open dates - but can use the candle as soon as it closes.
If that delay is what you desire/need - then you can pretty easily use pd.merge
directly - without relying on the helper function.
The helper functions are designed to help users merge correctly, without causing delays in their signals. if the delay is intentional - then the helper-functions may not be the correct approach for that strategy.
Having such a thing optional will be problematic - as it'll have users experiment with parameters they don't really understand the implications of.
from technical.
My 2 cents will be to avoid touching data and let the user manipulate the raw data as much as possible. It is mathematically significant in multi frequency cascading (i.e. issuing a false entry/exit signal), but I agree it might cause users a headache :)
from technical.
PS. I am super impressed with your responsiveness and diligence!!!
from technical.
The fix you're applying is unclear to me (the original issue didn't really show what the precise change was) - but as it's backtesting only - i think you're risking lookahead bias (which will usually show high profits in backtesting - but will then disappoint in live).
now that's not to say this must be the case - but it's a possibility you shouldn't neglect
from technical.
I found the problem in live run and live data. The change we put in to show the raw candle in Telegram triggered me to dig through the data with a fine comb. I will post you if the live results differ, so far it is working like a charm.
from technical.
The fix is to add a flag i.e. raw=False
def resampled_merge(original: DataFrame, resampled: DataFrame, fill_na=True, raw=False, prefix=''):
to bypasses the following logic in resampled merge & informative merge:
if raw == False:
(current logic)
if original_int < resampled_int:
# Subtract "small" timeframe so merging is not delayed by 1 small candle.
# Detailed explanation in https://github.com/freqtrade/freqtrade/issues/4073
resampled["date_merge"] = (
resampled["date"] + to_timedelta(resampled_int, "m") - to_timedelta(original_int, "m")
)
.........
else:
resampled["date_merge"] = resampled["date"]
Plus a cosmetic change to add a variable called prefix=''. Helping with contextualized time frequency naming e.g. primary, secondary, etc
if prefix != ''
resampled.columns = [f"{prefix}_{col}" for col in resampled.columns]
else: (the current naming convention)
resampled.columns = [f"resample_{resampled_int}_{col}" for col in resampled.columns]
from technical.
Related Issues (20)
- Resampled dataframes are shifted 1 candle. HOT 4
- Trend Step Channel - appreciate it HOT 4
- resample_to_interval date shifted HOT 1
- Help with Trend Trader Strategy HOT 1
- ichimoku different value proposal HOT 1
- How to import external data to populate entry/exit trend conditions HOT 14
- Laguerre RSI wrong computation HOT 3
- ```crossed``` function throws error with numpy integers
- utils bug HOT 4
- How to plot segtrends or gentrends using freqtrade plot-dataframe ? HOT 1
- Phase Change Index HOT 18
- I try to convert Predictive Ranges [LuxAlgo] to the py, whats the problem? HOT 7
- Involvement of Heikenashi candles could be helpful in trend prediction HOT 1
- Help needed with: AttributeError: 'SSL' object has no attribute 'copy' HOT 3
- warning util.py
- 16 tests failed HOT 4
- Pandas warning when setting fillna(0) on RMI calc HOT 2
- Issues with PMAX indicator HOT 1
- A few Pinescript lines HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from technical.