Premarket Volume to use in an indicator


Category:
0
0

Hi Mr. Hahn,

I am trying to use the premarket volume in a calculation but the value is not using todays premarket volume, instead it is using the prior days volume. Is there a way to circumvent this problem?

Thanks

Sudeep

Marked as spam
Posted by (Questions: 2, Answers: 3)
Asked on May 7, 2018 5:09 am
2879 views
0

I have no idea where to start without seeing the code you are working with. However I will mention that in Thinkorswim this is no such thing as “pre-market”. There is only extended hours, which include both the after-market and pre-market trade data. So any solution that tries to work with only pre-market data will require the use of start and end times, defining the pre-markets hours.

( at May 7, 2018 7:50 am)
0

My code is modified volume rate of change which I use in a watchlist:

input length = 14;
def volsma = SimpleMovingAvg(volume[10], length);
assert(length > 0, “‘length’ must be positive: ” + length);
plot VolROC = if volsma 0 then (volume / volsma ) * 100 else 0;

When I use this I don’t get the updated volume of the morning. I understand what you are saying that the morning volume is tied to the last days volume but I have no idea how to split it.

( at May 7, 2018 2:28 pm)
0

Ok this helps. But what time frame is your watchlist column set to?

There appears to be a typo in your last line: plot VolROC = if volsma 0 then (volume / volsma ) * 100 else 0;

I believe it should be: plot VolROC = if volsma <> 0 then (volume / volsma ) * 100 else 0;

Once I know what time frame you are using in the watchlist column I’ll finalize my analysis to determine if you are close to meeting the stated goal.

( at May 7, 2018 3:39 pm)
0

The watchlist timeframe is daily.
I could be going blind as I cant see a different between my last line and yours!

( at May 8, 2018 2:08 am)
0

Sorry, I forgot to apply the adjustment when I pasted that line of code with the typo. It was missing the ” signs between volsma and 0.

( at May 8, 2018 8:16 am)
0
Private answer

Having spent some time getting more details through the comment section of the question I have some bad news. Extended hours data is only available using intraday time frames. The only way to get pre-market data is to first have access to extended hours data. So while we are using the daily time frame it is impossible to access anything but regular session hours.

Many times there is a way to adapt the code to perform the same calculations from an intraday time frame. However not in this case. You code applies a 14 period moving average to the volume, shifted 10 bars to the left. Which means we have a 14 DAY moving average of the volume, shifted 10 DAYS to the left.

We cannot reference secondary time frames from within a study filter of a scan (same with a watchlist). So we can’t get there using the current technology available in the platform.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on May 8, 2018 8:26 am
0

Thanks for the feedback Pete! Its a pity that they didnt just let one of the popular languages to be used with their platform.

( at May 8, 2018 4:45 pm)
0

It actually has nothing to do with language. It has everything to do with how Thinkorswim stores their data. It’s a backend problem. Not a frontend problem, and not a language problem. And Java Script is incredibly popular.

I’m curious. On what other platform(s) have you found that this is possible? I don’t see it available on TradeStation and I have not seen this as an option for Sierra Chart.

If you feel this is important for a large number of traders I encourage you to submit this as a feature request through the client center of the TD Ameritrade site.

( at May 8, 2018 5:21 pm)