<backtrader.feeds.yahoo.YahooFinanceData object at 0x000001B1D9B687C0>
so i have this. How to open it?
i was doing
for i, d in enumerate(self.datas):
...: print(d)
<backtrader.feeds.yahoo.YahooFinanceData object at 0x000001B1D9B687C0>
so i have this. How to open it?
i was doing
for i, d in enumerate(self.datas):
...: print(d)
just trying to figure out a way to execute this kind of request.
sry, this post is redundant, refer to the original post.
I cant even delete this post....
Re: How to build on last order to further execute orders?
tried
elif self.close[0] > self.buyprice[0] * 1.5:
or
elif self.close[0] > self.buyprice * 1.5:
doesn't really work
and
I can't modify my post? can't even delete it?
Re: How to build on last order to further execute orders?
Re: How to build on last order to further execute orders?
tried
elif self.close[0] > self.buyprice[0] * 1.5:
or
elif self.close[0] > self.buyprice * 1.5:
doesn't really work
got a redundant line in the end. please ignore
basically I want to check the last buy order, if current close is larger than last execution, we buy another 50% in from the rest of cash. but no more than 3 times.
The command wont execute, I know it could to be something like
order.executed.price[0]
but I couldn't find a right expression for it:
def next(self):
self.count = 0
if not self.position:
if self.datahigh[0]>self.upper:
dif =self.short - self.long
if dif > 0:
self.order = self.order_target_percent(target=0.5)
else:
if self.datalow[0] < self.lower:
dif = self.short - self.long
if dif < 0:
self.order = self.close()
elif self.data.close[0] < self.short*0.90:
self.order = self.close()
elif self.close[0] > order.executed.price[0]*1.5:
if self.count < 4:
self.order = self.order_target_percent(target=0.5)
self.count += 1
self.order = self.order_target_percent(target=0.5)
please help