ThinkorSwim Pre-Market Volume Indicator

mansor

Member
Check out pre-market and intraday volume. Pretty neat stuff I have seen.

KfPegVh.jpg


Label is active from 8AM till 10AM then disappears.

Code:
# PreMarket Volume, High, Low Label
# TOS
# Mobius
input beginLabel = 0600;
input endLabel = 1030;
def LabelTime = if SecondsFromTime(beginLabel) > 0 and
                   SecondsTillTime(endLabel) >= 0
                then 1
                else 0;
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;
def PreMarketHigh = if isRollover and beforeStart
                    then High
                    else if beforeStart and high > PreMarketHigh[1]
                         then high
                         else PreMarketHigh[1];
def PreMarketLow = if isRollover and beforeStart
                    then Low
                    else if beforeStart and low < PreMarketLow[1]
                         then low
                         else PreMarketLow[1];
def r = PreMarketHigh - PreMarketLow;
def v = if secondsTillTime(0930) == 0 and
           secondsFromTime(0930) == 0
        then v[1] + preMarketVol
        else v[1];
def t = if secondsTillTime(0000) == 0
        then t[1] + 1
        else t[1];
def AvgV = v / t;
AddLabel(LabelTime, "PreMarket Volume = " + PreMarketVol +
                  "  Avg PreMarket over " + t + " days = " + Round(AvgV, 0) +
                  "  PreMarket High = " + AsDollars(PreMarketHigh) +
                  "  PreMarket Low = " + AsDollars(PreMarketLow) +
                  "  Range = " + AsDollars(r), Color.WHITE);
# End Label PreMarket Volume, High, Low

Pre-Market Scanner

Code:
# Premarket Scan
# Mobius
# Scan looks for premarket price to be above previous day close and premarket volume to be above 1000
def ExtHrs = getTime() >= RegularTradingEnd(getYYYYMMDD());
def c = if ExtHrs and !ExtHrs[1]
        then close[1]
        else c[1];
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 vol[1];
def PreMarketVol = if IsNaN(vol)
                   then PreMarketVol[1]
                   else vol;
plot scan = if between(c, 1, 100) and PreMarketVol > 1000 and close > c then 1 else 0;
 
Last edited by a moderator:

Pensar

Active member
VIP
@mansor Some indicators pictured in post #1 of this thread seemed familiar, so I did comparisons. These are the studies I think I can identify:

1) The coloring of the price bars is the "Early Entry" or "Early_In_Out" indicator sold by JC of Simpler Trading. I would read this before deciding to purchase any paid indicator. https://usethinkscript.com/threads/thoughts-on-the-ttm-squeeze-pro-from-john-carter.1907/

2) The lower study called "Anya_sqz_pro0" is the TTM_SqueezePRO, also sold by JC. I actually put together my own version some time ago based on multiple comments I read online and after studying/comparing it to many screenshots and videos. It copies the Squeeze Pro appearance.

Code:
# A version of the Squeeze Pro

declare lower;

input length = 20;

#Keltner Channels
def hb = 1.0;
def mb = 1.5;
def lb = 2.0;
def avg = Average(close, length);
def k1 = avg + (hb * Average(TrueRange(high, close, low), length));
def k2 = avg + (mb * Average(TrueRange(high, close, low), length));
def k3 = avg + (lb * Average(TrueRange(high, close, low), length));

#Bollinger Bands
def BB_offset = 2.0;
def sDev = stdev(close, length);
def mid = Average(close, length);
def bb = mid + BB_offset * sDev;

#Squeeze
def s0 = bb > k3;
def s1 = bb < k1;
def s2 = bb < k2;
def s3 = bb < k3;

plot squeeze = if s0 or s1 or s2 or s3 then 0 else double.nan;
     squeeze.SetLineWeight(3);
     squeeze.SetStyle(curve.POINTS);
     squeeze.AssignValueColor(if s1 then color.orange
                              else if s2 then color.red
                              else if s3 then color.black
                              else color.green);

# Code taken from Momentum Squeeze by Mobius
# code is slightly modified to remove the squeeze portion

   def c = close;
   def h = high;
   def l = low;
   def K = (Highest(h, length) + Lowest(l, length)) /
               2 + ExpAverage(c, length);
  plot Momo = if isNaN(close)
              then double.nan
              else Inertia(c - K / 2, length);
       Momo.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
       Momo.setLineWeight(5);
       Momo.assignValueColor(if Momo > Momo[1] and Momo > 0
                             then Color.Cyan
                             else if Momo > 0 and Momo < Momo[1]
                             then Color.Blue
                             else if Momo < 0 and Momo < Momo[1]
                             then Color.Red
                             else Color.Yellow);
# End Code - Mobius' Momentum Squeeze
# end code

3) The named vertical lines and the horizontal red, yellow, green, white, and plum colored lines with cloud are all part of Mobius' excellent Opening Range Breakout indicator. It can be found here - https://usethinkscript.com/threads/opening-range-breakout-indicator-for-thinkorswim.16/

4) The red/green cloud with lines that follows the price appears identical to the 5 and 13 simple moving averages. Here is code to compare.

Code:
# Moving Averages with Cloud

input avg_1 = 5;
input avg_2 = 13;
input avg_type = AverageType.SIMPLE;

plot ma1 = MovingAverage(avg_type,close,avg_1);
     ma1.SetDefaultColor(Color.cyan);
plot ma2 = MovingAverage(avg_type,close,avg_2);
     ma2.SetDefaultColor(Color.magenta);

AddCloud(ma1,ma2,color.green,color.red);

5) The cyan and magenta horizontal lines with the values listed at the right appear to be a fibonacci drawing using the fibonacci retracement tool in thinkorswim, so these are not actually a written indicator.

The indicators I don't know are the "MTF" lower indicator, the white line that appears at the left of the pic by the price, the arrows, and the dots on the price. I also didn't look much for the labels at the top of the chart; look around this forum, @Sonny has done an amazing job coding labels with such information in other threads. Hope this gives you some assistance! ;)

The upper horizontal lines are the Fibonacci retracement tool. It is manually drawn from any two points on a chart. It can be found under Drawings>Drawing Tools>Fibonacci Retracements, or by clicking the scroll wheel of your mouse on the screen to get the drawings toolbar.
 
Last edited:
Here is the TheoTrade indicator. I pulled it from the MTS1Setup found on the thinkscript onenote: https://tos.mx/Dau3Qw

Code:
# TheoTrade_Comparative_QuanTicks
# Mobius Dev
# Copyright TheoTrade LLC
# V03.25.2017

declare lower;

input closeTime = 1555;
input labelOffset = 5;
input showFloatingLabels = yes;

def openTime = 0930;
def rawTickData1 = hlc3("$TICK");
def rawTickData2 = hlc3("$TIKRL");
def rawTickData3 = hlc3("$TIKSP");
def rawTickData4 = hlc3("$TICK/Q");
def maxTick1 = close("$ADVN") + close("$DECN") + close("$UNCN");
def maxTick2 = close("$ADVRL") + close("$DECLRL") + close("$UNCHRL");
def maxTick3 =  close("$ADVSP") + close("$DECLSP") + close("$UNCHSP");
def maxTick4 =  close("$ADVN/Q") + close("$DECN/Q") + close("$UNCN/Q");
def TickData1 = rawTickData1 / maxTick1;
def TickData2 = rawTickData2 / maxTick2;
def TickData3 = rawTickData3 / maxTick3;
def TickData4 = rawTickData4 / maxTick4;
def CT1 = if GetDay() != GetDay()[1]
          then 0
          else if SecondsTillTime(openTime) <= 0 and
                  SecondsTillTime(closeTime) >= 0
               then CT1[1] + TickData1
               else 0;
plot cumulativeTick1 = if !IsNaN(TickData1) and
                           CT1 <> 0
                       then CT1
                       else Double.NaN;
def CT2 = if GetDay() != GetDay()[1]
          then 0
          else if SecondsTillTime(openTime) <= 0 and
                  SecondsTillTime(closeTime) >= 0
               then CT2[1] + TickData2
               else 0;
plot cumulativeTick2 = if !IsNaN(TickData2) and
                           CT2 <> 0
                       then CT2
                       else Double.NaN;
def CT3 = if GetDay() != GetDay()[1]
          then 0
          else if SecondsTillTime(openTime) <= 0 and
                  SecondsTillTime(closeTime) >= 0
               then CT3[1] + TickData3
               else 0;
