# Buy and Sell Strategies

### Strategies available

The logic of each buy or sell strategy does not differ between pairs and dca.

Click a strategy to view the strategy details.

Strategies | NORMAL BUY | NORMAL SELL | DCA BUY | DCA SELL |
---|---|---|---|---|

SIGNAL | ||||

LOWBB | ||||

HIGHBB | ||||

GAIN | ||||

LOSS | ||||

SMAGAIN | ||||

EMAGAIN | ||||

HMAGAIN | ||||

DEMAGAIN | ||||

SMASPREAD | ||||

EMASPREAD | ||||

HMASPREAD | ||||

DEMASPREAD | ||||

SMACROSS | ||||

EMACROSS | ||||

HMACROSS | ||||

DEMACROSS | ||||

RSI | ||||

STOCH | ||||

STOCHRSI (Deprecated - Use STOCHRSID for TradingView visualization) | ||||

STOCHRSID | ||||

STOCHRSIK | ||||

STOCHRSICROSS | ||||

MACD | ||||

BBWIDTH | ||||

OBV | ||||

PDHIGH | ||||

ANDERSON | ||||

DISABLED *See explanation below |

### SIGNAL

This strategy allows you to integrate approved external signal provider's signals or your own TradingView signals. SIGNAL is true when ProfitTrailer receives a correctly formatted signal from an external source. If you have notifications turned on these will trigger when a signal buy or sell is made.

If using SIGNAL either an approved external provider signal or your own TradingView signal is required.

These Signals are created outside of the ProfitTrailer product, see this page for details on how to integrate with signals

**The Numbers**

Valid Values: no additional buy or sell values are associated with this strategy as everything needed to signal a trade is derived from the signal being received from the external source. Your other buy and sell settings criteria still need to be met.

**Examples**

`DEFAULT_A_buy_strategy = SIGNAL`

→ buy will happen when a valid signal is received and your other settings buy criteria have been met. i.e. min_buy_volume

`DEFAULT_A_sell_strategy = SIGNAL`

→ Sell will happen when a valid signal is received and your other settings sell criteria have been met. i.e. GAIN percentage profit has been achieved

**Notes:**

- If using SIGNAL either an approved external provider signal or your own TradingView signal is required. These Signals are created outside of the ProfitTrailer product, see this page for details on how to integrate with signals
- Signals are not part of your ProfitTrailer product license and require a separate paid subscription to either an approved supplier's signals service and/or the TradingView integration service. These subscriptions are available for purchase from the ProfitTrailer Shop.

### LOWBB

This buy strategy is true when current ask price goes below the LOWBB threshold you specify.

This sell strategy is true when current bid price goes above the LOWBB threshold you specify.

BB values are percentages of the BB width. Width = HIGHBB - LOWBB and a `buy_value`

/`sell_value`

of +/-10 represents 10% of this width.

For a coin to be bought/sold using LOWBB, the ask/bid price must be less than the value of the LOWBB price multiplied by (1 + `buy_value`

/`sell_value`

expressed as a percentage).

**The Numbers**

Valid Values: positive or negative decimal values

Frequent Values: from 100 to -100

100 = 100% of the BB width above LOWBB. i.e. on the HIGHBB line

50 = 50% of the BB width above LOWBB. i.e halfway between HIGHBB and LOWBB

0 = on the LOWBB line

-45.25 = 45.25% of the BB width below LOWBB

-235 = 235% of the BB width below LOWBB

The lower the value the more conservative it is for buying and more aggressive it is for selling.

**The Formula**

negative `buy/sell_value`

Buy Price < LOWBB - ((HIGHBB - LOWBB) * ABS(buy_value)/100) Sell Price <= LOWBB - ((HIGHBB - LOWBB) * ABS(buy_value)/100)

positive `buy/sell_value`

Buy Price < LOWBB + ((HIGHBB - LOWBB) * ABS(buy_value)/100) Sell Price <= LOWBB + ((HIGHBB - LOWBB) * ABS(buy_value)/100)

**The Parameters**

`BB_std`

`BB_candle_period`

`BB_Length`

**Examples**

`DEFAULT_A_buy_value = 20`

→ buy zone begins 20% (of width) above LOWBB line. Ask price must be less than this value. `DEFAULT_A_buy_value_limit`

must be less than 20 including negative numbers if used.

`DEFAULT_A_buy_value = 0`

→ buy zone begins right on top of the LOWBB line. Ask price must be less than this value. `DEFAULT_A_buy_value_limit`

must be less than 0 if used.

`DEFAULT_A_buy_value = -10`

→ buy zone begins 10% (of width) below LOWBB line. Ask price must be less than or equal to this value. `DEFAULT_A_buy_value_limit`

must be less than -10 if used.

`DEFAULT_DCA_B_sell_value = -10`

→ sell zone begins 10% (of width) below LOWBB line. Bid price price must be less than or equal to this value. `DEFAULT_A_sell_value_limit`

must be less than -10 if used.

→ Use **TradingView** to visualize **LOWBB/HIGHBB** with this indicator.

### HIGHBB

This buy/sell strategy is true when current ask/bid price goes above the HIGHBB threshold you specify.

BB values are percentages of the BB width. Width = HIGHBB - LOWBB and a `buy_value`

/`sell_value`

of +/-10 represents 10% of this width.

For a coin to be bought using HIGHBB, the ask price must be greater than the value of the HIGHBB price multiplied by (1 - `buy_value`

expressed as a percentage).

For a coin to be sold using HIGHBB, the bid price must be greater than or equal to the value of the HIGHBB price multiplied by (1 - `sell_value`

expressed as a percentage).

**The Numbers**

Valid Values: positive or negative decimal values

Frequent Values: from 100 to -100

100 = 100% of the BB width below HIGHBB. i.e. on the LOWBB line

