Any danger in setting end date on Moonshot.get_prices() method during Moonshot.trade()?

Within the Moonshot.trade method (inside base.py), any danger in changing the following line? I want to make this change to speed up testing/debugging when using an old review_date. Currently Moonshot will grab prices from review_date to today, which can be a ton. Can def using backtesting for this, but as a quick review that orders are working on past candidates, this is a great feature.

Note that I trade using intraday minute prices, and trade is called every minute during live trading.

Change
prices = self.get_prices(start_date)
to
prices = self.get_prices(start_date, start_date)

Guidance in modifying the source code is beyond the scope of the forum. You’re welcome to experiment on your own.

@brian the only reason I'm asking here is because I'm unable to see the code or what happens behind the scenes, and I'd rather not guess, and cause some bug that's going to cost me a ton of money down the road.

While looking at the code I am able to see, to me this feels like it should be this way, but you guys have been very intentional with the product and thus I was worried there was a reason for it.

I'll take your response to mean there was no intention in setting it up this way. Thanks.

Lol, speaking of bugs, this change actually broke my live trading to today, and of course I spent the whole deal trying to figure out what was wrong without considering that it was THIS change that caused the issue. Leaving details in case it helps others.

In short, if you haven't yet upgraded to 2.6, and you're using both history and realtime databases together, such as when live trading, specifying start and end dates to strategy.trade or get_prices will NOT pass the correct timezone to the realtime service and thus you'll likely get incorrect prices which are being cut off due to a wrong timezone. See related post here.

In summary, if you haven't upgraded to 2.6, do not specify an end_date within the Moonshot.trade method as I posted above :slight_smile:. Alternative, you can specify the timezone offset with your end_times that are being passed to Moonshot.trade or get_prices.

Hope this helps someone else!

P.S. @brian in 2.5 there is a related bug that mostly goes unnoticed here. Basically, when only specifying a start date, the lookback period is offsetting the start_date and thus hiding the timezone offset issue when using a realtime database. This could be a problem if your lookback is set too tightly as you'd be missing some prices due to the timezone offset. In 2.6, as long as a Monshoot.TIMEZONE is set, this won't be a problem but just something to note.