plot cumulativeTick3 = if !IsNaN(TickData3) and
                           CT3 <> 0
                       then CT3
                       else Double.NaN;
def CT4 = if GetDay() != GetDay()[1]
          then 0
          else if SecondsTillTime(openTime) <= 0 and
                  SecondsTillTime(closeTime) >= 0
               then CT4[1] + TickData4
               else 0;
plot cumulativeTick4 = if !IsNaN(TickData4) and
                           CT4 <> 0
                       then CT4
                       else Double.NaN;
plot CT1DownTick = if cumulativeTick1 < cumulativeTick1[1]
                   then cumulativeTick1
                   else Double.NaN;
CT1DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT1DownTick.SetDefaultColor( color.white);
CT1DownTick.SetLineWeight(1);
CT1DownTick.HideBubble();
plot CT2DownTick = if cumulativeTick2 < cumulativeTick2[1]
                   then cumulativeTick2
                   else Double.NaN;
CT2DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT2DownTick.SetDefaultColor( color.white);
CT2DownTick.SetLineWeight(1);
CT2DownTick.HideBubble();
plot CT3DownTick = if cumulativeTick3 < cumulativeTick3[1]
                   then cumulativeTick3
                   else Double.NaN;
CT3DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT3DownTick.SetDefaultColor( color.white);
CT3DownTick.SetLineWeight(1);
CT3DownTick.HideBubble();

plot CT4DownTick = if cumulativeTick4 < cumulativeTick4[1]
                   then cumulativeTick4
                   else Double.NaN;
CT4DownTick.SetPaintingStrategy(PaintingStrategy.Points);
CT4DownTick.SetDefaultColor( color.white);
CT4DownTick.SetLineWeight(1);
CT4DownTick.HideBubble();
cumulativeTick1.SetDefaultColor(Color.MAGENTA);
cumulativeTick1.SetLineWeight(5);
cumulativeTick2.SetDefaultColor(Color.Dark_green);
cumulativeTick2.SetLineWeight(5);
cumulativeTick3.SetDefaultColor(Color.DARK_RED);
cumulativeTick3.SetLineWeight(5);
cumulativeTick4.SetDefaultColor(Color.BLUE);
cumulativeTick4.SetLineWeight(5);
cumulativeTick1.HideBubble();
cumulativeTick2.HideBubble();
cumulativeTick3.HideBubble();
cumulativeTick4.HideBubble();
plot allUp = if cumulativeTick1 > cumulativeTick1[1] and
                cumulativeTick2 > cumulativeTick2[1] and
                cumulativeTick3 > cumulativeTick3[1] and
                cumulativeTick4 > cumulativeTick4[1]
             then 0
             else Double.NaN;
allUp.SetPaintingStrategy(PaintingStrategy.LINE_VS_TRIANGLES);
allUp.SetDefaultColor(Color.green);
allUp.setLineWeight(5);
allup.HideBubble();
plot allDown = if cumulativeTick1 < cumulativeTick1[1] and
                  cumulativeTick2 < cumulativeTick2[1] and
                  cumulativeTick3 < cumulativeTick3[1] and
                  cumulativeTick4 < cumulativeTick4[1]
               then 0
               else Double.NaN;
allDown.SetPaintingStrategy(PaintingStrategy.LINE_VS_SQUARES);
allDown.SetDefaultColor(Color.red);
allDown.SetLineWeight(5);
allDown.HideBubble();
plot zero = if isNaN(close) then double.nan else 0;
zero.SetDefaultColor(Color.WHITE);
zero.HideBubble();
zero.HideTitle();
AddVerticalLine(SecondsTillTime(openTime) == 0 or (GetDay() != GetDay()[1] and (SecondsTillTime(0000) > 0)), "", Color.GRAY, 1);
AddLabel(!showFloatingLabels, "NYSE", Color.MAGENTA);
AddLabel(!showFloatingLabels, "NASDAQ", Color.BLUE);
AddLabel(!showFloatingLabels, "SP500", Color.DARK_RED);
AddLabel(!showFloatingLabels, "R2000", Color.Dark_green);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick1[labelOffset], "NYSE", Color.MAGENTA, yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick4[labelOffset], "NASDAQ", Color.BLUE, yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick3[labelOffset], "SP500", Color.DARK_RED, yes);
AddChartBubble(IsNaN(close[labelOffset - 1]) and !IsNaN(close[labelOffset]) and showFloatingLabels, cumulativeTick2[labelOffset], "R2000", Color.DARK_GREEN, yes);