50 = 50% of the BB width below HIGHBB. i.e halfway between HIGHBB and LOWBB

0 = on the HIGHBB line

-45.25 = 45.25% of the BB width above HIGHBB

-100 = 100% of the BB width above HIGHBB

Lower values are more conservative for buying and higher values are more conservative for selling.

**The Parameters**

`BB_std`

`BB_candle_period`

`BB_Length`

**The Formula**

negative `buy/sell_value`

Buy Price > HIGHBB + ((HIGHBB - LOWBB) * ABS(buy/sell_value)/100) Sell Price >= HIGHBB + ((HIGHBB - LOWBB) * ABS(buy/sell_value)/100)

positive `buy/sell_value`

Buy Price > HIGHBB - ((HIGHBB - LOWBB) * ABS(buy/sell_value)/100) Sell Price >= HIGHBB - ((HIGHBB - LOWBB) * ABS(buy/sell_value)/100)

**Examples**

`DEFAULT_A_buy_value = 20`

→ buy zone begins 20% (of width) below the HIGHBB line. Ask price must be greater than this value. `DEFAULT_A_buy_value_limit`

must be less than 20 (i.e a higher price)including negative numbers if used.

`DEFAULT_A_buy_value = -10`

→ buy zone begins 10% (of width) above the HIGHBB line. Ask price must be greater than this value. `DEFAULT_A_buy_value_limit`

must be less than -10 (higher price) if used.

`DEFAULT_DCA_B_sell_value = 0`

→ sell zone begins right on top of the HIGHBB line. Bid price price must be greater than or equal to this value. `DEFAULT_A_sell_value_limit`

must be less than 0 if used.

→ Use **TradingView** to visualize **LOWBB/HIGHBB** with this indicator.

### GAIN

This MANDATORY sell strategy is true when current profit is greater than or equal to `sell_value`

.

GAIN acts as the minimum profit level you are targeting and as such it is required that GAIN be used as one of the sell strategies you use. If you set a negative value coins can be sold for a loss.

The `sell_value`

is a percentage of profit that must be reached. When calculating the price required to make this amount of profit the bot also accounts for fees (on Binance the bot assumes the full fee, not the BNB discounted fee.)

The Profit % (P%) column in pairs and DCA Logs shows the fee corrected current profit using the highest bid price and also the highest bid price with enough volume if `DEFAULT_min_orderbook_profit_percentage`

is used.

**The Numbers**

Valid Values: Decimal values

0.5 = 0.5% profit after exchange maximum fees

1 = 1% profit after exchange maximum fees

2.85 = 2.85% profit after exchange maximum fees

**The Formula**

