Skip to main content

PingPong Spot Trading Strategy

Info

The PingPong strategy is designed for markets that are trading sideways or within a defined range. It operates by setting fixed buy and sell price points, executing trades as the market price "pings" off the lower (buy) price and "pongs" off the upper (sell) price.

PingPong is a fixed-price approach for trading pairs that stay within a range. You define specific buy and sell prices, and Gunbot executes trades when those prices are met or surpassed.

You can add confirming indicators (like RSI or MACD) for buy and/or sell. For example, buy at your specified price only if RSI is at or below 30.

If you set the fixed buy (PP_BUY) and sell (PP_SELL) prices to unattainable levels (e.g., very low for buy, very high for sell), the strategy can trade based solely on your confirming indicators and ignore the fixed price points.

How It Works

Buy Conditions:

A buy order is triggered when the market price is at or below PP_BUY (and any confirming indicators are met, if configured).

tip

Normal constraints like "buy once, sell once" don't apply to this strategy: each time buying criteria occur, Gunbot will place a buy order as high as set in your balance settings.

Sell Conditions:

A sell order is triggered when the market price is at or above PP_SELL (and any confirming indicators are met, if configured).

info

Gain protection is optional for this strategy. This can lead to sell orders below your break-even point.

When you want to allow sell orders at loss, set a negative value for GAIN.

Trading Example

PingPong strategy example showing alternating buy and sell order execution

Example of potential PingPong strategy performance. [_Details and settings](https://www.tradingview.com/chart/BTCUSD/u0VqADZY-Pingpong-Gunbot-trading-strategy/)_

If you want adaptive grid behavior instead of fixed ping/pong prices, compare with StepGrid strategy reference and StepGridScalp strategy reference.

PingPong Strategy Settings

Buy Settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueEnable or disable buy (long) orders for the strategy.
Pingpong buyPP_BUY1000Fixed price at which a buy order is placed. The default of 1000 is illustrative; set this to your desired buy price for the pair.

Sell Settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueEnable or disable sell (short) orders for the strategy.
Pingpong sellPP_SELL1000Fixed price at which a sell order is placed. The default of 1000 is illustrative; set this to your desired sell price for the pair.
Count sellCOUNT_SELL9999Disables trading for the pair after the specified number of sell orders.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Candlestick period (e.g., 15 minutes) used for any confirming indicators. Ensure the value is supported by your exchange.

Overview of Effects on Different Order Types

Config ParameterAffected Order TypesNot Affected Order Types
Buy EnabledStrategy buy, DCA buy, RT buy, RT buybackStrategy sell, Stop limit, Close, RT sell
PP BuyStrategy buyStrategy sell, Stop limit, Close, RT sell, DCA buy, RT buy, RT buyback
Sell EnabledStrategy sell, Stop limit, RT sellStrategy buy, RT buy, RT buyback, Close, DCA buy
PP SellStrategy sellStrategy buy, Stop limit, Close, RT sell, DCA buy, RT buy, RT buyback
GainStrategy sellStrategy buy, RT buy, RT buyback, RT sell, Close, DCA buy, Stop limit