# End Code TheoTrade QuanTicks
 

BenTen

Administrative
Staff
VIP
Someone on Github recently shared this indicator called After Hours Relative Price Movement.

Tracks the price difference from afterhours volume relative to yesterday's close. This was created to visually confirm if certain stock prices were primarily driven from afterhours movements over longer periods of time.

7AABVAZ.png


Code:
# AfterHoursRelativePriceMovement tracks the price difference from afterhour volume relative to yesterday's close

# This was created so I could eyeball if certain stock prices were primarily driven from afterhour movements over longer periods of time
# Can be overlaid with AddMarketHoursUTC to visually see correlation from international market open/closes

# Inputting Market Hours is required due to thinkscript's date function limitations
input marketOpen = 0930;
input marketClose = 1600;

# AFAIK there is no better way to do this due to SecondsTillTime rolling over after midnight, lack of real date math, and the mish-mash of UTC/EST time handling from thinkscript
def isClosedMorning = if SecondsTillTime(marketOpen) > 0 then yes else no;
def isClosedNight = if SecondsTillTime(marketClose) < 0 then yes else no;

def change = if !isClosedMorning AND !isClosedNight then 0 else change[1] + (hl2 - hl2[1]);

plot yesterdayPrice = 0;

plot priceDifference = if change != 0 then change else Double.NaN;
priceDifference.AssignValueColor(if priceDifference > 0 then Color.UPTICK else if priceDifference < 0 then Color.DOWNTICK else Color.GRAY);

# This is to visually encapsulate a week because weekend price movements can be funky
def isStartOfWeek = if GetDayOfWeek(GetYYYYMMDD()) == 1 then yes else no;
def isEndOfWeek = if GetDayOfWeek(GetYYYYMMDD()) == 5 then yes else no;

AddVerticalLine(isStartOfWeek AND SecondsTillTime(marketOpen) == 0, "Monday Open", Color.GREEN);
AddVerticalLine(isEndOfWeek AND SecondsTillTime(marketClose) == 0, "Friday Close", Color.RED);

Credit:
 

alphasandstorm

New member
I have made progress towards a solution but it is not complete / issues remain.

qtVmRjD.png


The following will plot the pre-market volume on a histogram below the chart and compare it to an average of the pre-market volume over the past 10 days:
Code:
declare lower;

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 pmVol = if IsNaN(vol) then pmVol[1] else vol;

def volLast10DayAvg = (pmVol[1] + pmVol[2] + pmVol[3] + pmVol[4] + pmVol[5] + pmVol[6] + pmVol[7] + pmVol[8] + pmVol[9] + pmVol[10]) / 10;
plot avg = volLast10DayAvg;

plot pmVOLPlot = pmVol;
pmVOLPlot.setDefaultColor(color.red);
pmVOLPlot.setPaintingStrategy(paintingStrategy.HISTOGRAM);
AddLabel(1, "RVOL= " + pmVOL/avg, Color.YELLOW);
plot ratio = pmVol/avg;
ratio.setDefaultColor(color.GREEN);

The issues:
Now while this does allow you to quantify the pre-market volume and compare it to the pre-market volume of the past 10 days, it stops summing volume once the market opens and just holds the sum of the pre-market volume data over the course of the trading day.
I'm exploring whether / how to include the regular session volume.
I imagine this negatively affects the 10DMA.

I've included a screenshot of the indicator on AAPL on the same day an SMB trader on youtube mentioned the RVOL at market open for AAPL was ~5.5 on April 17, 2020.
The closest I've been able to get to that value with this script is ~4.5 on a 30min timeframe.
Further, when switching time frames the ratio of premarket volume to the average volume changes from a value that would get you interested on a 30min timeframe - to one that seems like the volume isn't as wild as the data shows.
Being able to have a constant or nearly constant value while switching time frames would be ideal.

