Jump to content
Medved Trader Forums
  • 0
Jerry Medved

Real-Time Scanner - Give me the scans you want!!!

Question

We will have a new real-time (and EOD) scanner in one of the upcoming beta versions.  It will use the same code as the Paintbars - will be able to reference indicators, etc.

We want to include some common scans with the program so you can have examples, starting point for how to do things.... So....

Please give me some common scans that you would like to see, or that you currently use with other sites, software, etc.

  • Like 2

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

50 Day Moving Average Crosses 200 Day Moving Average

When the 50 day SMA crossed below the 200 day SMA, it is called a "death cross."  When the 50 crossed above the 200, it is called a "golden cross."

 

Thanks

Share this post


Link to post
Share on other sites
  • 0

Hi Jerry, the "ANTS" signal scan please:

What would the MT Advanced Paintbar or Scanner code look like to implement the situation when 12 or more Close bars, out of the prior 15 Close bars, are all up?

Basically, if one encounters a daily chart where price is up 12 out of the past 15 days it is exhibiting unusual strength.

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

http://cedric.froment92400.free.fr/index.php/papiers/interview-gil-mores/

Q: I have heard of a buy signal being given if a stock is up in 12 of the past 15 days. Where would the actual entry point be?

A: I look for 11 out of 13 or 12 out of 15 days up in a row after a breakout. Once the stock does this, I’ll wait for it to move sideways or perhaps pull back for anywhere from 3-10 days, and once it moves back out through the top of this little formation I will come into the stock heavily as I add to my original position, or even sometimes just enter the stock for the first time.

 

/****************************************************************************************************
This is a modified eSignal script to make the color of the price bars be relative to prior closes and ANTS signal.
Blue bars are drawn when the current price is greater than the close of the previous bar close. Red bars are drawn if the current price is below the previous bar's closing price.

This script also counts the number of blue bars over 15 consecutive periods. When there are 12 or more blue bars in that period a triangle is drawn above the last bar where that condition is met. This Script was created by Mike Scott. 2017 sourced at:  https://gilmoreport.com/education/gilmo-toolbox/
*****************************************************************************************************/
function preMain() {
    setPriceStudy(true);
        setStudyTitle("O'Neil 12 of 15");
        setColorPriceBars(true);
        setDefaultPriceBarColor(Color.blue);
    
        var fp1 = new FunctionParameter("nBars", FunctionParameter.NUMBER);
        fp1.setName("Number of Bars");
        fp1.setLowerLimit(1);
        fp1.setDefault(15); //used for 12 of 15 up bar calculation
}

function main(nBars) {
// This part colors up and down bars based on close-to-close prices//

    var vC = close();
    var vPC = close(-1);

    if(vC == null || vPC == null) return;

    if(vC > vPC) {
        setPriceBarColor(Color.blue);
    } else if(vC < vPC) {
        setPriceBarColor(Color.red);
    }

/*
 * This part flags with a triangle when there are 12 or more bars out of 15 (nBars) higher closes
 */
    var i = 0;
    var nStateTotal = 0; //set bar counter to zero
    
    if(close(-nBars+1) == null) return;
        
    for(i = 0; i < nBars; i++) {
        if(close(-i) > close(-i-1)) {
            nStateTotal = nStateTotal + 1;
        }
    }
    
    if(nStateTotal == 0) {
        return ;
    } else if(nStateTotal >= 12) {
        
    drawShape(Shape.UPTRIANGLE,AboveBar1)
    }
    
    return;
}

Share this post


Link to post
Share on other sites
  • 0

@L W - will include that one

@Croesus - would you have actual formulas? Even if pseudo code

@vectormix - Here is the code (and will include).  11 actual lines of code, and would have been 7 if I would have just hard coded 12 and 15.
 