Sell Price >= (average bought price * (1 + sell_value/100) + fees

**Examples**

`DEFAULT_A_sell_value = 1`

→ sell zone begins 1% above the average bought price plus fees. Bid price must be greater than or equal to this value.

`DEFAULT_A_sell_value = -10`

→ sell zone begins 10% below the average bought price plus fees. Bid price must be greater than or equal to this value.

### LOSS

This buy strategy is true when the price of the coin has dropped by the set percentage in the last 24 hours. The percentage is the 24h change specified by your exchange.

**The Numbers**

Valid Values: positive or negative decimal values.

A positive `buy value`

is converted to negative however `buy_value_limit`

needs to be negative. For simplicity use negatives for both.

3 = 3% loss over 24 hours

-3 = 3% loss over 24 hours

-7.5 = 7.5% loss over 24 hours

**The Formula**

Buy Price < (price 24 hours ago) * (1-ABS(buy_value)/100)

**Examples**

`DEFAULT_A_buy_value = -7`

→ buy zone begins 7% below the price from 24 hours ago. Ask price must be less than this value. `DEFAULT_A_buy_value_limit`

must be less than -7 if used.

`DEFAULT_A_buy_value = 7`

→ positive numbers are converted to negative. So result is the same as above.

### SMAGAIN

This buy/sell strategy is true when the current ask/bid price is above (positive `buy/sell_value`

) or below (negative `buy/sell_value`

) the lowest of the two SMA lines specified. It does not matter if the fast or slow SMA line is lower, the bot always looks at the value of the lower line.

If a positive value is used the ask/bid price must be greater than (or equal to (for selling)) the value of the lower SMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

If a negative value is used the ask/bid price must be less than (or equal to (for selling)) the value of the lower SMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

**The Numbers**

Valid Values: positive or negative decimal values.

1 = 1% of the price above the lowest of the two SMA lines

0 = Right on top of the lowest SMA line.

-0.5 = 0.5% of the price below the lowest of the two SMA lines

**The Parameters**

`SMA_candle_period`

`SMA_fast_length`

`SMA_slow_length`

**The Formula**

Positive `buy/sell_value`

buy price > lowest SMA * (1 + ABS(buy/sell_value/100)) sell price >= lowest SMA * (1 + ABS(buy/sell_value/100))

Negative `buy/sell_value`

buy price < lowest SMA * (1 - ABS(buy/sell_value/100)) sell price <= lowest SMA * (1 - ABS(buy/sell_value/100))

**Examples**

`DEFAULT_A_sell_value = 0.8`

→ sell zone begins 0.8% (of the price) above the lowest SMA line. Bid price must be equal to or greater than this value. `DEFAULT_A_sell_value_limit`

must be greater than 0.8 if used.

`DEFAULT_A_buy_value = 0`

→ buy zone begins on the lowest SMA line. Ask price must be greater than this value. `DEFAULT_A_buy_value_limit`

must be greater than 0 if used.

`DEFAULT_DCA_B_buy_value = -1`

→ buy zone begins 1% (of the price) below the lowest SMA line. Ask price must be less than this value. `DEFAULT_DCA_B_buy_value_limit`

must be less than -1 if used.

→ Use **TradingView** to visualize **SMAGAIN** with this indicator.

### EMAGAIN

This buy/sell strategy is true when the current ask/bid price is above (positive buy/sell_value) or below (negative buy/sell_value) the lowest of the two EMA lines specified. It does not matter if the fast or slow EMA line is lower, the bot always looks at the value of the lower line.

If a positive value is used the ask/bid price must be greater than (or equal to (for selling)) the value of the lower EMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

If a negative value is used the ask/bid price must be less than (or equal to (for selling)) the value of the lower EMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

**The Numbers**

Valid Values: positive or negative decimal values.

1 = 1% of the price above the lowest of the two EMA lines

0 = Right on top of the lowest EMA line.

-0.5 = 0.5% of the price below the lowest of the two EMA lines

**The Parameters**

`EMA_candle_period`

`EMA_fast_length`

`EMA_slow_length`

**The Formula**

Positive `buy/sell_value`

buy price > lowest EMA * (1 + ABS(buy/sell_value/100)) sell price >= lowest EMA * (1 + ABS(buy/sell_value/100))

Negative `buy/sell_value`

buy price < lowest EMA * (1 - ABS(buy/sell_value/100)) sell price <= lowest EMA * (1 - ABS(buy/sell_value/100))

**Examples**

`DEFAULT_A_sell_value = 0.8`

→ sell zone begins 0.8% (of the price) above the lowest EMA line. Bid price must be equal to or greater than this value. `DEFAULT_A_sell_value_limit`

must be greater than 0.8 if used.

`DEFAULT_A_buy_value = 0`

→ buy zone begins on the lowest EMA line. Ask price must be greater than this value. `DEFAULT_A_buy_value_limit`

must be greater than 0 if used.

`DEFAULT_DCA_B_buy_value = -1`

→ buy zone begins 1% (of the price) below the lowest EMA line. Ask price must be less than this value. `DEFAULT_DCA_B_buy_value_limit`

must be less then -1 if used.

→ Use **TradingView** to visualize **EMAGAIN** with this indicator.

### HMAGAIN

This buy/sell strategy is true when the current ask/bid price is above (positive `buy/sell_value`

) or below (negative `buy/sell_value`

) the lowest of the two HMA lines specified. It does not matter if the fast or slow HMA line is lower, the bot always looks at the value of the lower line.

If a positive value is used the ask/bid price must be greater than (or equal to (for selling)) the value of the lower HMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

If a negative value is used the ask/bid price must be less than (or equal to (for selling)) the value of the lower HMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

**The Numbers**

Valid Values: positive or negative decimal values.

1 = 1% of the price above the lowest of the two HMA lines

0 = Right on top of the lowest HMA line.

-0.5 = 0.5% of the price below the lowest of the two HMA lines

**The Parameters**

`HMA_candle_period`

`HMA_fast_length`

`HMA_slow_length`

**The Formula**

Positive `buy/sell_value`

buy price > lowest HMA * (1 + ABS(buy/sell_value/100)) sell price >= lowest HMA * (1 + ABS(buy/sell_value/100))

Negative `buy/sell_value`

buy price < lowest HMA * (1 - ABS(buy/sell_value/100)) sell price <= lowest HMA * (1 - ABS(buy/sell_value/100))

**Examples**

`DEFAULT_A_sell_value = 0.8`

→ sell zone begins 0.8% (of the price) above the lowest HMA line. Bid price must be equal to or greater than this value. `DEFAULT_A_sell_value_limit`

must be greater than 0.8 if used.

`DEFAULT_A_buy_value = 0`

→ buy zone begins on the lowest HMA line. Ask price must be greater than this value. `DEFAULT_A_buy_value_limit`

must be greater than 0 if used.

`DEFAULT_DCA_B_buy_value = -1`

→ buy zone begins 1% (of the price) below the lowest HMA line. Ask price must be less than this value. `DEFAULT_DCA_B_buy_value_limit`

must be less than -1 if used.

### DEMAGAIN

This buy/sell strategy is true when the current ask/bid price is above (positive `buy/sell_value`

) or below (negative `buy/sell_value`

) the lowest of the two DEMA lines specified. It does not matter if the fast or slow DEMA line is lower, the bot always looks at the value of the lower line.

If a positive value is used the ask/bid price must be greater than (or equal to (for selling)) the value of the lower DEMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

If a negative value is used the ask/bid price must be less than (or equal to (for selling)) the value of the lower DEMA band multiplied by (1 + `buy/sell_value`

expressed as a percentage).

**The Numbers**

Valid Values: positive or negative decimal values.

1 = 1% of the price above the lowest of the two DEMA lines

0 = Right on top of the lowest DEMA line.

-0.5 = 0.5% of the price below the lowest of the two DEMA lines

**The Parameters**

`DEMA_candle_period`

`DEMA_fast_length`

`DEMA_slow_length`

**The Formula**

Positive `buy/sell_value`

buy price > lowest DEMA * (1 + ABS(buy/sell_value/100)) sell price >= lowest DEMA * (1 + ABS(buy/sell_value/100))

Negative `buy/sell_value`

buy price < lowest DEMA * (1 - ABS(buy/sell_value/100)) sell price <= lowest DEMA * (1 - ABS(buy/sell_value/100))

**Examples**

`DEFAULT_A_sell_value = 0.8`

→ sell zone begins 0.8% (of the price) above the lowest DEMA line. Bid price must be equal to or greater than this value. `DEFAULT_A_sell_value_limit`

must be greater than 0.8 if used.

`DEFAULT_A_buy_value = 0`

→ buy zone begins on the lowest DEMA line. Ask price must be greater than this value. `DEFAULT_A_buy_value_limit`

must be greater than 0 if used.

`DEFAULT_DCA_B_buy_value = -1`

→ buy zone begins 1% (of the price) below the lowest DEMA line. Ask price must be less than this value. `DEFAULT_DCA_B_buy_value_limit`

must be less than -1 if used.

### SMASPREAD

This buy/sell strategy is true when the spread between fast and slow SMA is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

With SMASPREAD the current price does not matter, only the magnitude of the spread.

**The Numbers**

Valid Values: positive or negative decimal numbers.

**The Parameters**

`SMA_candle_period`

`SMA_fast_length`

`SMA_slow_length`

**The Formula**

%SMASLOW = SMA(closeprices, SMA_slow_length) %SMAFAST = SMA(closeprices, SMA_fast_length) %Spread = ((%SMAFAST / %SMASLOW) - 1) * 100

It is this %Spread that we display

**Examples**

`DEFAULT_A_buy_value = -0.5`

→ buy strategy is true when the calculated spread is larger than -0.5%. (Fast SMA is LOWER than Slow SMA). `DEFAULT_A_buy_value_limit`

must be less than -0.5 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger. (Fast SMA is HIGHER than Slow SMA). `DEFAULT_A_sell_value_limit`

must be greater than 0.6 if used.

→ Use **TradingView** to visualize **SMASPREAD** with this indicator.

### EMASPREAD

This buy/sell strategy is true when the spread between fast and slow EMA is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

With EMASPREAD the current price does not matter, only the magnitude of the spread.

**The Numbers**

Valid Values: positive or negative decimal numbers.

**The Parameters**

`EMA_candle_period`

`EMA_fast_length`

`EMA_slow_length`

**The Formula**

%EMASLOW = EMA(closeprices, EMA_slow_length) %EMAFAST = EMA(closeprices, EMA_fast_length) %Spread = ((%EMAFAST / %EMASLOW) - 1) * 100

It is this %Spread that we display

**Examples**

`DEFAULT_A_buy_value = -0.5`

→ buy strategy is true when the calculated spread is larger than -0.5% . (Fast EMA is LOWER than Slow EMA). `DEFAULT_A_buy_value_limit`

must be less than -0.5 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger. (Fast EMA is HIGHER than Slow EMA). `DEFAULT_A_buy_value_limit`

must be greater than 0.6 if used.

→ Use **TradingView** to visualize **EMASPREAD** with this indicator.

### HMASPREAD

This buy/sell strategy is true when the spread between fast and slow HMA is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

With HMASPREAD the current price does not matter, only the magnitude of the spread.

**The Numbers**

Valid Values: positive or negative decimal numbers.

**The Parameters**

`HMA_candle_period`

`HMA_fast_length`

`HMA_slow_length`

**The Formula**

%HMASLOW = HMA(closeprices, HMA_slow_length) %HMAFAST = HMA(closeprices, HMA_fast_length) %Spread = ((%HMAFAST / %HMASLOW) - 1) * 100

It is this %Spread that we display

**Examples**

`DEFAULT_A_buy_value = -0.5`

→ buy strategy is true when the calculated spread is larger than -0.5%. (Fast HMA is LOWER than Slow HMA). `DEFAULT_A_buy_value_limit`

must be less than -0.5 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger. (Fast HMA is HIGHER than Slow HMA). `DEFAULT_A_sell_value_limit`

must be greater than 0.6 if used.

### DEMASPREAD

This buy/sell strategy is true when the spread between fast and slow DEMA is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

With DEMASPREAD the current price does not matter, only the magnitude of the spread.

**The Numbers**

Valid Values: positive or negative decimal numbers.

**The Parameters**

`DEMA_candle_period`

`DEMA_fast_length`

`DEMA_slow_length`

**The Formula**

%DEMASLOW = DEMA(closeprices, DEMA_slow_length) %DEMAFAST = DEMA(closeprices, DEMA_fast_length) %Spread = ((%DEMAFAST / %DEMASLOW) - 1) * 100

It is this %Spread that we display

**Examples**

`DEFAULT_A_buy_value = -0.5`

→ buy strategy is true when the calculated spread is larger than -0.5%. (Fast DEMA is LOWER than Slow DEMA). `DEFAULT_A_buy_value_limit`

must be less than -0.5 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger. (Fast DEMA is HIGHER than Slow DEMA). `DEFAULT_A_sell_value_limit`

must be greater than 0.6 if used.

### SMACROSS

This buy/sell strategy is true when the SMA lines have crossed and the spread is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

The direction of the cross is important. If a positive `buy/sell_value`

is used the fast SMA line must have crossed above the slow SMA line. If a negative `buy/sell_value`

is used the fast SMA line must have crossed below the slow SMA line.

The cross must take place within the number of `cross_candles`

specified also.

**The Numbers**

Valid Values: Positive or negative decimal values.

**The Parameters**

`SMA_cross_candles`

`SMA_candle_period`

`SMA_fast_length`

`SMA_slow_length`

**The Formula**

%SMASLOW = SMA(closeprices, SMA_slow_length) %SMAFAST = SMA(closeprices, SMA_fast_length) %Spread = ((%SMAFAST / %SMASLOW) - 1) * 100

It is this %Spread that we display

A cross must have occurred within the number of `SMA_cross_candles`

specified for the strategy to become true

**Examples**

`DEFAULT_A_buy_value = -0.2`

→ buy strategy is true when the calculated spread is larger than -0.2% (Fast SMA is LOWER than Slow SMA) and the Fast SMA crossed below the slow SMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be less than -0.2 if used.

`DEFAULT_A_buy_value = 0.05`

→ buy strategy is true when the calculated spread is larger than 0.05% (Fast SMA is ABOVE Slow SMA) and the Fast SMA crossed above the slow SMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be more than 0.05 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger (Fast SMA is HIGHER than Slow SMA) and the Fast SMA crossed above the slow SMA within the last 5 candles (excluding the current candle). `DEFAULT_A_sell_value_limit`

must be more than 0.6 if used.

→ Use **TradingView** to visualize **SMACROSS** with this indicator.

### EMACROSS

This buy/sell strategy is true when the EMA lines have crossed and the spread is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

The direction of the cross is important. If a positive `buy/sell_value`

is used the fast EMA line must have crossed above the slow EMA line. If a negative `buy/sell_value`

is used the fast EMA line must have crossed below the slow EMA line.

The cross must take place within the number of `cross_candles`

specified also.

**The Numbers**

Valid Values: Positive or negative decimal values.

**The Parameters**

`EMA_cross_candles`

`EMA_candle_period`

`EMA_fast_length`

`EMA_slow_length`

**The Formula**

%EMASLOW = EMA(closeprices, EMA_slow_length) %EMAFAST = EMA(closeprices, EMA_fast_length) %Spread = ((%EMAFAST / %EMASLOW) - 1) * 100

It is this %Spread that we display

A cross must have occurred within the number of `EMA_cross_candles`

specified for the strategy to become true

**Examples**

`DEFAULT_A_buy_value = -0.5`

→ buy strategy is true when the calculated spread is larger than -0.5% (Fast EMA is LOWER than Slow EMA) and the Fast EMA crossed below the slow EMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be less than -0.5 if used.

`DEFAULT_A_buy_value = 0.05`

→ buy strategy is true when the calculated spread is larger than 0.05% (Fast EMA is ABOVE Slow EMA) and the Fast EMA crossed above the slow EMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be more than 0.05 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger (Fast EMA is HIGHER than Slow EMA) and the Fast EMA crossed above the slow EMA within the last 5 candles (excluding the current candle). `DEFAULT_A_sell_value_limit`

must be more than 0.05 if used.

→ Use **TradingView** to visualize **EMACROSS** with this indicator.

### HMACROSS

This buy/sell strategy is true when the HMA lines have crossed and the spread is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

The direction of the cross is important. If a positive `buy/sell_value`

is used the fast HMA line must have crossed above the slow HMA line. If a negative `buy/sell_value`

is used the fast HMA line must have crossed below the slow HMA line.

The cross must take place within the number of `cross_candles`

specified also.

**The Numbers**

Valid Values: Positive or negative decimal values.

**The Parameters**

`HMA_cross_candles`

`HMA_candle_period`

`HMA_fast_length`

`HMA_slow_length`

**The Formula**

%HMASLOW = HMA(closeprices, HMA_slow_length) %HMAFAST = HMA(closeprices, HMA_fast_length) %Spread = ((%HMAFAST / %HMASLOW) - 1) * 100

It is this %Spread that we display

A cross must have occurred within the number of `HMA_cross_candles`

specified for the strategy to become true

**Examples**

`DEFAULT_A_buy_value = -0.2`

→ buy strategy is true when the calculated spread is larger than -0.2% (Fast HMA is LOWER than Slow HMA) and the Fast HMA crossed below the slow HMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be less than -0.2 if used.

`DEFAULT_A_buy_value = 0.05`

→ buy strategy is true when the calculated spread is larger than 0.05% (Fast HMA is ABOVE Slow HMA) and the Fast HMA crossed above the slow HMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be more than 0.05 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger (Fast HMA is HIGHER than Slow HMA) and the Fast HMA crossed above the slow HMA within the last 5 candles (excluding the current candle). `DEFAULT_A_sell_value_limit`

must be more than 0.6 if used.

### DEMACROSS

This buy/sell strategy is true when the DEMA lines have crossed and the spread is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

The direction of the cross is important. If a positive `buy/sell_value`

is used the fast DEMA line must have crossed above the slow DEMA line. If a negative `buy/sell_value`

is used the fast DEMA line must have crossed below the slow DEMA line.

The cross must take place within the number of `cross_candles`

specified also.

**The Numbers**

Valid Values: Positive or negative decimal values.

**The Parameters**

`DEMA_cross_candles`

`DEMA_candle_period`

`DEMA_fast_length`

`DEMA_slow_length`

**The Formula**

%DEMASLOW = DEMA(closeprices, DEMA_slow_length) %DEMAFAST = DEMA(closeprices, DEMA_fast_length) %Spread = ((%DEMAFAST / %DEMASLOW) - 1) * 100

It is this %Spread that we display

A cross must have occurred within the number of `DEMA_cross_candles`

specified for the strategy to become true

**Examples**

`DEFAULT_A_buy_value = -0.2`

→ buy strategy is true when the calculated spread is larger than -0.2% (Fast DEMA is LOWER than Slow DEMA) and the Fast DEMA crossed below the slow DEMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be less than -0.2 if used.

`DEFAULT_A_buy_value = 0.05`

→ buy strategy is true when the calculated spread is larger than 0.05% (Fast DEMA is ABOVE Slow DEMA) and the Fast DEMA crossed above the slow DEMA within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be more than 0.05 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger (Fast DEMA is HIGHER than Slow DEMA) and the Fast DEMA crossed above the slow DEMA within the last 5 candles (excluding the current candle). `DEFAULT_A_sell_value_limit`

must be more than 0.6 if used.

### RSI

This buy/sell strategy is true when the RSI value is less than the `buy_value`

or is greater than or equal to the `sell_value`

.

RSI as a buy strategy is true if `buy_value_limit`

< RSI < `buy_value`

.

RSI as a sell strategy is true if `sell_value_limit`

>= RSI >= `sell_value`

.

**The Numbers**

Valid Values: Integers between 0 and 100

**The Parameters**

**The Formula**

100 RSI = 100 - -------- 1 + RS RS = Average Gain / Average Loss

**Examples**

`DEFAULT_A_buy_value = 20`

→ buy zone begins when the RSI value is less than 20. `DEFAULT_A_buy_value_limit`

must be less than 20 if used.

`DEFAULT_A_sell_value = 80`

→ sell zone begins when the RSI value is greater than or equal to 80. `DEFAULT_A_sell_value_limit`

must be greater than 80 if used.

`DEFAULT_DCA_B_buy_value = 30`

→ DCA buy zone begins when the RSI value is less than 30. `DEFAULT_DCA_B_buy_value_limit`

must be less than 30 if used.

→ Use **TradingView** to visualize **RSI** with this indicator.

### STOCH

This buy/sell strategy is true when the STOCH value is less than the `buy_value`

or is greater than or equal to the `sell_value`

.

STOCH as a buy strategy is true if `buy_value`

> STOCH > `buy_value_limit`

.

STOCH as a sell strategy is true if `sell_value`

⇐ STOCH ⇐ `sell_value_limit`

.

**The Numbers**

Valid Values: STOCH ranges from 0 to 100, since it is calculated as a percentage.

**The Parameters**

`STOCH_length`

`STOCH_candle_period`

`STOCH_K`

`STOCH_D`

**The Formula**

Stochastics is measured with the %K line and the %D line.

It is the %D line that we use in PT, for it will indicate any major signals in the chart. The formula for the more important %D line looks like this:

%D=100*((%K1+%K2+%K3)/3)

Mathematically, the %K line looks like this:

%K = 100[(C – L)/(H – L)] C = the most recent closing price L = the low of the STOCH_length previous trading sessions H = the highest price traded during the same STOCH_length period.

**Examples**

`DEFAULT_A_buy_value = 20`

→ buy zone begins when the STOCH value is less than 20. `DEFAULT_A_buy_value_limit`

must be less than 20 if used.

`DEFAULT_A_sell_value = 80`

→ sell zone begins when the STOCH value is greater than or equal to 80. `DEFAULT_A_sell_value_limit`

must be greater than 80 if used.

`DEFAULT_DCA_B_buy_value = 30`

→ DCA buy zone begins when the STOCH value is less than 30. `DEFAULT_DCA_B_buy_value_limit`

must be less than 30 if used.

### STOCHRSI (CLASSIC)

#### (Deprecated - Use STOCHRSID for TradingView visualization)

This buy/sell strategy is true when the STOCHRSI value is less than the `buy_value`

or is greater than or equal to the `sell_value`

.

STOCHRSI as a buy strategy is true if `buy_value`

> STOCHRSI > `buy_value_limit`

.

STOCHRSI as a sell strategy is true if `sell_value`

⇐ STOCHRSI ⇐ `sell_value_limit`

.

**The Numbers**

Valid Values: Values between 0 and 1 are valid.

**The Parameters**

`STOCHRSI_candle_period`

`STOCHRSI_rsi_length`

`STOCHRSI_stoch_length`

**The Formula**

StochRSI = (RSI - Lowest Low RSI) / (Highest High RSI - Lowest Low RSI)

**Examples**

`DEFAULT_A_buy_value = 0.2`

→ buy zone begins when the calculated value is less than 0.2. `DEFAULT_A_buy_value_limit`

must be less than 0.2 if used.

`DEFAULT_A_sell_value = 0.8`

→ sell zone begins when the calculated value is greater than or equal to 0.8. `DEFAULT_A_sell_value_limit`

must be greater than 0.8 if used.

`DEFAULT_DCA_B_buy_value = 0.3`

→ buy zone begins when the calculated value is less than 0.3. `DEFAULT_DCA_B_buy_value_limit`

must be less than 0.3 if used.

### STOCHRSID

This buy/sell strategy is true when the STOCHRSID value is less than the `buy_value`

or is greater than or equal to the `sell_value`

.

STOCHRSID as a buy strategy is true if `buy_value`

> STOCHRSID > `buy_value_limit`

.

STOCHRSID as a sell strategy is true if `sell_value`

⇐ STOCHRSID ⇐ `sell_value_limit`

.

**The Numbers**

Valid Values: Values between 0 and 100 are valid.

**The Parameters**

`STOCHRSID_candle_period`

`STOCHRSID_rsi_length`

`STOCHRSID_stoch_length`

`STOCHRSID_K`

`STOCHRSID_D`

**The Formula**
First we calculate the RSI value

%RSI = (RSI - Lowest Low RSI) / (Highest High RSI - Lowest Low RSI)

Mathematically, the %K line looks like this:

%K = SMA(%RSI, STOCHRSID_K)

Then we we calculate the D line using the following formula

%D = SMA(%K, STOCHRSID_D) * 100

It is this %D value that we display

**Examples**

`DEFAULT_A_buy_value = 20`

→ buy zone begins when the calculated value is less than 20. `DEFAULT_A_buy_value_limit`

must be less than 20 if used.

`DEFAULT_A_sell_value = 80`

→ sell zone begins when the calculated value is greater than or equal to 80. `DEFAULT_A_sell_value_limit`

must be greater than 80 if used.

`DEFAULT_DCA_B_buy_value = 30`

→ buy zone begins when the calculated value is less than 30. `DEFAULT_DCA_B_buy_value_limit`

must be less than 30 if used.

### STOCHRSIK

This buy/sell strategy is true when the STOCHRSIK value is less than the `buy_value`

or is greater than or equal to the `sell_value`

.

STOCHRSIK as a buy strategy is true if `buy_value`

> STOCHRSIK > `buy_value_limit`

.

STOCHRSIK as a sell strategy is true if `sell_value`

⇐ STOCHRSIK ⇐ `sell_value_limit`

.

**The Numbers**

Valid Values: Values between 0 and 100 are valid.

**The Parameters**

`STOCHRSIK_candle_period`

`STOCHRSIK_rsi_length`

`STOCHRSIK_stoch_length`

`STOCHRSIK_K`

**The Formula**
**The Formula**
First we calculate the RSI value

%RSI = (RSI - Lowest Low RSI) / (Highest High RSI - Lowest Low RSI)

Mathematically, the %K line looks like this:

%K = SMA(%RSI, STOCHRSID_K) * 100

It is this %K value that we display.

**Examples**

`DEFAULT_A_buy_value = 20`

→ buy zone begins when the calculated value is less than 20. `DEFAULT_A_buy_value_limit`

must be less than 20 if used.

`DEFAULT_A_sell_value = 80`

→ sell zone begins when the calculated value is greater than or equal to 80. `DEFAULT_A_sell_value_limit`

must be greater than 80 if used.

`DEFAULT_DCA_B_buy_value = 30`

→ buy zone begins when the calculated value is less than 30. `DEFAULT_DCA_B_buy_value_limit`

must be less than 30 if used.

### STOCHRSICROSS

This buy/sell strategy is true when the K and D lines have crossed and the spread is larger (bigger spread) than (or equal to (for selling)) the `buy/sell_value`

.

The direction of the cross is important. If a positive `buy/sell_value`

is used the K line must have crossed above the D line. If a negative `buy/sell_value`

is used the K line must have crossed below the D line.

The cross must take place within the number of `cross_candles`

specified also.

**The Numbers**

Valid Values: Positive or negative decimal values.

**The Parameters**

`STOCHRSICROSS_candle_period`

`STOCHRSICROSS_rsi_length`

`STOCHRSICROSS_stoch_length`

`STOCHRSICROSS_K`

`STOCHRSICROSS_D`

`STOCHRSICROSS_cross_candles`

**The Formula**
First we calculate the RSI value

%RSI = (RSI - Lowest Low RSI) / (Highest High RSI - Lowest Low RSI)

Mathematically, the %K line looks like this:

%K = SMA(%RSI, STOCHRSID_K)

Then we we calculate the D line using the following formula

%D = SMA(%K, STOCHRSID_D) * 100

%Spread = ((%K / %D) - 1) * 100

It is this %Spread that we display

A cross must have occurred within the number of `STOCHRSICROSS_cross_candles`

specified for the strategy to become true

**Examples**

`STOCHRSICROSS_cross_candles = 5`

`DEFAULT_A_buy_value = -0.5`

→ buy strategy is true when the calculated spread is larger than -0.5% (K is LOWER than D) and the K
line crossed below the D line within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be less than -0.5 if used.

`DEFAULT_A_buy_value = 0.05`

→ buy strategy is true when the calculated spread is larger than 0.05% (K is HIGHER than D) and the K line crossed above the D line within the last 5 candles (excluding the current candle). `DEFAULT_A_buy_value_limit`

must be more than 0.05 if used.

`DEFAULT_A_sell_value = 0.6`

→ sell strategy is true when the calculated spread is 0.6% or larger (K is HIGHER than D) and the K line crossed above the D line within the last 5 candles (excluding the current candle). `DEFAULT_A_sell_value_limit`

must be more than 0.6 if used.

### MACD

This buy/sell strategy is true when the `spread/divergence/convergence`

of the MA lines is larger (bigger spread) than or equal to the `buy/sell_value`

.

If a positive `buy/sell_value`

is used the fast MA line must be above the slow MA line. If a negative `buy/sell_value`

is used the fast MA line must be below the slow MA line.

**The Numbers**

Valid Values: Positive or negative decimal values (9 decimal places)

**The Parameters**

`MACD_candle_period`

Longer candle periods tend to work better for MACD.

`MACD_fast_length`

`MACD_slow_length`

`MACD_signal`

The values of 12, 26 and 9 are the typical fast, slow, signal setting used with the MACD, however other values can be substituted depending on your trading style and goals.

**The Formula**

MACD Line: (MACD_fast_length - MACD_slow_length) Signal Line: MACD_signal (days) EMA of MACD Line MACD Histogram: MACD Line - Signal Line

**Examples**

`MACD_candle_period= 900`

`MACD_fast_length = 12`

`MACD_slow_length = 26`

`MACD_signal = 9`

`DEFAULT_A_buy_value = 0.0000002`

→ buy zone begins when the calculated value of MACD is greater than 0.000000200. `DEFAULT_A_buy_value_limit`

must be greater than 0.0000002 if used.

`DEFAULT_DCA_A_buy_value = 0.0000003`

→ buy zone begins when the calculated value of MACD is greater than 0.000000300. `DEFAULT_DCA_A_buy_value_limit`

must be greater than 0.0000003 if used.

`DEFAULT_A_sell_value = -0.0000002`

→ sell zone begins when the calculated value of MACD is -0.000000200 or less. `DEFAULT_A_sell_value_limit`

must be less than -0.0000002 if used.

`DEFAULT_DCA_A_sell_value = -0.0000003`

→ sell zone begins when the calculated value of MACD falls to -0.000000300 or less. `DEFAULT_A_sell_value_limit`

must be less than 0.0000003 if used.

### BBWIDTH

This buy/sell strategy is true when the BBWIDTH is < the `buy_value`

or >= the `sell_value`

.

**The Numbers**

Valid Values: Positive decimal values.

**The Parameters**

`BB_std`

`BB_candle_period`

`BB_length`

**The Formula**

( (Upper Band - Lower Band) / Middle Band) * 100

**Examples**

`DEFAULT_A_buy_value = 0.4`

→ buy zone begins when BBWIDTH is less than 0.4. `DEFAULT_A_buy_value_limit`

must be less than 0.4 if used.

`DEFAULT_DCA_A_buy_value = 0.5`

→ True when BBWIDTH is less than 0.5. `DEFAULT_DCA_A_buy_value_limit`

must be less than 0.5 if used.

`DEFAULT_A_sell_value = 0.7`

→ sell zone begins when BBWIDTH is greater than 0.7. `DEFAULT_A_sell_value_limit`

must be greater than 0.7 if used.

### OBV

This buy\sell strategy is true when:

If `buy_value`

>= 0:

`buy_value`

< OBV < `buy_value_limit`

If `buy_value`

< 0:

`buy_value`

> OBV > `buy_value_limit`

If `sell_value`

>= 0:

`sell_value`

>= OBV >= `sell_value_limit`

If `sell_value`

< 0:

`sell_value`

=< OBV =< `sell_value_limit`

**The Numbers**

Valid Values: Positive or negative decimal values.

**The Parameters**

`OBV_candle_period`

`OBV_length`

- Must be less than 500

`OBV_signal`

- Must be less than OBV_length

**The Formula**

If the closing price is above the prior close price then: Current OBV = Previous OBV + Current Volume If the closing price is below the prior close price then: Current OBV = Previous OBV - Current Volume If the closing prices equals the prior close price then: Current OBV = Previous OBV (no change) OBV-value = [ OBV_length - OBV_signal ] / absolute(OBV_signal)

**Examples**

`DEFAULT_A_buy_value = -0.001`

→ buy zone begins when the calculated value is less than -0.001. `DEFAULT_A_buy_value_limit`

must be less than -0.001 if used.

`DEFAULT_A_buy_value = 0.005`

→ buy zone begins when the calculated value is greater than 0.005. `DEFAULT_A_buy_value_limit`

must be greater than 0.005 if used.

→ Use **TradingView** to visualize **OBV** with this indicator.

### PDHIGH

PDHIGH is the previous day high. PDHIGH (though its name suggests a Previous Day) is just a previous **candle**, so you can use it on any supported time period.

This buy strategy is true when current bid price is above or below the previous candle high of a trading pair.

**The Numbers**

Valid Values: positive or negative decimal values.

So yesterday high for ETHBTC was 0.034432

Current bid price is about 0.0321190

So the PDHIGH value is negative (-6.71%).

**The Formula**

PDHIGH uses a spread calculation as follows:

%Spread = ((%Bid Price / %PDHIGH) - 1) * 100

It is this %Spread that we display

**The Parameters**

**Examples**
An example use of this strategy is to buy as soon as the bid price crosses the PDHIGH indicating that a possible break out has occurred. In this case the breakout is to the positive side indicating an upward trend.

DEFAULT_A_buy_strategy = PDHIGH DEFAULT_A_buy_value = 0.00000001 DEFAULT_A_buy_value_limit = 30.0

`DEFAULT_A_buy_value = 0.00000001`

→ buy zone begins 0.00000001% being positive indicates an upward trend. Bid price must be higher than this value. `DEFAULT_A_buy_value_limit`

must be higher than 0.00000001 if used.

`DEFAULT_A_buy_value = -0.00000001`

→ negative numbers indicates a downward trend. Bid price must be lower than this value. `DEFAULT_A_buy_value_limit`

must be lower than -0.00000001 if used.

### ANDERSON

Anderson-DCA was an idea by a team member (called yea Anderson) that was implemented in the early days of ProfitTrailer. The idea was that you could make DCA buys using different triggers each time to try to get out of a bad position faster instead of using a specific indicator.

These days every strategy uses the same `buy_trigger`

parameters as ANDERSON so there is no benefit (or harm) using it alongside other strategies. However if you don't wish to use any other strategy you can still choose good old ANDERSON.

This DCA only buy strategy is true when the price of a coin has dropped by the specified `buy_trigger`

percentage relative to the average price you have paid for your current holding.

**The Numbers**

Valid Values:
ANDERSON is unique in that it does not use a `buy_value`

, only the `buy_trigger`

that is common to all strategies.

**The Formula**

buy price <= Average Price * (1 - buy_trigger/100)

**Examples**

`DEFAULT_DCA_A_buy_strategy = ANDERSON`

`DEFAULT_DCA_buy_trigger = -3`

`DEFAULT_DCA_buy_trigger_1 = -2`

`DEFAULT_DCA_buy_trigger_2 = -3.5`

`DEFAULT_DCA_buy_trigger_3 = -4`

`DEFAULT_DCA_trailing_buy = 0.2`

In this scenario the DCA level specific triggers will be used for the first three DCA buys. After that, if the bot is allowed to buy more times, the DEFAULT trigger will be used for each level.

In our example the bot buys a coin for whatever price using the strategies defined in pairs.properties. Now the bot looks at the lowest ask price in the order book and watches to see if it drops below our `buy_trigger`

. Once the Ask price goes below -2 the bot looks to trail back up by the `trailing_buy`

amount. (See A Traling Story for more info on trailing)

If it successfully trails and is still below the `buy_trigger`

ProfitTrailer tries to buy. After a successful DCA buy the average price is recalculated. and the bot now looks for the ASK price to drop -3.5% from the new average price. And so the process is repeated.

For the 4th buy onwards the default value of -3 will be used indefinitely as no level specific value has been set.

### DISABLED

Disabled is used as a buy or sell strategy in place of another named strategy when coin specific strategies are used.

**Example**

`DEFAULT_A_buy_strategy = LOWBB`

`DEFAULT_B_buy_strategy = RSI`

`XXX_B_buy_strategy = DISABLED`

This has the effect of letting you use your default settings except for a specific coin, denoted by the XXX.

The result is that all coins will use the LOWBB and RSI strategies in the example, the coin that is set in place of XXX will use ONLY LOWBB, because the 'B' buy strategy has been disabled.

## Discussion