I've been learning thinkscript, and in order to create a scan for this you would write a line to return a boolean (true or false) value as the result. So something like:
Code:
plot result = ratio > 5;
What I would love for this script to do is:
Calculate the sum of the current pre-market bar volume and compare it to the average sum of pre-market volume at the same relative time bar of the current day for the past x days.

For example, the current bar time is 6:15am EST.
Compare the sum of the pre-market volume at that time to the 6:15am EST candle over the past x days, and return the relative volume of the current bar to the x day average.

Any help is greatly appreciated.
@BenTen @horserider
 
Last edited:
@alphasandstorm I found this script for premarket scan if someone can transform in TOS ?

Code:
//@version=4
study("PMAI", overlay = false)

tickerid = syminfo.tickerid
//bgcolor(color=#FFFFFF, transp=70)

yesterday_close = security(tickerid, "D",close[1])
today_open = security(tickerid, "D", open)
today_close = security(tickerid, "D", close)

full = ((today_close-yesterday_close)/yesterday_close)*100
prem = ((today_open-yesterday_close)/yesterday_close)*100
intrad = ((close-today_open)/today_open)*100

plot(intrad, style=5, title="Intra-Day Return", linewidth=1, color=#FC6404, transp=0)//red
plot(prem, style=5, title="Pre-Market Return", linewidth=1, color=#228CBB, transp=60)//blue
plot(full, style=2, title="Total Return", linewidth=2, color=#000000) //black

How can I use this premarket script in my watchlist column? That would be lot easier to find stocks in my watchlist where relative volume is up . Can you write for watchlist?
 

Robby Luca

New member
Hello,

I am trying to get the Relative Volume during afterhours/premarket but I have been unsuccessful.
What I am looking for exactly is a script that will give me the current day volume (including premarket) divided by the Daily Average Volume of last 60 days.

My initial script:

Code:
input length = 60;
def avgvol = average(volume, length)[1];
plot rv = round(volume/avgvol,2);

The issue I encounter is that if I put Day Timeframe then during the extended hours, it does not calculate the current volume (during premarket).
Then if I put 1m Timeframe then it will be the average volume of last 60 minutes.

So I attempted using aggregation:

Code:
input length = 60;
def agg = aggregationPeriod.DAY;
def avgvol = average(volume(period = agg), length)[1];
plot rv = round(volume(period = agg)/avgvol,2);

No success. Any suggestions? Thank you!
 

malone1020

Member
VIP
I have ended up with three different Relative Volume Watchlist codes and am now confused how these differ. Anyone willing to help me decipher these three? Is it just as simple as 1 = 60 days benchmark, 2 = 50 days and 3 = 10 days?

Thank you!

1. -------------------------------
Code:
## OneNote Archive Name: Relative Volume to past days Average Relative Volume _v02_Mobius
## Suggested Tos Name using JQ naming convention: RelVolumeVsAvgRelVolume_v02_Mobius
## OneNote Section: Volume   
## Archive Date: 02.10.2019   
## Provenance: Posted by Mobius himself in the Lounge on 02.05.2019

## End OneNote Archive Header
# Relative Volume to past days Average Relative Volume
# Mobius
# Chat Room Request 01.23.2017

input length = 60;

def v = volume(period = AggregationPeriod.Day);
def active = if secondsFromTime(0930) > 0 and
                secondsTillTime(1600) >= 0
             then 1
             else 0;
def Bars = Ceil((RegularTradingEnd(20190104) - RegularTradingStart(20190104))
                / GetAggregationPeriod());
def newDay = GetDay() != GetDay()[1];
def DayVol = if newDay
                  then v
                  else DayVol[1] + v;
def avgVolume = (fold day = 0 to length
                 with s
                 do s + GetValue(DayVol, day * Bars, (length - 1) * Bars)) / length;

plot R = DayVol / avgVolume * 100;
     R.SetPaintingStrategy(PaintingStrategy.Histogram);
     R.AssignValueColor(if R > 100
                                then color.green
                                else color.red);
# End Code

2. ------------------------------------------

Code:
# rvol watchlist column
# by [USER=1524]@huskytrader[/USER]
# 10-31-2019

def volumeAvgPeriodDays = 50;
def volumeAvg = (fold index=1 to volumeAvgPeriodDays+1 with acc=1 do acc+volume(period="DAY")[index]) / volumeAvgPeriodDays;

def volumeToday = volume(period="DAY");

plot a = Round((volumeToday / volumeAvg), 2);

3. ---------------------------------------------------------------------------------

Code:
input STime = 0930 ; #hint STime: Start of normal trading hours
input ETime = 1600 ; #hint ETime: End of normal trading hours
input thold = 1.5 ; #hint told: Threshold for color break
def bpd = 26 ; # Bars per day during active trading hours
def daycnt = 10; # Number of days

def IsActive = if secondsTillTime(ETime) > 0 and
                     secondsFromTime(STime) >= 0
                  then 1
                  else 0;


# This is the cumulative volume for the current day between STime and ETime
def cumVolume = if IsActive and !IsActive[1]
    then volume[1]
    else if IsActive then cumVolume[1] + volume[1]
    else cumVolume[1];

# This is the average cumulative volume over the same time period from the previous 10 days
def cumVolumePrev = if IsActive and !IsActive[1]
    then (volume[(bpd*1)+1] + volume[(bpd*2)+1] + volume[(bpd*3)+1] + volume[(bpd*4)+1] + volume[(bpd*5)+1] + volume[(bpd*6)+1] + volume[(bpd*7)+1] + volume[(bpd*8)+1] + volume[(bpd*9)+1] + volume[(bpd*10)+1] ) / daycnt
    else if IsActive then cumVolumePrev[1] + (volume[(bpd*1)+1] + volume[(bpd*2)+1] + volume[(bpd*3)+1] + volume[(bpd*4)+1] + volume[(bpd*5)+1] + volume[(bpd*6)+1] + volume[(bpd*7)+1] + volume[(bpd*8)+1] + volume[(bpd*9)+1] + volume[(bpd*10)+1] ) / daycnt
    else cumVolumePrev[1];

plot RelVol = cumVolume / cumVolumePrev ;

RelVol.assignValueColor(if RelVol > thold then CreateColor(0,128,0) else CreateColor(128,0,0) );
 

CashPrince

New member
You guys rock! Do you happen to have a study that calculates the premarket relative volume percentage that is color-coded in a watchlist for ThinkorSwim? It would also be nice to have it in a study with labels.

Gracias,
Prince

Code:
# Cumulative Overnight Volume
# UpTheCreek
# V01.2016


declare lower;
declare hide_on_daily;
input StartTime = 1700;
input EndTime = 0930;

def OverNightActive =  if (SecondsFromTime(StartTime) >= 0 and
SecondsTillTime(0000) <= 0)
or
(SecondsFromTime(0000) >= 0 and
SecondsFromTime(EndTime) < 0)
then 1
else Double.NaN;

def CumVol1 = if !IsNaN(OverNightActive) and IsNaN(OverNightActive[1])
then volume
else if !IsNaN(OverNightActive)
then if !IsNaN(volume)
then CumVol1[1] + volume
else CumVol1[1]
else 0;


plot cumvolP1=cumvol1;

AddLabel(yes, "Cumulative Overnight Volume = " + CumVol1);
 

lambda100

New member
I'm trying to create a thinkscript that shows a label with the following info: "Pre Market Vol: (Cumulative Vol between PM open till Market open)" & "Gap%: ((1MIN close price - Yesterday Close price) / Yesterday Close price * 100)"

(I'm not a programmer)

PM Volume Indicator: Don't know how to do it. My question is, how can I find volume between 2 periods of time?

EDIT - GAP indicator is working. Gap Percentage Indicator

Code:
plot Y_Close = close(period = "DAY")[1];
plot T_Open = IF SecondsTillTime(0930) < 0 then open(period = "DAY") ELSE open(period = "MIN");

def gap = (((T_Open - Y_Close) / (Y_Close)) * 100);

AddLabel(yes, "Gap%: " + "gap");

Thank you very much!
 
Last edited:

ol0nny05

New member
So there is a group in Virtu Capitals (NITE exchange), one of the small Market Maker (MM) who come in and buy up share prices early and later pump them. Is there a script to scan for this?

So a script would look for premarket open bid in NITE asking 0.01. I ask my brother who is a coder for help but I didn't see any function to search for exchange or bid price.


153079947_760034208220373_6747618200772424397_o.jpg
 
Last edited:

Similar threads

Top