Skip to main content

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)​

trend following futures trading bot example

Opening a long position is allowed when the ask price is equal to or above LONG_LEVEL.

Mean reversion​

mean reversion futures trading bot example

Opening a long position is allowed when the ask price is equal to or below LONG_LEVEL.

Sell method conditions​

Trend following (regular)​

trend following futures trading bot sell conditions example

Opening a short position is allowed when the bid price is equal to or below SHORT_LEVEL.

Mean reversion​

mean reversion futures trading bot sell conditions example

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​

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueAllows 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 levelLONG_LEVEL1Defines 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​

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueAllows you to enable or disable sell or short orders. When enabled, short orders can be initiated as specified by your trading parameters.
Short levelSHORT_LEVEL1Specifies 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​

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Defines 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 EMAEMA116Specifies 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 EMAEMA28Specifies 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 reversionMEAN_REVERSIONfalseEnables 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.