Jump to content
Medved Trader Forums

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);
        TriggerAlert("Brakeout");
        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 this post


Link to post
Share on other sites

Code.txtI tried using this page for hints:https://www.medvedtrader.com/trader/WebHelp/index.html?chart_trading.htm

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.

5a47176d92520_ScreenHunter_02Dec_2923_34.thumb.jpg.68c8e9adc1a3991b9d069e6278ebb751.jpg


 

 

 

Edited by L W
Added Code. Could not paste.

Share this post


Link to post
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 this post


Link to post
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)

tos scanner.JPG

Edited by mazilumbogdan

Share this post


Link to post
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);
        TriggerAlert("Breakeout");
        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.

 

Share this post


Link to post
Share on other sites

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 this post


Link to post
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 this post


Link to post
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 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

×