public void MainCalculation()
{
    // Instead of hard coding 12 and 15, parameterize it, so end user of the Paintbar can 
    // just edit params and specify the values instead of having to edit the Paintbar. 
    // This way you can use the same paintbar mutliple times with different values
    
    DefinePaintbarParameter("NUMTOCHECK", "# Bars Total", true, 2, 500, 1, 15);
    DefinePaintbarParameter("NUMUP", "# Bars Up", true, 1, 500, 1, 12);
    
    // More efficient to detect 4 or more down than 12 up
    int numTotal = (int)GetPaintbarParameter("NUMTOCHECK");
    int maxNotUp = numTotal - (int)GetPaintbarParameter("NUMUP");
    int numNOTUp = 0;
    
    for (int x = 0; x < numTotal; x++)
    {
        if (Close[x] <= Close[x + 1] AND ++numNOTUp> maxNotUp)
            return; // and do not set anything
    }
    // If it got here, then must be a match;
    
    SetColorAndShape("Main", PBShape.ArrowUp, SysColor.Positive);
    TriggerAlert("Main");
    SetScanResult(numTotal - numNOTUp);
}

Share this post


Link to post
Share on other sites
  • 0

Thank you Jerry! Your promptness and efficiency to the community are outstanding!

That example will help navigate the Advanced Paintbar Manager better, too. :) 

Other scanner requests:

Pocket Pivot Volume Signature: "The volume should be higher than the largest down volume of the last 10 trading days."

Pocket Pivot Origination: http://www.virtueofselfishinvesting.com/pocket-pivot

GUI Implementation example: http://www.chartmill.com/documentation.php?a=408&title=Pocket Pivots

 

Intraday Volume Scanner: Calculates on a real-time basis how active a stock is trading vs. its average intraday volume over or under a certain threshold.

A separate calculation for average daily dollar volume is also included that could be used as a separate and similar scanner.

Example:

Symbol

Avg Volume

Chg

Current Px

Curr Volume

Time

Intraday Avg Vol

Pct Diff

Avg $ Volume

Current $ Volume

Current Avg $ Volume

BIDU

13,353,000

-0.700

$74.670

8,050,370

1147

10,303,733

-21.87%

$997,068,510.00

-$5,635,259.00

-$7,212,612.99

CRM

2,617,000

-1.090

$93.920

2,100,522

1147

2,019,387

4.02%

$245,788,640.00

-$2,289,568.98

-$2,201,131.36

 

Excel spreadsheet code:

Columns: A B C D...

Rows

1

2

3

Symbol

Avg Volume

Chg

Current Px

Curr Volume

Time

Intraday Avg Vol

Pct Diff

Avg $ Volume

Current $ Volume

Current Avg $ Volume

BIDU

13353000

=winros|Change!bidu

=WINROS|Last!bidu

=winros|totalvol!bidu

1147

=(F2-630)/(1300-630)*B2

=E2/G2-1

=B2*D2

=E2*C2

=C2*G2

CRM

2617000

=winros|Change!crm

=WINROS|Last!crm

=winros|totalvol!crm

=F2

=(F3-630)/(1300-630)*B3

=E3/G3-1

=B3*D3

=E3*C3

=C3*G3

 

 

To help Croesus' request along, some references for tackling:

Cup and handle: http://www.haikulabs.com/mh.htm 

Flat-Base: http://www.thedigeratilife.com/blog/flat-base-chart-pattern-stock-trades/

Double-Bottom (Bulkowski defines different "Double-Bottoms" in sub-categories that may help the pattern fit dependent on several situations the shape-pattern can take): http://thepatternsite.com/dbsetup.html

 

Edited by vectormix

Share this post


Link to post
Share on other sites
  • 0

Let me qualify our request - we are looking for type of scans that can be defined as combinations of indicators or other quote values.  We will look at setting up some scans that do chart pattern recognition, but that is drastically more complicated. 

Share this post


Link to post
Share on other sites
  • 0

Hi Jerry

and thanks Vectormix for the information.

here is a potential semicup code, Wealthlab code so no sure if they help.

http://www2.wealth-lab.com/WL5Wiki/TASCApr2011.ashx

 

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using TASCIndicators; // requires version 2011.4.0.0 min

