mazilumbogdan Posted December 26, 2017 Report Posted December 26, 2017 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) {....} Quote
mazilumbogdan Posted December 29, 2017 Author Report Posted December 29, 2017 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 Quote
L W Posted December 30, 2017 Report Posted December 30, 2017 (edited) 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. Edited December 30, 2017 by L W Added Code. Could not paste. Quote
L W Posted December 30, 2017 Report Posted December 30, 2017 (edited) Tried to paste the code for chart above, but forum will not let me. Edited December 30, 2017 by L W Quote
Mike Medved Posted December 30, 2017 Report Posted December 30, 2017 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? Quote
mazilumbogdan Posted December 30, 2017 Author Report Posted December 30, 2017 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 Quote
mazilumbogdan Posted December 30, 2017 Author Report Posted December 30, 2017 (edited) 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 December 30, 2017 by mazilumbogdan Quote
Mike Medved Posted December 30, 2017 Report Posted December 30, 2017 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. Quote
CryptoDips Posted January 14, 2018 Report Posted January 14, 2018 (edited) 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 January 14, 2018 by CryptoDips Quote
Mike Medved Posted January 15, 2018 Report Posted January 15, 2018 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. Quote
CryptoDips Posted January 15, 2018 Report Posted January 15, 2018 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. Quote
Mike Medved Posted January 17, 2018 Report Posted January 17, 2018 Right but are you sure you're using [2] correctly? [2] means you're accessing the value of 2 bars ago. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.