ironhak
ironhak
Does not work in jupyter
> > it's clear that the return Pct comes from the trade volume. > > > ... in percent relative to trade size.""" > > If `pl` is the profit...
Just to add:  On the left is atr applied to daily data, on the right is the data on the left converted back to minute data, i.e. the following...
According to docs: > Notice `label='right'`. If it were set to 'left' (default), the strategy would exhibit look-ahead bias. But doing: ```python data2 = data.resample('D',label='right').agg({'Open': 'first', 'High': 'max', 'Low': 'min',...
`ta.atr` comes from `pandas-ta` library. ATR is just a single column, like `ta.sma`. > Use of label='right' ensures the labeled bin consists only of data of the preceding period, e.g....
Hello, so: ```python atr = ta.atr(data.High, data.Low, data.Close) print(type(atr)) print(atr.shape) ``` Produces: ``` (31669,) ``` So why doesn't it work if I do: `self.adr = resample_apply('D', ta.atr, self.data.High, self.data.Low, self.data.Close)`?...
Doing more tests... Resampling candlestick data from 1min to 5min using suggested `label='right`: ```python data5m = data.resample('5min', label='right').agg({ "Open": "first", "High": "max", "Low": "min", "Close": "last", }) ``` Produces: ...
Dear kernc, yes I see your point of view. I always used the TradingView and MT4/5 way of labeling data, always been aware of repainting and learned to account for...
Well... If you manage to find some time you can manage to try for yourself... ``` pip install pandas-ta ``` ```python import pandas_ta as ta from backtesting import Strategy import...