namespace WealthLab.Strategies { public class SemiCupDetector : WealthScript { StrategyParameter _minCupBars; StrategyParameter _reversalPct;

public SemiCupDetector() { _minCupBars = CreateParameter("Min Cup Bars", 20, 20, 100, 10); _reversalPct = CreateParameter("Pk Rev. %", 5, 0.5, 8, 0.5); }

protected override void Execute() { DataSeries peakBars = PeakBar.Series(Close, _reversalPct.Value, PeakTroughMode.Percent); SemiCups semiCups = new SemiCups(this, _minCupBars.ValueInt, peakBars); // semiCups.ProcessSemiCups(); // not required for TASCIndicators 2011.4.0.1 semiCups.Draw(); int bar = Bars.Count - 1; // Scan for current pattern foreach (KeyValuePair<int, SemiCup> kvp in semiCups.Cups) { SemiCup sc = kvp.Value; if (sc.Active && sc.Status[bar] == CupStatus.SemiCupDetected) BuyAtMarket(Bars.Count); } } } }

As another potential scan using current indicators what about a

TTMSqueeze scan and one

using TTMSqueeze on different timeframes as per say: A weekly squeeze and daily squeeze concurrently

Edited by Croesus

Share this post


Link to post
Share on other sites
  • 0

the wealthlab stuff - the core calculation is in the methods that the code is calling, so not helping much

As for TTMSqueeze - that would be easy since the indicator is already implemented. What exact criteria?

Share this post


Link to post
Share on other sites
  • 0

For scanner:

Pocket Pivot Volume Signature: "The volume should be higher (or lower) than the largest down volume of the last 10 (or X # of) trading days (or bars)."

Share this post


Link to post
Share on other sites
  • 0

So the premise is that a squeeze is a continuation pattern within a trend when volatility is reduced (Boll inside Keltner), when you compress something for long enough the pressure needs to be released and we move to high volatility. A move in the direction of the preceding trend 70 -80% of the time.

Therefore the scan is looking for a period where we have a squeeze on a weekly chart and an inside squeeze on a daily chart indicating multi-time frame compression and thereby increasing the probability of a move generally 7 to 8 bars of the relevant timeframe. So you can see with a weekly squeeze supporting a daily squeeze the probability of a move increases.

Weekly

Daily Squeeze Fires and BOOM

Share this post


Link to post
Share on other sites
  • 0

@Croesus - Keep in mind that a chart (and thus scanner) can only operate on one Time Period and Frequency at a time. So if you have a chart with daily frequency and one with weekly frequency, You cannot refer to indicators on both.  However, as an example, if you have MA 20 on a Weekly chart, that would be basically the same as MA 100 on a daily chart (5 days per week). Same adjustment can be done for other indicators. 

So in the case of the squeeze you defined, what specific indicators and parameters are you referring to? and what exactly am I checking for? If bollinger high/low bands are both inside Keltner bands? for how many days?  with what range?  some of this stuff is easy to see visually, but we need to quantify it.

If you have an example of a chart with the relevant indicators on it showing the condition you want to capture, email it to me

  • Like 1

Share this post


Link to post
Share on other sites
  • 0
On 5/3/2017 at 4:51 PM, Jerry Medved said:

We will have a new real-time (and EOD) scanner in one of the upcoming beta versions.  It will use the same code as the Paintbars - will be able to reference indicators, etc.

We want to include some common scans with the program so you can have examples, starting point for how to do things.... So....

Please give me some common scans that you would like to see, or that you currently use with other sites, software, etc.

Jerry, it would be awesome if you could implement the scan criteria from the below that isn't built-in to Medved Trader:

https://www.trade-ideas.com/Help.html

Especially Relative Volume, Change X Minutes, Volume X Minutes, Volume Today, Spread, and Average Daily Volume.

Besides those, many of the Trade-Ideas indicators are black box eye candy (ex. Triangle Top), that is not really useful. However, if the underlying code was viewable, and one could adjust the parameters, then it might be useful.

Share this post


Link to post
Share on other sites
  • 0

1. "Relative Volume" - that would not be very easy to implement, mostly because it has to look at more than 1 or 2 day's data (and scan tries not to use more than that in order to save on memory consumption and speed)

2. Change X minutes - in MT advanced mode (for let's say 5 minutes), that would be Close - Close[5]  or, if you want it in percent,  (Close-Close[5])*100/Close[5]

3. Volume X minutes - I think that is the same as MT's "Pace" indicator? You give it a period (let's say 10 min) and an averaging period (let's say 2 days). It calculates what the average volume is for ANY 10-min period during the last 2 days and compares (percent) the last 10 minute volume to that.

4. Volume Today and Spread - those are there already (well, Spread is Ask-Bid, but you know what I mean)

5. Average Daily Volume - that's in there but unfortunately not every source sends that,

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×