flowtrader
New member
Hello I am trying to create a premarket average volume indicator. I have the premarket bubble but I need to be able to compare it to an average the easiest would be 30 day average.
plot Data = close;#PreMarket Volume
input startTime = 0400;
input endTime = 0929;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec volumeTotal = if targetPeriod and !targetPeriod[1] then volume else if targetPeriod then volumeTotal[1] + volume else volumeTotal[1];
AddLabel(yes, Concat("PreMarket Vol: ", volumeTotal), Color.VIOLET);
is there any way to make a 30 day premarket average bubble to go along with this? Thank you.
I am trying to get a "label" not a bubble I do not fully understand all of the terms yet. The most similar I have found on Thinkscript is from user name "Astroboy". The question was "% change in premarket volume from previous day". I have the code for premarket volume for the current day as posted above previously. The code was built upon in the "Astroboy" post to include the previous days premarket volume in a label next to the current days premarket volume label. My question is there any way to create 30 days of premarket average volume and put that in label form to include with the other labels on the chart. Think or swim has built in a 30 day average volume indicator but it is only for daily traded volume. It would be great to compare todays premarket volume with yesterdays premarket volume and a longer term 30 day average premarket volume along with them in label form. If any one has any ideas they are greatly appreciated thank you.
plot Data = close;#PreMarket Volume
input startTime = 0400;
input endTime = 0929;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
def targetPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec volumeTotal = if targetPeriod and !targetPeriod[1] then volume else if targetPeriod then volumeTotal[1] + volume else volumeTotal[1];
AddLabel(yes, Concat("PreMarket Vol: ", volumeTotal), Color.VIOLET);
is there any way to make a 30 day premarket average bubble to go along with this? Thank you.
I am trying to get a "label" not a bubble I do not fully understand all of the terms yet. The most similar I have found on Thinkscript is from user name "Astroboy". The question was "% change in premarket volume from previous day". I have the code for premarket volume for the current day as posted above previously. The code was built upon in the "Astroboy" post to include the previous days premarket volume in a label next to the current days premarket volume label. My question is there any way to create 30 days of premarket average volume and put that in label form to include with the other labels on the chart. Think or swim has built in a 30 day average volume indicator but it is only for daily traded volume. It would be great to compare todays premarket volume with yesterdays premarket volume and a longer term 30 day average premarket volume along with them in label form. If any one has any ideas they are greatly appreciated thank you.
Last edited by a moderator: