@tianjixuetu I met this situation again ,and I find that the reason is that the first data may lose some bar,so,it should run many times to wait the some data to this datetime.
tianjixuetu
@tianjixuetu
Posts made by tianjixuetu

RE: why the prenext and next can run many times in one bar?

RE: ATR difference with Metatrader? + original welles wilder version
@JensHalsberghe I just met this question and solve it.
you should use this class and the ATR .
class AverageTrueRange(Indicator): ''' Defined by J. Welles Wilder, Jr. in 1978 in hiMY_s book *"New Concepts in Technical Trading Systems"*. The idea is to take the close into account to calculate the range if it yields a larger range than the daily range (High  Low) Formula:  SmoothedMovingAverage(TrueRange, period) See:  http://en.wikipedia.org/wiki/Average_true_range # 修改了算法，使用我自己的方法 ''' alias = ('ATR',) lines = ('atr',) params = (('period', 14), ('Average', Average)) def _plotlabel(self): plabels = [self.p.period] plabels += [self.p.movav] * self.p.notdefault('movav') return plabels def __init__(self): self.lines.atr = self.p.Average(TR(self.data), period=self.p.period) super(AverageTrueRange, self).__init__()

RE: backtrader2
@tianjixuetu If the underlying logic code has problems, we need to modify the underlying logic code first, then fix the bug, and develop new functions.anyone understand the backtrader's underlying logic and source code?

RE: backtrader2
I'm curious that,how many people have read backtrader's source code more than once. How much do you understand the underlying logic of backtrader? I wonder if the underlying logic of backtrader has some problems.

RE: Backtrader vs TradingView Final Portfolio Result
@IgnasiusWahyudi there is something(maybe wrong) when you calculate the net value when it is a future when you have a position,but after you close the position,the results is same. so , it is not a big question.

RE: Backtrader's Future
@vladisld my github is https://github.com/tianjixuetu ,thank you very much.

RE: Backtrader's Future
@vladisld @runout ‘s idea is very good。I has uesd backtrder since 201804, and read the sorce code at least three times, but unfortunately,I cannot totally understand the every detail, and I have fork the backtrader's code and develop it by myself,but I met many questions,it needs a lot of time to solve it.
I agree with @vladisld's idea, we can develop a new packages,for example backtrader2,based on backtrader。
I would like to make it better ！

RE: why the prenext and next can run many times in one bar?
@ab_trader thank you. but,what you say and try,is not my example. just as I said before, all my datas is the same timeframe,there is no daily bar,they all 15 min bar. anyway,thank you very much.

RE: why the prenext and next can run many times in one bar?
@ab_trader said in why the prenext and next can run many times in one bar?:
20200504T12:00:00, C: 35.00, data0: 16, data1: 0
20200504T12:00:00, C: 35.00, data0: 16, data1: 1this is the question. when you run strategy,if you use multi data,if some day,you run two time next,is it right for your strategy logical?
when you use more data,you may meet more stranger question.
do you know,why the next run two times at the end day? we may fix this bug!

RE: why the prenext and next can run many times in one bar?
@booboothefool said in why the prenext and next can run many times in one bar?:
I noticed using the length of the data to dedup like this helps, but I'm not sure if I'm supposed to be doing this or not.
I also use this way to solve this question,also the code is not same.