Strategy · Pine Script v5 · Own pane

Sell in May, Buy in September Strategy

by hasnocool· code credited to DynamicSignalLab

This seasonal calendar strategy automates trades based on traditional monthly cycles.

View on GitHub

GitHub stars106on the repository
Pine versionv5runs as is
Lines of code11
Settings0inputs
LicenceGPL-3.0
Last update2 years ago18 Sep 2024

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

11 lines of Pine Script v5 from -Sell in May, buy in September--Strategy.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

-Sell in May, buy in September--Strategy.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © DynamicSignalLab
//@version=5
strategy("Sell in May, buy in September Strategy", overlay=false)
longCondition = month==9
closecondition = month==5
if longCondition
    strategy.entry("long", strategy.long)
if closecondition
    strategy.close("long", when=closecondition)
Expand (15 lines)

Overview

Sell in May, Buy in September Strategy enters a long position during the month of September and closes the active position when May arrives. The strategy operates without user inputs and visualizes performance in a separate pane. It lacks built-in risk management, operating without stop loss or take profit orders and relying strictly on calendar months for exits.

Details

Published by

hasnocool on GitHub

Code credit

DynamicSignalLab, as written in the script's header

Type

Strategy, Pine Script v5

Draws

Separate pane below the chart

Markets

Stocks

Timeframes

H4 and above

Risk Notes

  • The strategy enters trades without a stop loss

Topics

analysisbtcusdtcryptocurrencydatapandaspythonsimulationtradingtradingview

Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

330 stars

HA UnivLong&Short Futures calculates Heikin Ashi candles and builds a channel using simple moving averages of Heikin Ashi highs and lows. It enters long positions when the upper channel line crosses above the lower channel line and opens short positions on the

Strategy v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of HA UnivLong&Short Futures

Q-Trend + KVO Strategy

by TradersPost
218 stars

This strategy combines the ATR-banded Q-Trend indicator with the Klinger Volume Oscillator (KVO) to execute confluence trades. It enters long when a Q-Trend buy trigger aligns with a positive KVO value and a bullish candle confirmation, taking short trades und

Strategy v6 TrendVolume
Updated 3 months ago · None stated GitHub repository of Q-Trend + KVO Strategy

MACD Crossover (tutorial)

by pineforge-4pass
193 stars

This strategy calculates the Moving Average Convergence Divergence indicator and plots the MACD line, signal line, and histogram in a separate pane. It enters long positions when the MACD line crosses above the signal line and enters short positions when it cr

Strategy v6 Oscillators & momentumMoving averages
Updated today · Apache-2.0 GitHub repository of MACD Crossover (tutorial)
114 stars

This strategy estimates price behavior using ordinary least squares regression between higher-timeframe data and a generated dataset, smoothed by a Karobein oscillator. It enters long positions when the oscillator turns upward and short positions when it turns

Strategy v4 Oscillators & momentumAI / machine learning Repaints

Bar States Example S

by be-thomas
65 stars

This Pine Script strategy demonstrates the usage of bar state variables by highlighting the chart background color. It evaluates whether the current candle is the final bar on the chart using the barstate.islast condition and applies a silver background color

Strategy v5
Updated 4 days ago · GPL-3.0 GitHub repository of Bar States Example S

Pair Trade: Apple & Google

by PythonForForex
64 stars

This pair trading strategy calculates the daily price movement ratio of Google using multi-symbol data requests and plots it in a separate pane. When Google drops by more than 5% within a day, the strategy enters a long position of 100 units on the chart symbo

Strategy v5 Mean reversion
Updated 4 years ago · None stated GitHub repository of Pair Trade: Apple & Google

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers