Gain (futures)
Gunbot uses the Exponential Moving Average (EMA) method to determine when to buy and. Specifically, it buys when the price dips below the lowest EMA and sells once a set percentage of profit is achieved.
EMA is a technical analysis indicator that calculates the average price of an asset over a specified time period, with more weight given to recent prices. This makes it more responsive to changes in the price trend compared to a Simple Moving Average (SMA). Traders often use EMAs to identify potential buy or sell signals, as crossovers between different EMAs can be indicative of market trends. Additionally, EMAs can help smooth out short-term fluctuations in price data, making it easier to spot long-term trends.
How to work with it​
This page explains how futures trading operates with the gain
method. The triggers for trades differ slightly from those used in spot trading.
Gunbot opens a single position, either long or short, and closes it when the target is met. If the stop is triggered before closing the trade at a profit, Gunbot will place a stop order at a loss. After closing a position, Gunbot will seek to open a new long or short position.
Buy method conditions​
Trend following (regular)​
Opening a long position is allowed when the ask price is equal to or above LONG_LEVEL
.
Mean reversion​
Opening a long position is allowed when the ask price is equal to or below LONG_LEVEL
.
Sell method conditions​
Trend following (regular)​
Opening a short position is allowed when the bid price is equal to or below SHORT_LEVEL
.
Mean reversion​
Opening a short position is allowed when the bid price is equal to or below SHORT_LEVEL
.
Conditions to close​
Position is closed when the desired ROE
(return on equity) is reached. This is a percentage from the entry point, taking leverage into consideration.
Conditions to stop​
A position is closed at loss when negative ROE
reaches the STOP_LIMIT
target.
Strategy settings for Gain (futures)​
Long settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Buy enabled | BUY_ENABLED | true | Allows you to enable or disable buy or long orders. If set to true, the strategy can initiate buy orders based on your strategy settings. |
Long level | LONG_LEVEL | 1 | Defines the percentage from the Exponential Moving Average (EMA) that allows long orders to be placed. This setting helps in deciding the threshold above which long positions are initiated. |
Short settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Sell enabled | SELL_ENABLED | true | Allows you to enable or disable sell or short orders. When enabled, short orders can be initiated as specified by your trading parameters. |
Short level | SHORT_LEVEL | 1 | Specifies the percentage from the Exponential Moving Average (EMA) required to enable short orders. This setting determines the point below which short positions may be opened, depending on sell method dependencies. |
Indicators​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | Defines the time frame in minutes for each candlestick used in calculating indicators. The value should align with those supported by your exchange to ensure accurate analysis and effective trading. |
Medium EMA | EMA1 | 16 | Specifies the number of candlesticks used to calculate the medium Exponential Moving Average (EMA). This EMA helps in analyzing longer-term price trends to inform trading decisions. |
Fast EMA | EMA2 | 8 | Specifies the number of candlesticks used to calculate the fast Exponential Moving Average (EMA). This EMA is crucial for detecting short-term price movements and potential trading opportunities. |
Mean reversion | MEAN_REVERSION | false | Enables the mean reversion variant for the selected buy and sell methods, allowing for a strategy that capitalizes on the return of a price to its average value over time. |