Ichimoku (futures)
With the Ichimoku indicator, you can configure Gunbot to execute trades when a full candle crosses either the Kumo, Tenkan-Sen, or Kijun-Sen lines. It's possible to customize which line is used for buy and/or sell orders.
The Ichimoku indicator, also known as the Ichimoku Kinko Hyo, is a popular trading tool that provides multiple pieces of information on a single chart. This technical analysis tool was developed by Japanese journalist Goichi Hosoda in the 1930s and is designed to offer a comprehensive view of potential price action.
The Ichimoku indicator consists of five lines, each providing different data points, including support and resistance levels, trend direction, and momentum strength. The five lines are as follows: Tenkan-Sen (conversion line), Kijun-Sen (base line), Chikou Span (lagging line), Senkou Span A (leading span A), and Senkou Span B (leading span B). Overall, the Ichimoku indicator aims to help traders identify trends, momentum, and potential areas for entry and exit points.
How to work with it​
Gunbot will open one position, either long or short, and close this position when the target is reached. When the stop is hit before profitably closing a trade, Gunbot will place a stop order at loss. After closing a position, Gunbot will again look to open a new long or short position. Gunbot will not add to existing open positions.
For this strategy it is recommended to use an additional momentum indicator to confirm long and short entries.
Buy method conditions​
Before a long position is opened, one of the following conditions must occur to put Gunbot on "long alert":
- The current candle crosses over Kumo. This means that all of open, close, high and low must be above Kumo.
- Tenkan-sen crosses over Kijun-sen, above Kumo.
A long position is then opened when both of the following confirmations happens in a later cycle, they do not have to happen in the same cycle:
- Chikou-span crosses over the "past Kumo" (Kumo value of x periods ago, defined by
DISPLACEMENT
). - The "future Kumo" is bullish/green (Kumo value of x periods in the future, defined by
DISPLACEMENT
).
Sell method conditions​
Before a short position is opened, one of the following conditions must occur to put Gunbot on "short alert":
- The current candle crosses below Kumo. This means that all of open, close, high and low must be below Kumo.
- Tenkan-sen crosses under Kijun-sen, below Kumo.
A short position is then opened when both of the following confirmations happens in a later cycle, they do not have to happen in the same cycle:
- Chikou-span crosses under the "past Kumo" (Kumo value of x periods ago, defined by
DISPLACEMENT
). - The "future Kumo" is bearish/red (Kumo value of x periods in the future, defined by
DISPLACEMENT
).
Conditions to close​
A long position is closed when the current candle crosses under Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be below the selected item. Alternatively, you can set a ROE target for closing a position.
A short position is closed when the current candle crosses over Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be above the selected item. Alternatively, you can set a ROE target for closing a position.
You can configure which of the three items is used for closing a position, with TENKAN_CLOSE
, KIJUN_CLOSE
, KUMO_CLOSE
or ROE_CLOSE
. If multiple of these parameters are set to true, the first of which occurs will close the position.
Conditions to stop​
A long position is stopped when the current candle crosses under Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be above the selected item.
A short position is stopped when the current candle crosses over Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be over the selected item.
You can configure which of the three items is used for stopping a position, with TENKAN_STOP
, KIJUN_STOP
or KUMO_STOP
. If multiple of these parameters are set to true, the first of which occurs will close the position. Make sure to use different lines for closing and stopping a position.
After a stop is hit, the "alert" conditions for a long or short must happen again before another position is opened.
Additionally, a position is closed at loss when negative ROE
reaches the STOP_LIMIT
target.
Strategy settings for Ichimoku (futures)​
Long settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Buy enabled | BUY_ENABLED | true | When enabled, this setting allows the strategy to place buy or long orders. |
Short settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Sell enabled | SELL_ENABLED | true | This setting enables the strategy to place sell or short orders. |
Close position​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
ROE | ROE | 1 | The ROE (Return On Equity) setting defines your target for closing a position based on the percentage profit or loss on your invested margin. For example, with a 1x leverage, a 1% increase in price above your entry level equates to 1% ROE. With 100x leverage, the same 1% price increase would result in a 100% ROE. This calculation includes the effects of leverage but excludes fees. This parameter helps manage risk and determine the point at which profits or losses are realized. |
ROE trailing | ROE_TRAILING | false | Enabling ROE trailing allows for dynamic adjustment of the stop-loss level as the market moves, locking in profits while potentially extending gains as the price moves favorably. |
ROE limit | ROE_LIMIT | 1 | This sets the range for ROE trailing, establishing boundaries within which the position remains open as the market fluctuates. For instance, setting a ROE_LIMIT of 5 with a ROE target of 10 establishes an initial trailing stop at 5% ROE, adjusting as the market moves to potentially lock in profits. |
ROE scalper | ROE_SCALPER | false | This feature modifies the style of ROE trailing by setting the initial trailing stop ROE_LIMIT percentage points below the ROE target. Note that ROE trailing must be enabled for this feature to function. |
ROE close | ROE_CLOSE | false | Enables the use of a specified ROE value as a direct trigger to close positions, simplifying the exit strategy based on predefined profit or loss targets. |
Kumo close | KUMO_CLOSE | false | Positions are closed when the price crosses the Kumo, which is part of the Ichimoku Kinko Hyo trading indicator, often indicating a potential change in market trend. |
Tenkan close | TENKAN_CLOSE | true | Enables closing positions based on a cross of the Tenkan-sen line, often used as a signal for shifts in market momentum and price trends. |
Kijun close | KIJUN_CLOSE | false | This setting closes positions upon the crossing of the Kijun-sen line, which is a key component of the Ichimoku Kinko Hyo indicator, reflecting medium-term price momentum and potential trend reversals. |
Indicators​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | The period setting specifies the duration of candlesticks in minutes used for indicator calculations. It's important to choose a value supported by your exchange to ensure accurate technical analysis. |
Tenkan period | TENKAN_PERIOD | 9 | This parameter determines the number of candlesticks used to calculate the Tenkan-sen, which is a key indicator within the Ichimoku Kinko Hyo system for identifying short-term price momentum. |
Kijun period | KIJUN_PERIOD | 26 | The Kijun period sets the number of candlesticks for calculating the Kijun-sen line, offering insight into medium-term price momentum and potential support or resistance levels. |
Senkouspan period | SENKOUSPAN_PERIOD | 52 | Sets the timeframe for calculating the Senkou span of the Ichimoku Kinko Hyo indicator, which helps visualize longer-term trends and potential future support or resistance areas. |
Displacement | DISPLACEMENT | 26 | This setting determines how many candlesticks to displace the Chikou-span and Kumo forward, helping to provide a clearer view of future price movements and trend continuations. |
Ichimoku protection | ICHIMOKU_PROTECTION | true | When enabled, this feature prevents the closing of positions if the current candle intersects the Kumo in the opposite direction of the open position, enhancing risk management by avoiding exits during potential trend reversals. |