Thank you Chad! Your video has translated into my fully functional backtesting system. Cheers!
@fiftyghoststrading85002 жыл бұрын
Thank you for this tutorial, it's helpful! Is there a way to check for a signal on the daily, but then use 1-min, 5-min, whatever for the actual entry? Both would be based on price action, not an indicator
@dimasjimenez3396 Жыл бұрын
That's what he explains here when he says you should start from a lower timeframe and resample to a larger one. If you wanna validate a signal on the daily timeframe and take the position in a let's say 5m timeframe, you should feed the 5m dataframe, resample to 1H, set the signals there and then evaluate those signals and take the trade based on that evaluation, but in the 5m timeframe. I think the tricky part here is to set the signal, since it's way more difficult to spot them based on price action rather than in an indicator.
@ghazanferali3662 жыл бұрын
Thanks very much, solved a long lasting problem. I am having another problem. I have backtested a strategy in which I haven't provided the size of strategy to keep every signal using 100% of cash. But when I am checking the trades, there are lot of very small unwarranted trades of around 1$ value. How can I exclude these trades
@vinayakassajjanshetty72317 ай бұрын
Hey bro, you can think practically this is not live trading its showing you the possible conditions that could have taken place by t he conditions you mentioned too enter the trade, so its the refining time you need after what you got the analysis, If you want to some targeted money analysis, you can use the backtest.optimisation and plot the heat map you will have the better view of your trades performance. if my explanation differs your question, Please do teach me Thankyou.
@MrBradleykong6 ай бұрын
Hi Chad, is there any way to draw two or more data series on one single plot?(overlay = False)
@davidberry85112 жыл бұрын
Thanks for your great tutorials
@iiii05 Жыл бұрын
Hi @chad. I’m having a problem using resampling_apply with the Adx, as I have to pass the high, low, close and the time period from ta lib. It works fine when using I() but when using resampling_i think because there are more than one series, it’s not liking it. Any ideas of the statement I’d use please?
@nb9797 Жыл бұрын
same here
@vinayakassajjanshetty72317 ай бұрын
Hi @iiii05, I think my reply is little late as I have seen the video now and your reply, for the problem you mentioned, If you carefully look the def init() its just that you are creating new set of data(defining your own conditions like 10 mins data or 1 hour data from 1 min data candle sticks), as the I () function takes care of the each sample output converting the type of the sample to numpy, but that is not the case in the resample_I() ass there is no self conditions defined in it There are two ways but 2nd one is more efficient what I think, 1. Check the output condition of I() it is numpy type as you are using pandas it will be pandas.series and in resample_I() is not defined you have to provide the numpy data. 2. as you are using pandas_ta lib you can use the resample sizing function outside the backtesting class and add the new column to the data frame and now you can normally use the I() and test your startegy Note:(I like the second method) If you have found some efficient solution please so teach me , Thankyou
@tessalittle2411 Жыл бұрын
Awesome video - I am curious - what approach would you suggest if I were to screen for Highest time frame in range where K% of stochastic RSI is above/or just crossing 80 - I need the Time frame to be returned. I have seen some people using vectorization. I will be doing this for 4 different time frame sets.
@datascientistaspirants45403 ай бұрын
Does it work for multi timeframe where the timeframes are 3h and 4h? The data for these two timeframes will be combined and and provided as input to the backtesting. The problem I am facing is in every 12h timestamp there are duplicate entry of OHLC data (coming from both 3h and 4h). Backtesting framework take input data having unique datetime index. Hence it shows error.
@mgarciabarua Жыл бұрын
Hi Chad, Thanks for your amazing videos. I have a 1Min timeframe but I'm try to get the ATR for 5Min: self.atr5m = resample_apply('5Min', ta.atr, self.data.High.s, self.data.Low, self.data.Close, length=14) but I'm getting this: -> 129 raise RuntimeError(f'Indicator "{name}" errored with exception: {e}') 131 if isinstance(value, pd.DataFrame): 132 value = value.values.T RuntimeError: Indicator "atr(H[5Min],L,C,14)" errored with exception: input array lengths are different
@vinayakassajjanshetty72317 ай бұрын
Hey bro, you are getting this error because the backtest only work with the datatype numpy series not panda series, in resample_apply() there is no conversion for this as such present in the I(), so you have to do it manually.
@danielfenollfreire30222 жыл бұрын
anyone having the TypeError( TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'RangeIndex' error when using the resampler despite having formatted the index of the data to DateTimeIndex?
@MrDenfish Жыл бұрын
yes, I saw this when resample_apply("H"... was used, resample_apply('1H'... fixed the issue, not sure if this helps but I saw this error when I made the typo.
@miltonfernandez9832 Жыл бұрын
Same here, i wonder if you already fixed it
@alexanderlunel789911 ай бұрын
same here too
@drcesarvarela2 жыл бұрын
Genious!
@mssafy25922 жыл бұрын
How to know how many time the price crossed a certain level of price ?
@ChadThackray2 жыл бұрын
You have all the previous price history in self.data, so you can just write a function that scans through there for a specific price level
@anilmm2005 Жыл бұрын
Thank you for wonderful help @chad
@ahmetsuatyildiz48362 жыл бұрын
Could you connect this video with custom indicator video?
@ChadThackray2 жыл бұрын
Yeah you can do both multi-timeframe and use your own custom indicators
@ahmetsuatyildiz48362 жыл бұрын
@@ChadThackray How is the ao indicator MTF code statement? I would like to see it at the end of the video.
@ahmetsuatyildiz48362 жыл бұрын
I did not understand why it did not calculate the following. There is no error, but the values are filled with nan. I see only +1 and -1 (decision column) self.super1_w = resample_apply( 'W-FRI',ta.supertrend, self.data.High.s, self.data.Low.s, self.data.Close.s, length=10, multiplier=1.0, plot=True)
@bryan-97422 жыл бұрын
very good chad
@ghazanferali3662 жыл бұрын
Actually I only want the trade to be executed if there's no active trade in place already. Also my strategy can go both long and short.
@ChadThackray2 жыл бұрын
I believe you can do something like `if not self.position` somewhere within the next() function and then anything inside that if statement will only be execute if you don't have a position