How to do make a custom Scanner?


Category:
0
0

I am sure this is posted somewhere in detail  I am reading about the many scans that you have created and given away for free.  But I am starting at the very begining, and I dont even know how too add a custom Scan to my Thinkandswim platform.  

I tried to do the following.  I took an existing scan info to use as a test ( I pasted it below after the message

 

 As you can see from my graphic that  the original ask me for inputs. while the one i made by copy and pasting does not.     Would you be able to point me in the right direction.  Thank you 

 

 

 

#Hint: The VWAP Scan filters for securities that have a current price above or below any given number of standard devation moves of the of the current VWAP. \n\nThe default aggregation period is 15 minutes. This period as well as the time frame used in VWAP can be changed in the scan.\n\nFor faster results choose to “Scan In” a subset of “All Symbols”.

#Wizard text: The current price is 

#Wizard input: choice

#Wizard input: numDev

#Wizard text: standard devation moves in the

#Wizard input: timeFrame

#Wizard text: VWAP

 

input numDev = 2.0;

input timeFrame = {default DAY, WEEK,  MONTH};

input Choice = {default “Greater Than”, “Less Than”};

def cap = GetAggregationPeriod();

def yyyyMmDd = GetYYYYMMDD();

def periodIndx;

switch (timeFrame) {

case DAY:

    periodIndx = yyyyMmDd;

case WEEK:

    periodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7);

case MONTH:

    periodIndx = RoundDown(yyyyMmDd / 100, 0);

}

def isPeriodRolled = CompoundValue(1, periodIndx != periodIndx[1], yes);

 

def volumeSum;

def volumeVwapSum;

def volumeVwap2Sum;

 

if (isPeriodRolled) {

    volumeSum = volume;

    volumeVwapSum = volume * vwap;

    volumeVwap2Sum = volume * Sqr(vwap);

} else {

    volumeSum = CompoundValue(1, volumeSum[1] + volume, volume);

    volumeVwapSum = CompoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);

    volumeVwap2Sum = CompoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));

}

def price = volumeVwapSum / volumeSum;

def deviation = Sqrt(Max(volumeVwap2Sum / volumeSum – Sqr(price), 0));

 

def VWAP = price;

def UpperBand = price + numDev * deviation;

def LowerBand = price – numDev * deviation;

plot scan;

switch (Choice){

case “Greater Than”:

    scan = close > UpperBand;

case “Less than”:

    scan = close < LowerBand;

}

 

Attachments:
Marked as spam
Posted by (Questions: 5, Answers: 1)
Asked on September 16, 2019 3:09 am
147 views
0
Private answer

Well to begin, make sure you have viewed the videos I have published on this topic. Seeing this done on the platform will fill in most of the gaps in your understanding. I have a set of videos listed for new users to Thinkorswim. Several videos are listed in this post, just focus on the ones for the Scans category:

https://www.hahn-tech.com/ans/where-to-start/

As to your specific request about user inputs. These are not currently supported for custom scans in Thinkorswim. The only way to adjust user inputs for a custom scan is by adjusting them in the code itself. (you will see examples of this while watching the videos linked above).

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on September 16, 2019 10:08 am