♥ 0 |
Hi pete, I am trying to set up a custom column for my ThinkorSwim watchlist for pre-market volume. However, I am running into some problems if there were no premarket activity for the stock today. Instead of showing 0, it shows prior day’s pre-market volume. How do I get around this to show today’s information only? Please find the code below, and thanks in advance for your help!
def isRollover = GetYYYYMMDD() != GetYYYYMMDD()[1]; def beforeStart = GetTime() < RegularTradingStart(GetYYYYMMDD()); def vol = if isRollover and beforeStart then volume else if beforeStart then vol[1] + volume else Double.NaN; def PreMarketVol = if IsNaN(vol) then PreMarketVol[1] else vol;
plot PMV = PreMarketVol;
Marked as spam
|
Private answer
Did you search the forum before posting? Because I searched for this and found only two posts, yours, and the one that was already posted: https://www.hahn-tech.com/ans/how-to-include-premarket-data-in-my-watchlist-column/ Please let us know if you checked this first. If it didn't do what you are trying to accomplish be sure to explain exactly how that previous posts missed the mark you are trying to achieve.
https://www.hahn-tech.com/ans/premarket-volume-labels-showing-less-volume-than-real/ Here I am included that code, modified very slightly to work as a custom watchlist column:
Please note that your custom column will need to be set to include extended hours session. You can set the start and end time to whatever span of time you need to cover. Remember that custom watchlist columns always use Eastern timezone. Marked as spam
|
Please log in to post questions.