Hello there,
I'm struggling to compare today's low price with a propietary indicator line I'm generating (visually similar to a Bollinger Band lower band).
This is what I'm currently doing, which is not working.
I run a check of the status so I can trade at the market close:
schedule_function(check_bands,date_rules.every_day(),time_rules.market_close())
I get the current price and the low price for today as follows:
cur_price = data.current(context.stock,'price')
low_price = data.history(context.stock,'low',1,'1d') #I'm not confident this is doing what i want
I calculate my indicator value and assign to the variable called: lower_band
I then compare today's low to the lower_band in order to generate trade signals:
if low_price[0] <= lower_band:
#then go long
Problem is, I am not able to replicate the signals from my original (and trusted) excel prototype!
I suspect I am not getting today's low price in "low_price[0]"
Any hints /tips appreciated!