# 1 min Brakout Scan

## Recommended Posts

Hi all.

I want to create a continuous scanner for the breakout of the previous 1min candle low

In TD Ameritrade ThinkorSwim i have created this:

#Wizard text: Current bar's
#Wizard input: price1
#Wizard text: gaps
#Wizard input: percentage
#Wizard text: % or more above the previous
#Wizard input: price2

input price1 = close;
input percentage = 2.0;
input price2 = low;
def x = 1 + percentage / 100;
def term = x * price2[1];
plot scan = price1 > term;

In Medved Trader i have tried:

public void MainCalculation()
{

if (Close > Low[1]*1.02)
{
SetColorAndShape("Brakeout", PBShape.ArrowNE, 0xFF00C50C);
SetScanResult("Brakeout");
return;
}

It does not seem to work because i need to create a variable X , where X = Low[1] * 1.02 // >2% procent of the previous 1min candle low //

The problem is that it does not let me define this variable

Therefore after it will be simple as i can do if(Close > X) {....}

##### Share on other sites

Of somebody has an idea of how to do this .. It just need a new parameter to be defined in the program language that will equal with the low of previous 1min candle + a defined percentage by user

##### Share on other sites

I can't get it to work the way I think it should work. If I use + instead of * it works a little, but I know that's not what you want.

Just trying to learn.  Sorry I couldn't be of more help.

```
```
```
```

Edited by L W
##### Share on other sites

```Tried to paste the code for chart above, but forum will not let me.
```
Edited by L W
##### Share on other sites

in c# you can add a variable either as

Double X = Low[1] * 1.02;

or

var X = Low[1] * 1.02;

Can you describe, in words, what you're trying to accomplish?

##### Share on other sites

Hi Mike

Yes, i can discribe it.

In Thinkorswim i have created a scanner that works flawless for searching the 1min brakeouts

One of the conditions is the code mentioned above which in words sounds like this:

- Scan all the stocks that have the price of current 1 min candle greater then the Low of the last 1 min candle with a procentage of X

Ex with x=2% : Last 1min candle's Low is 3 then if the current 1min candle price(last) is >3.06 it will display the stock

Ex with x=20% : Last 1min candle's Low is 3 the if the current 1min candle price(last)  is >3.6 it will be displayed as a brakeout

##### Share on other sites

This is an example that i use in ThinkOrSwim , and it works !

The only problem there is that you constantly need to hit Scan

Also in Medved we need to find a way to sort the results from the Scan upwards from the entire watchlist (it would be helpful if there are 1500 tickers in the watchlist not to scroll down to check all of the tickers and the result of the scanner but to sort the one the fit the scanner criteria upwords)

Edited by mazilumbogdan
##### Share on other sites

public void MainCalculation()
{

// this parameter will show in the scan/paintbar parameter editor and can be changed by the user

DefinePaintbarParameter("PCT", "Percentage", false, 0, 200, 1, 0.2);

// get the percent paramer

var Per = GetPaintbarParameter("PCT");

if (Close > Low[1] * (1 + Per/100))
{
SetColorAndShape("Breakeout", PBShape.ArrowNE, 0xFF00C50C);
SetScanResult("Breakeout");
return;
}
}

As for your other suggestion - you can either sort on the scan column or filter the portfolio so that only the rows that have some scan result show.

Brilliant !

Thanks !

##### Share on other sites

• 2 weeks later...

OK so basically what this code is doing is scanning for the last low on the chart and then checking to see if the current candle is X% above that???
Please explain if I am wrong, because I have been trying to do something similar for Crypto for Binance:

if (SymbolData.Volume > 100000 && Open > Close[2] && (MFI_Line[2] <= 20 || RSI_Line[2] <= 35))
I trade Dips only with Crypto.
1. Is there a way to scan for Red or Green candles??? Because (Open > Close[2]) could also be 3 red candles.

Edited by CryptoDips
##### Share on other sites

???? anyone on here now???

##### Share on other sites

Why are you using MFI_Line[2] - you want to check that a candle 2 bars ago had MFI less than 20 or current one?

What do you mean by scanning red or green candles? Open[2]>Close[2] means a candle 2 bars ago was red.

##### Share on other sites

yes most crypto drop down to MFI < 20 and then I am trying to enter on the way up, it will show a green candle. I am scalping so I only need to achieve 3 - 5% is my goal.

##### Share on other sites

Right but are you sure you're using [2] correctly? [2] means you're accessing the value of 2 bars ago.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.