Skip to main content

Gain (futures)

Gunbot uses Exponential Moving Averages (EMA) to determine entries. It buys when price reaches the configured EMA-based levels and sells once the configured profit target is met.

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 places a stop order at a loss. After closing a position, Gunbot seeks 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 settings.
Long levelLONG_LEVEL1Defines the percentage from the Exponential Moving Average (EMA) that allows long orders to be placed.

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 based on your trading parameters.
Short levelSHORT_LEVEL1Specifies the percentage from the Exponential Moving Average (EMA) required to enable short orders. This determines the point below which short positions may be opened.

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.
Medium EMAEMA116Specifies the number of candlesticks used to calculate the medium Exponential Moving Average (EMA).
Fast EMAEMA28Specifies the number of candlesticks used to calculate the fast Exponential Moving Average (EMA).
Mean reversionMEAN_REVERSIONfalseEnables the mean reversion variant for the selected buy and sell methods.