I'm working with options data which can be quite illiquid. On certain instruments you may get only a few ticks per day or even zero. Because of this bars based look back strategy will not work due to the chart being incomplete.
My workaround to this is using the time of day to get the data at the right time. I'm reaching out because I am not sure if thinkscript is capable of returning a bar based on the time.
The logic looks something like this:
If data is present in the time slot 1 on the current session get data, if not set relevant values to zero.
If data is present in the time slot 2 ob the current sesaion get data, if not set relevant values to zero.
.
.
.
I also want to know what time slot is currently active in a given session. The trade day is from 930 am to 4pm. That is 13 30 minute sessions over 6.5 hours. This is how I am planning on discritizing the trading day. I need a variable that can return 1-13 corresponding with the proper time slot. That way averages can be calculated no matter when you run the code. After the market closes that value would return 13.
Any insight would be greatly appreciated!
My workaround to this is using the time of day to get the data at the right time. I'm reaching out because I am not sure if thinkscript is capable of returning a bar based on the time.
The logic looks something like this:
If data is present in the time slot 1 on the current session get data, if not set relevant values to zero.
If data is present in the time slot 2 ob the current sesaion get data, if not set relevant values to zero.
.
.
.
I also want to know what time slot is currently active in a given session. The trade day is from 930 am to 4pm. That is 13 30 minute sessions over 6.5 hours. This is how I am planning on discritizing the trading day. I need a variable that can return 1-13 corresponding with the proper time slot. That way averages can be calculated no matter when you run the code. After the market closes that value would return 13.
Any insight would be greatly appreciated!