GLD 5/31/2023: Month of June is Usually Bearish, but June 2023 Might Actually Lean Bullish. (Point-and-Click TradeStation® Strategy)
Original Trading Strategy
Peer Reviews, Modifications & Responses
Thanks for Sharing!
Trading Strategy Article
SUMMARY: June is usually a slightly down month for GLD, but a feature of the May 2023 monthly bar and a feature of the combined price movement of the first five monthly bars of 2023 might actually suggest that June leans bullish.
Fact #1: According to a report produced by our backtest in TradeStation® 10, June is usually a slightly down month for GLD, as can be seen by this screenshot of the Excel worksheet of the formatted report results.

Specifically, as seen in the screenshot above, if you bought GLD on the open of the first trading day of June and sold on the close of the last trading day of June every year from 2006 through 2022, you would have lost -0.53% on each trade on average, without including commissions and slippage. June has historically been the third worst month to take this trade. Making this trade on every month of every year from January 2006 through May 2023 did significantly better, producing a gain of 0.62% on each trade on average.
We created this Microsoft Excel worksheet by generating the report that Quagensia T Edition’s “Best Month to Trade (Uses Parallel Lists)” strategy generates by default.
You can run this report yourself using Quagensia T Edition and TradeStation® by following the instructions in the 2 minute 42 second Best Month to Trade (Uses Parallel Lists) portion of our video titled Using & Customizing the Built-In Strategies in Quagensia T Edition. The full article titled Best Month to Trade (Uses Parallel Lists) (T Edition) contains a link to this video and more instructions and helpful information on using this built-in strategy to create an Excel worksheet like the one shown above.
Fact #2: According to a report produced by a backtest we ran using a customized version of the aforementioned Quagensia T Edition strategy in TradeStation® 10, June was on average an up month for GLD the three times since 2006 when it was preceded by a May monthly bar that was similar to the May 2023 monthly bar that just closed, as can be seen by this screenshot of the Excel worksheet of the formatted report results.

To create the Quagensia T Edition strategy that generated this report, we made a copy of the built-in strategy named “Best Month to Trade (Uses Parallel Lists)” that generated the first report in this article and added a condition using point-and-click to only include monthly bars that occurred after a monthly bar whose percentage change from its open price to its close price was similar to the May 2023 monthly bar that just closed. Since the May 2023 bar’s value for this metric was 2.0%, we chose to make the condition include all monthly bars occurring after a monthly bar whose value for this metric was 2.0% +/- 1.0%, namely any monthly bar occurring after a monthly bar whose value for this metric was between 1.0% and 3.0%. The condition we added using point-and-click is shown below:

Fact #3: According to a report produced by a backtest we ran using a second customized version of the aforementioned Quagensia T Edition strategy in TradeStation® 10, June was also on average an up month for GLD the three times since 2006 when it was preceded by five monthly bars whose percentage change from the open of the first monthly bar (the January bar) to the close of the fifth monthly bar (the May bar) were relatively close to 6.4%, which was the value of this metric for the five bars starting from the January 2023 bar and going through the May 2023 bar that just closed, as can be seen by this screenshot of the Excel worksheet of the formatted report results.

To create the Quagensia T Edition strategy that generated this report, we made a copy of the built-in strategy named “Best Month to Trade (Uses Parallel Lists)” that generated the first report in this in article and added a condition using point-and-click to only include monthly bars occurring after five monthly bars whose percentage change from the open price of the first bar to the close price of the fifth bar was close to 6.4%.
Specifically, the since the value for the percentage change from the open price of the January 2023 bar to the close price of the May 2023 bar was 6.4%, we chose to make the condition include all monthly bars occurring after a monthly bar whose value for this metric was 6.4% +/- 3.2%, namely any monthly bar occurring after a monthly bar whose value for this metric was between 3.2% and 9.6%. The condition we added using point-and-click is shown below:

A tip that may help you create all three reports described in this article: You must set the “Maximum number of bars study will reference” for the strategies backtested in this article to a low enough value such that the first years of monthly bars are not skipped, but to a high enough value so that an error will not occur when you run the second of our custom reports described above, which needs more bars for its calculations. We used a value of 14 for this field after determining that the first monthly bar in TradeStation®’s GLD market data was the November 2004 bar so that the first bar that would be included would be the first January of the first complete year that also had enough monthly bars before it so our custom report that needs to consider five monthly bars wouldn’t cause an error. When we used 14 for this value and applied the strategy to the chart of all the monthly GLD bars through the May 2023 monthly bar that just closed, the first month included was January 2006. You can edit the “Maximum number of bars study will reference” field from the screen that appears when you click on the “Properties for All…” button from the dialog box where you add the strategy to the chart. If you do not do this, the backtest will fail with an error message.
We invite you to download the two Quagensia T Edition strategies on this page, open them in Quagensia T Edition, generate their TradeStation® EasyLanguage® strategy code and test the strategies in TradeStation® 10 where you should be able to verify our results. Furthermore, if you have a valid paid license for Quagensia T Edition you can change the Quagensia T Edition strategy’s logic without code so you can modify the filter conditions for the monthly bars to better match the market movement prior to the monthly bar that you are interested in.
This article is an example of algorithmic journalism. We invite content creators to use a Quagensia Desktop Application to create their own articles based on tested trading ideas. And we invite traders to use a Quagensia Desktop Application to test their ideas before they trade them.
This trading idea is subject to the disclaimers in our Terms of Service.
How to Get the Quagensia Strategies
The downloadable zip file linked to below contains Quagensia T Edition (for TradeStation®) files and/or auxiliary files that were created by us at Quagensia, Inc.:
Click the link above to download the zip file and unzip it. If this zip file contains point-and-click Quagensia Trading Strategy files for your edition of the Quagensia Desktop Application, put the point-and-click Quagensia Trading Strategy files into your “My Algos” folder as described in the video Downloading & Importing Third-Party Strategies into Quagensia N Edition (for NinjaTrader®) or Downloading & Importing Third-Party Strategies into Quagensia T Edition (for TradeStation®).
Customize Quagensia Strategies with Your Own Ideas
Tweaking Quagensia Trading Strategies using point-and-click with the Quagensia Desktop Application is easy for non-programmers. If you get stuck you can usually find the answer you need in our online help documentation or you can ask a question in our friendly Discord community.
If you don’t want to tweak a Quagensia Trading Strategy with point-and-click to add your own proprietary trading logic, you can still download a Quagensia Trading Strategy file, open it up in the Quagensia Desktop Application, and generate its code, then backtest and optimize the trading strategy on different instruments, different bar periods (weekly bars, daily bars, hourly bars, 15-minute bars, etc.), or different bar types (time-based bars, volume-based bars, tick-based bars, etc.), and use different start and end dates.
Some tweaks you can make to the Quagensia Trading Strategies you download include:
Modify the entry & exit logic.
- Add more conditions, remove conditions, or change them by choosing from among a very large number of components, including many exotic indicators.
- Add or modify stop losses, trailing stops, and profit targets. Make them tighter, less tight, or based on an entirely different calculation.
- Add or modify time stops. For example, exit after a certain number of bars either unconditionally or only if the post-entry price action did or did not exhibit certain characteristics.
Enhance the output of the strategy to go beyond simply placing orders.
- Draw lines, shapes, and text on the chart. For instance, you can mark times or prices where each entry or exit condition of a multi-condition entry or exit was true, even if all the necessary entry or exit conditions were not true at the same time so an entry or exit did not occur.
- Write information to NinjaTrader®’s NinjaScript® Output window or TradeStation®’s EasyLanguage® Print Log window.
- Write information to a file. You can even output a report that can be opened in Microsoft Excel or consumed by another application that reads comma-delimited, semicolon-delimited, or otherwise character-delimited tabular data files.

