I would like to draw a price line at the start of the month, regardless of chart timeframe. To do this, I am using a method that is probably more complicated than it needs to be. I am checking if the first day of the month is Sunday or not Sunday, being that futures opens on Sunday. I have to do this because if the first or second day of the month is a Sunday, than I use Sunday open as month open. However, if the first day of the month is any weekday, it uses the day prior.
This works well, unless there is a holiday, like for example Jan 1st, where the market was closed on Sunday Dec 31 and Monday Jan 1. The script than sees that the first day was Jan 1 on a Monday, but tries to use Sundays open, which the market was closed. This throws off the entire script as I use this price/time as a base value.
Is there a way to just add an additional monthly data series, than pull the start DateTime from that additional data series bar? I didn't see any way to do this when looking through the library. Perhaps GetTime or TimeSeries, but this was unclear how it would work with an additional data series.
Thanks in advance,
Chris
Comment