Pre-Market Gap from Previous Close Scanner for ThinkorSwim

N

nhp

New member
@tomsk Any great scripts you have found for a pre-market breakout/gap up scanner for day trading?
 
C

cacososa

New member
Hello
Is it possible to add a column with this script to a watchlist?
I would like to have a column in my watchlist that shows my what stocks opened with a GapUp. Any help would be greatly appreciated
 
H

heramone

New member
VIP
@ExactlyMyPoint - I copied and past in the TOS, no reaction, no result. should I scan in the morning or is there any additional condition or study need to include. Please advise. Thanks
 
B

Bhavesh

New member
Do you have code for Post market gainer code just after market close ?
 
V

vikram

New member
VIP
How can I create a scanner to filter unusual buy volumes, when the market opens at 9.30am ?
 
zeek

zeek

Active member
2019 Donor
So i have a watchlist with some different stocks and i want to create a scan from this watchlist with 2 conditions and have an alert when both of these are met,
1. The stock is up more than 10% in pre-market
2. The volume is above 50k

Nr 2 is no problem setting up in scan section but nr 1 is the problem. The only one avaliable from the stock filters is % change but that one will not see the movement in pre-market. Is there any way to add this PM % change filter to a scan?
 
S

shifann2000

New member
Hi friends
Do you have any scanner for pre and post market scanner? please update
 
evanevans

evanevans

Member
Could not get this or any of the different posted versions in this thread to work.
 
T

TraderBoy66

New member
OK, OK, I am an OCD programmer. I modified it slightly to make it a bit more gooder and you don't have to delete anything. Just set the inputs in your scan.

-------------------------------------------------------------------

Code:
input percentGap = 0.5;
input direction = {default Up, Down};

def dnColor = 5;    # red
def upColor = 6;    # green

def arrowColor;
def arrowDirection;

def marketOpen    = 0930;
def marketPreOpen = 0730;
def marketClose   = 1555;

def PrevClose = if SecondsTillTime(marketClose) == 0 and
                   SecondsFromTime(marketClose) == 0
                then close
                else PrevClose[1];
def ScanActive = if SecondsTillTime(marketOpen) >= 0 and
                    SecondsFromTime(marketPreOpen) > 0
                 then 1
                 else 0;
def ll = if ScanActive and !ScanActive[1]
         then low
         else if !ScanActive
         then double.nan
         else if ScanActive and low < ll[1]
         then low
         else ll[1];
def hh = if ScanActive and !ScanActive[1]
         then high
         else if !ScanActive
         then double.nan
         else if ScanActive and high > hh[1]
         then high
         else hh[1];

def isPlot;
def gapChange;

switch (direction)
{
    case Up:
        arrowColor = upColor;
        arrowDirection = PaintingStrategy.BOOLEAN_ARROW_UP;
        gapChange = 1.0 + (percentGap / 100.0);

        isPlot = if ScanActive and ll > PrevClose * gapChange
                 then 1
                 else 0;

    case Down:
        arrowColor = dnColor;
        arrowDirection = PaintingStrategy.BOOLEAN_ARROW_DOWN;
        gapChange = 1.0 - (percentGap / 100.0);

        isPlot = if ScanActive and hh < PrevClose * gapChange
                 then 1
                 else 0;
}

plot GapPlot = (isPlot == 1);

GapPlot.SetPaintingStrategy(arrowDirection);
GapPlot.SetDefaultColor(GetColor(arrowColor));

Is there an easy way to amend this code so I can use in a scanner? It would also be nice to be able to set the gap % without editing the code.
 
M

MoneyMagnet

New member
Greetings, Folks!

I'm not much of a programmer, but I noticed what appear to be time references in these lines:

Code:
def ScanActive = if SecondsTillTime(0930) >= 0 and
                    SecondsFromTime(0730) > 0

930 would refer to market open per Eastern time, correct? I'm on Pacific time, and my TOS is set to display time in PST. Do I need to change these lines to reflect the three hour time difference, or does ThinkScript always assume EST even if the interface is set to display a different time zone?

Thanks!
 
rad14733

rad14733

Well-known member
VIP
@MoneyMagnet Thinkorswim always uses EST regardless of where you are located as that is where the NYSE is based...
 

Similar threads

Top