TradingView
millerrh
Sep 3, 2021 4:03 AM

Qullamaggie Breakout V2 

Peabody Energy CorporationNYSE

Description

After publishing the Qullamaggie Breakout script and seeing that it had some decent results, I wanted to explore it a bit further. There were a few things I didn't like about that methodology that didn't really jive with the way I like to trade. So what I did was combined the Breakout Trend Follower strategy I had been using for entries with the Qullamaggie strategy for trailing stops once in profit. The results seem pretty good to me and an approach that fits my personality and something I can actually trade. Typically better profit than the Breakout Trend Follower by giving more room for your winners to run, while still protecting your entries by moving up the trailing stop until you are in profit, all while taking less trades, so that's great.

Everything is done with stop orders. So you set your buy stop at the recent swing high point and wait for a breakout. Once in a position you set your sell stop at the recent swing low point. The most recent swing high and low are shown on the chart for easy reference with the blue and orange horizontal lines. Once in a trade, trail your sell stop after a new swing low is registered (shown by the thicker orange stop line). Once you are in profit, leave that hard stop level there (the orange line will stay there helping you). Now, you wait for price to cross a Moving Average of your choosing (default is Daily 10 MA). Once the bar crosses that moving average, you move your stop to the low of that candle (shown by the blue stop line) and trail your stop along every crossing of the moving average until the trend changes and takes out your stop. So managing this trade is pretty easy...just wait for the stop lines to move and move your stop with them. It's a great way to trade when you can't be at your computer all the time because the stop orders take care of execution on both buy and sell side. If you use a daily timeframe for your moving averages (the default), you really only need to move stops around about once a day, so is a good part time trader's strategy in my opinion.

The best opportunities will come by scanning for stocks in the longer term timeframe of your moving averages. Wait for a consolidation on that timeframe so the anticipated breakout has some room to run. Once you've identified a good candidate, zoom in to your lower timeframe where the swing highs/lows will act as your entry and exit points, all while keeping the moving averages consistent between timeframes.

Hope you guys find it useful.

A few options available:
- Choose any timeframe for your moving averages, while using swing high/low points on intraday charts.
- Choose one of two moving averages shown for your trailing stops (default 10 and 20 MA).
- Choose to use the third moving average as a filter for keeping you out of trades that are below it (trading with the trend).
- Use the charts resolution candle or the moving average resolution candle for the moving average trailing stop.
- Only take trades where your buy level minus stop level is below a % of the Average Daily Range (ADR). This allows you to potentially have better risk/reward. I added a little table that shows the ADR of the stock/ticker as well as the range between the recent buy and sell levels (shown by the orange and blue horizontal lines) for easy reference.

Release Notes

Update to v5

Release Notes

I learned that when you have calculated colors in a script, it prevents the user from adjusting colors on even non-calculated things. Since the ADR box changes color based on certain conditions, this table is blocking this user-controlled color adjustment. So I've added it back manually via the settings. Now you can change the colors of the moving average lines as well as the stop/trailing stop lines.
Comments
RajeshV
Hi! Thank you for the wonderful script. A definite value addition to all the QullaMaggie fans out here.
I have a small request -- see if you can attend to it. Is it possible to change the Color of the 10 DMA from Purple to anything brighter? I am finding it difficult to see it on the Black Background.

Thank you once again for the wonderful script!
millerrh
@RajeshV, Typically you can change the color from the properties tab, but for some reason this is not visible in this script and I'm not sure why. I'll do some investigation and see if I can get that to appear again. I don't necessarily want to change the default though because different people have different preferences. allowing people to change it is the better option if I can figure it out.
RajeshV
@millerrh, Thank you for the reply. I am experimenting with the different background from the TV's original page settings. The issue is that the moment the 10 DMA appears the other elements on the chart start to get blurred. Anyways, I would appreciate if this gets resolved. Thank you mate!
millerrh
@RajeshV, I've updated the code to v5 and confirmed that the moving average plots are coded the exact same way as another script I have where I can adjust the colors. I've reached out to tradingview support to try to help figure this out.
RajeshV
@millerrh, This is awesome! I hope that the V5 is made available soon. If it is approved already, please do share the link.
Thank you, mate!
RajeshV
@millerrh, Updated the code but the problem of "color" seems to persist. Let us hope that the TV Team is able to figure this out.
millerrh
@RajeshV, Yeah that was my point with my message. Everything is up to date and matches other code I have that does allow color changes, so I don't know why this is. I need some support from TV.
millerrh
@RajeshV, TradingView support helped me figure out the issue. Whenever you have a "calculated color" anywhere in the script, it strips out the ability to change color for everything. In this instance, I have the ADR table that colors itself red/green based on how far away the current range is from the average daily range. This table is causing this issue. I think I can fix this by bringing the colors as inputs to the user (like I do with the S/R lines). So I'll work on that shortly and provide an update.
RajeshV
@millerrh, Thank you for the update. Rest everything is absolutely fantastic about your script barring that issue. Hope to hear from you soon! :)
millerrh
@RajeshV, Color controls are now brought out to the user via the Inputs tab.
More