SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : Underexposed Technical Analysis
AQN 5.840-1.2%Dec 4 3:59 PM EST

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Underexposed who wrote (721)1/9/2020 11:47:53 AM
From: Underexposed  Read Replies (1) of 914
 
DIS: How to make a stock screener - Lesson 2 - review of Lesson 1 and MACD query start



*********************Remember to set up your computer as in Lesson 1***************************************



Ok....let us review what we did last lesson. Here is our final query

apply to Sector(Aerospace)
and add column separator
and add column exchange
and add column sector
and add column industry
and add column separator
Where stock close between 35 to 50

In your StockFetcher application R-Click on "New Filter" in the top menu.... this will bring you to the yellow
query edit screen.

Now copy and paste our final menu into the yellow box.....test that the query works by pressing "Fetch Stocks"...you should get the 3 stocks returned as last time.

If you don't then R-Click on the " * " box and choose "Debug filter" to see where the problem is and try to correct it or delete and re-enter the query and press "Fetch Stocks" again

Now let's add some additional functionality to your query

1. Adding a comment to document something in your query

It is important to document what you are doing in a query.... especially if the query is large and complex. Sometimes it is dificult to understand a certain step or why you added it, especially if you are looking at it
years later.

To do this ....wrap your statement in
/* Start of the query */
This will isolate this line from the operation of the query and will be colored red to make the statement stand out

Put this comment between the setup of the query and the start of the actual working part and this will look like the following
and add column separator
/* Start of the query */
Where stock close between 35 to 50
Now press Fetch Stocks and see if the query runs properly
then press Debug Filter

You should see green check marks on all statements EXCEPT the comment statement which is left blank

You have just documented part of your query

2. Making a query valid for several options

Let us say you are really interested in only 3 sectors of the stock market. You could duplicate this query
three times each with a different sector named.... or you can adapt what we learned in option 1 above and do this:
/*apply to sector(Aerospace)*/
/*apply to sector(Basic Materials)*/
/*apply to sector(Finance)*/
and add column separator
and add column exchange
and add column sector
and add column industry
and add column separator
/*Start of the query*/
Where stock close between 35 to 50
if you copy this to you query edit box and over write the previous query you will see the first 3 lines are RED... non-functional

Now delete the first 2 characters, /*, for just one line...any of the first 3 lines and press Fetch Stocks.

You will see stocks just for that sector...

now add the /* back to that line and remove them from a different line of the first 3 line press Fetch Stocks
Now you get the results for a different different sector

NEAT EH!!!!!

We will use this technique later when we want 2 options in a query.... say option 1: a number is greater than and option 2: a number is less than..... more on that much later

3. you want stocks of a specific Exchange

Maybe you only want stocks from a certain exchange.eg: NYSE

Simply add this statement at the end of the set-up

Exchange is NYSE
press debug filter first.... it will confirm the statement is correct BUT ALSO will show you how many stocks you have eliminated by this statement....maybe you want to try another exchange to look at them later.

So now you can see how you can take a basic query and enhance it when you get a new idea

**********************************************************************************************************************

Starting a new query

At the start of these lessons, I stated I wanted to try to make a query using criteria I use in my TRIGGER chart. In this case I want to find stocks nearing a positive breakout.

I used to make the mistake of diving into making the complete query in one go....big mistake...a better way
is to make the query in testable modules and then link them together.

so to start we are going to look at MACD

Here is a good example of a stock with a few of breakouts



Focus your attention on the MACD....What MACD criteria do you think you should be querying for when in a breakout

Think about it..... that is your homework for next lesson

UE
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext