A stock's volume for the current day (let's say at 11:32am) is compared to its average historical volume for the same percentage of the day. The volume buzz tells you how far ahead or behind the stock is based on its normal historical activity. A volume buzz of +250% means the stock is trading 250% more than normal for this portion of the day. A figure of -50% means the stock is trading at only half of its norm for this portion of the day. A figure of 0 means nothing unusual is going on in either direction.

thanks

]]>

Id’ like to screen the market in order get the stocks that have an >70% distance from 52 week low.

Could you please help me how to write this code?

Many Thanks,

]]>Thanks

]]>Pasted below is what I've got so far.

The spike scan and BO scan both work separately. Put together (as below) only the BO scan results appear in portfolio. How do I get the spike alerts to also appear?

Also, for the spike scan the 11 length (bar) array is specified explicitly. Is it possible to change the spike code below to use "period" parameter to set the array length to any desired value, i.e. so I can set number of bars to eg 16.

I tried to change the BO indicator to also include a volume condition. It doesn't work - how can I correct this?

if (Max(BarsTotal,Close) == Close) && BarVolume[1]>15000

public void MainCalculation()

{

DefinePaintbarParameter("Period","Period",true, 2, 100, 1, 11);

var lvca0 = Math.Log(Close[1]/Close[2]);

var lvca1 = Math.Log(Close[2]/Close[3]);

var lvca2 = Math.Log(Close[3]/Close[4]);

var lvca3 = Math.Log(Close[4]/Close[5]);

var lvca4 = Math.Log(Close[5]/Close[6]);

var lvca5 = Math.Log(Close[6]/Close[7]);

var lvca6 = Math.Log(Close[7]/Close[8]);

var lvca7 = Math.Log(Close[8]/Close[9]);

var lvca8 = Math.Log(Close[9]/Close[10]);

var lvca9 = Math.Log(Close[10]/Close[11]);

var lvca10 = Math.Log(Close[11]/Close[12]);

double[] LogValCloseArray = new double[11] {lvca0, lvca1, lvca2, lvca3, lvca4, lvca5, lvca6, lvca7, lvca8, lvca9, lvca10};

double CloseArrayAverage = LogValCloseArray.Average();

double CsumOfSquaresOfDifferences = LogValCloseArray.Select(val => (val - CloseArrayAverage) * (val - CloseArrayAverage)).Sum();

double SDevClose = Math.Sqrt(CsumOfSquaresOfDifferences / (LogValCloseArray.Length - 1));

var m = SDevClose * Close[1];

var pricespike = (Close-Close[1])/m > 3;

var lvva0 = Math.Log(BarVolume[1]/BarVolume[2]);

var lvva1 = Math.Log(BarVolume[2]/BarVolume[3]);

var lvva2 = Math.Log(BarVolume[3]/BarVolume[4]);

var lvva3 = Math.Log(BarVolume[4]/BarVolume[5]);

var lvva4 = Math.Log(BarVolume[5]/BarVolume[6]);

var lvva5 = Math.Log(BarVolume[6]/BarVolume[7]);

var lvva6 = Math.Log(BarVolume[7]/BarVolume[8]);

var lvva7 = Math.Log(BarVolume[8]/BarVolume[9]);

var lvva8 = Math.Log(BarVolume[9]/BarVolume[10]);

var lvva9 = Math.Log(BarVolume[10]/BarVolume[11]);

var lvva10 = Math.Log(BarVolume[11]/BarVolume[12]);

double[] LogValVolumeArray = new double[11] {lvva0, lvva1, lvva2, lvva3, lvva4, lvva5, lvva6, lvva7, lvva8, lvva9, lvva10};

double VolumeArrayAverage = LogValVolumeArray.Average();

double VsumOfSquaresOfDifferences = LogValVolumeArray.Select(val => (val - VolumeArrayAverage) * (val - VolumeArrayAverage)).Sum();

double SDevVolume = Math.Sqrt(VsumOfSquaresOfDifferences / (LogValVolumeArray.Length - 1));

var n = SDevVolume * BarVolume[1];

var volumespike = (BarVolume-BarVolume[1])/n > 3;

var scan = pricespike && volumespike && BarVolume[1]>15000;

SetScanResult(scan);

if (scan)

{

SetColorAndShape("Spike", PBShape.ArrowUp_Hollow, SysColor.VolumeUp);

TriggerAlert("Spike", @"Spike");

SetScanResult("Spike");

return;

}

DefinePaintbarParameter("BarsTotal", "# Bars Total", true, 2, 500, 1, 15);

int BarsTotal = (int)GetPaintbarParameter("BarsTotal");

if (Max(BarsTotal,Close) == Close) && BarVolume[1]>15000

{

SetColorAndShape("Breakout", PBShape.ArrowUp_Hollow, SysColor.VolumeUp);

TriggerAlert("Breakout", @"Breakout");

SetScanResult("Breakout");

}

}

]]>

I have a simple script that I used elsewhere to find a spike in price/volume. I would like to use it here but need some assistance.

There are two parts, first one for a spike in price, second part for a spike in volume. Both are identical in form.

The final condition for the scan is to have true results for both the price and volume condition.

The pseudocode is below. The ''def'' keyword is used to define a variable or a constant, and also a condition.

c is the current price of the stock (not a 'closed' price - despite the name). c[1] is the closing value (price) of the last completed bar. c[2] is the closing value of the bar before c[1]. Same thing with volume v, v[1], v[2], v[3] etc.

The stdev(closeLog, 11) calculates the standard deviation of 11 values of closeLog. So (if my understanding is correct) first value will be log(c[1] / c[2]), second value will be log(c[2] / c[3]), etc up to the final 11th value, which will be log(c[11] / c[12]).

Any suggestions or help converting to a format suitable for the advanced scanner would be appreciated.

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

def length = 11;

def c = close;

def closeLog = log(c[1] / c[2]);

def SDevClose = stdev(closeLog, length) * sqrt(length / (length-1));

def m = SDevClose * c[1];

def pricespike = (c - c[1]) / m > 3;

def v = volume;

def volumeLog = log(v[1] / v[2]);

def SDevVol = stdev(volumeLog, length) * sqrt(length / (length-1));

def n = SDevVol * v[1];

def volumespike = (v - v[1]) / n > 3;

scan = pricespike and volumespike;

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

]]>

Would I be able to create an indicator using the paintbar tools that would display moving averages? In other words I know I'm able to draw a horizontal line w/ the paintbar; can I plot a moving average through that system so I could write an indicator that would display multiple moving averages that could be toggled on or off together?

If not, any other suggestions?

Thanks!

]]>This means you cant have that feature and scan for blocks after hours

Be better to make those options independent.

]]>Can there be an offset on chart for Smoothed Heiken-Ashi indicator indicator or display this indicator as line on chart?

How can I set an alert when a new arrow is formed?

Thanks.

]]>I run daily scans on historical data in MT on a portfolio of 1500 stocks. It takes a long time to run in Auto-Backfill mode. How can I setup the scanner to only backfill when necessary?

For instance, if I want to filter all stocks with 52Rng% above 50 I do not need to backfill historical data for stocks where 52Rng% is below 50. Is it possible to setup a code like :

else

{

BackFill;

...

}

What would be the command line to use to backfill only when necessary?

Regards,

Oliver

]]>I was working to convert them all into one indicator using setline but they all seem to be in the foreground; in front of the chart. Is there any way to set them to the background? So far the paintbar option to put it in the background seems to not impact the setline itself.

Also, one other question.. I'd like to draw a line at certain market caps - like 1B market cap or 100M market cap. Can I use SystemData.SharesOustanding in my line formula? For instance if I said to draw a line at 50000/SystemData.SharesOutstanding what that draw a line at $50B market cap? (Note I wasn't sure if the SharesOutstanding was in millions or not).

Thanks

]]>I am trying to replicate the code on https://www.prorealcode.com/prorealtime-indicators/hikkake-pattern/ for the Paintbar to make my own indicator.

But I am a little confused how to draw an arrow and I can't seem to find any examples. My code at the moment is

I am not sure how to get the graphics engine and such to pass into DrawArrowUp and how to do the calculations for the X,Y.

public void MainCalculation()

{

bool HikakkeBull = false;

bool WithinTimeLimit = false;

double InsideBullBarHigh;

int InsideBarNumber;

int HikakkeBarNumber;

if (High[1] < High[2] && Low[1] > Low[2]) {

HikakkeBull = true;

InsideBullBarHigh = High[1];

InsideBarNumber = candleIndex - 1;

HikakkeBarNumber = candleIndex;

}

if (HikakkeBull) {

WithinTimeLimit = (candleIndex - HikakkeBarNumber) <= 3;

if (Close > InsideBullBarHigh && WithinTimeLimit) {

Color upArrow = Color.Green;

DrawArrowUp(g, upArrow, candleIndex)

HikakkeBull = false;

}

}

}

]]>1. I used a "3" as the shape and set it to show below the bar to indicate 3EMA. I don't know for sure that I'd do it, but was wondering if you can use user defined text to display as the shape, so whether I could show on the chart "3E" or "3EMA" below the candle if I wanted to?

2. I was also wondering how much control I had over the indicator placement. For instance, I have it below the bar. Can I add any padding so it drops down x pixels below the bar to add any additional space or in some other way adjust the placement?

Thanks

]]>e.g. How changing SmallWickPercent or LongWickPercent for 'Hammer' pattern changes the the patter recognition?

]]>

What I'm struggling with is the SetLine ID and X axis values.

ID, I'm not sure what to put, so I copied TradingDay.DayNumber from the support example

X1 and X2, I put CandleNumber -15, Candle Number, to at least see if it would plot.

The result is, it only plots the 4th (blue) SetLine.

Do you have any suggestions for the proper ID and X values, so that all 4 lines plot, and starts from the beginning of 3 sessions ago?

___________________________________________________

]]>

* added ability to draw "bands" in paintbars. You just do SetYValue(value1, value2) for upper/lower values of the band, and do SetColor(0,..) SetColor(1,...) for the band borders and SetColor(2,...) for the band fill if you want one.

* added ability to draw lines on the chart from paintbar (this is not in beta yet, if you want to try it, email me. But will be in next beta).

* the lines function will also allow you to put text on the chart from a paintbar. Just draw a 0-width line with text on it.

Here is an example paintbar that draws High and Low lines on the chart every N minutes:

double PeriodHigh; double PeriodLow; double PrevPeriod; int PeriodStart; public void MainCalculation() { if (CandleNumber == 0) // just starting { PrevPeriod = -1; } var MinFromSessionStart = (Timestamp-TradingDay.SessionStart).Ticks / TimeSpan.TicksPerMinute; if (MinFromSessionStart<0) return; DefinePaintbarParameter("Period", "Minutes", true, 5, 1000, 1, 30); var min = Convert.ToInt32(GetPaintbarParameter("Period")); var Period = MinFromSessionStart/min; if (Period!=PrevPeriod) { PeriodHigh = High; PeriodLow = Low; PeriodStart = CandleNumber; PrevPeriod = Period; } PeriodHigh = Math.Max(PeriodHigh, High); PeriodLow = Math.Min(PeriodLow, Low); Color HColor = GetNamedColor("High", SysColor.MainIndicator1); SetLine(TradingDay.DayNumber*1000+Period, HColor, PeriodStart, PeriodHigh, CandleNumber + 1, PeriodHigh, 1, "H", LineTextPosition.RightAbove, 0.8); Color LColor = GetNamedColor("Low", SysColor.MainIndicator2); SetLine(TradingDay.DayNumber*2000+Period, LColor, PeriodStart, PeriodLow, CandleNumber + 1, PeriodLow, 1, "L", LineTextPosition.RightBelow, 0.8); }]]>

So if the stock averages 5M shares a day and after hours 1M shares have traded it would show 20%.

]]>3 Parameters 5 /8/ 13

basic code:

If 5 > 8 & 8>13

then CALLS is the message.

Code:

CrossesUP has an index is this represented as a candle?

I want the signal only after the close of the candle not before or not during the current candle which I believe is index 0?

I couldn't find documentation on this topic in help.

Thanks,

Z

]]>Consistently getting hits on volume much lower than 15,000 for the last minute. Please check

]]>

Normally it would be "Enum doodaa {one, two, three};", right?

it no workie!

]]>It's drawing a line at all time highs but only if the high was > 90 days ago. Is there a way to draw that horizontal line.

Thanks

]]>How to set up the following scans? If you give me one scenario (say 9 ema long, 20 ema long) setup, I can replicate the others.

9 EMA (long)

How to scan premarket for stocks above the 1,5,10,30,60 min charts, but below on the 240min.

2. Alert on on a break above the 240min chart.

3. Alert when there is a close below on the 10min chart.

9 EMA (short)

How to scan premarket for stocks below the 1,5,10,30,60 min charts, but below on the 240min.

2. Alert on on a break above the 240min chart.

3. Alert when there is a close above on the 10min chart.

20 EMA (long)

1. Scan for stocks trading above weekly,monthly and yearly charts, but below on the daily

2. Alert on break above the daily chart

3. Alert when there is a close below on the daily chart

20 EMA (short)

1. Scan for stocks below the weekly,monthly and yearly charts, but above on the daily

2. Entry on a break below on the daily chart

3. Stop when there is a close above on the daily chart

Thank you.

]]>

But in advance mode his code makes sense where the Close < Open (5). Am I missing something?:

]]>