Forwarding strategy buy/sell signals

Ekliptor

Administrator
Staff member
As mentioned one of the unique advantages of WolfBot is to forward strategy buy/sell events to easily configure a "zoom in" on the candlestick chart with 0 coding skills required.
For example: Trendline strategy says BUY on 12h candles -> forward signal to MACD strategy on 1h candles to look for a buy momentum -> forward signal to RSI strategy on 10min candles to look for RSI oversold -> forward & execute the BUY trade

Here is how this is configured: Every strategy can set have a configuration option named tradeStrategy. Example from the TradingViewSignal strategy:
Code:
            "strategies": {
                "TradingViewSignal": {
                    ...
                    "tradeDirection": "both",
                    "buyWords": "buy",
                    "sellWords": "sell",
                    "forceMaker": false,
                    "pair": "USD_BTC",
                    "candleSize": 1,
                    "tradeStrategy": "RSIScalpOrderer",
                    "enableLog": true
                },
                "RSIScalpOrderer": {
                    "low": 34,
                    "high": 70,
                    "expiry": 20,
                    "candleSize": 3,
                    "pair": "USD_BTC",
                    "enableLog": true
                }
        }
This example means that WolfBot will wait for a buy/sell signal from your TradingView.com account alerts and then forward the buy/sell order to RSIScalpOrderer instead if executing it right away. This strategy is an RSI running on 3min candles waiting for RSI to bounce back from its "low" value before executing a buy order (respectively bounce back from its "high" value before executing a sell order. See the strategy description in WolfBot's configuration page for more details, including some advanced settings as executing a trade immediately on very low/high RSI values).

In the above example, if you want the TradingViewSignal strategy to execute a trade immediately its tradeStrategy must be empty:
Code:
"tradeStrategy": "",
(a missing property value is also treated as empty)
Accordingly, if you want the RSIScalpOrderer strategy to forward the order to another strategy, instead of executing it directly, you must add the "tradeStrategy" property to it and include a 3rd strategy in your bot configuration.

Every strategy can use a tradeStrategy. So buy/sell orders can be forwarded as many times as you like to "zoom in" and combine different candle sizes before executing a trade! There are 0 coding skills required.


Note to developers:
There is also a similar property called orderStrategy. This is a programmable version of tradeStrategy, where the strategy issuing the order still stays in control of the limit order rate, execution time and more order parameters. Example from the TakeProfitStochRSI strategy:
Code:
{
  "data": [
    {
      "exchanges": ["Bitfinex"],
      "marginTrading": true,
      "tradeTotalBtc": 200.0,
      "warmUpMin": 0,
      "strategies": {
        "TakeProfitStochRSI": {
          "percentage": 50,
          "low": 11,
          "high": 87,
          "interval": 25,
          "optInFastK_Period": 5,
          "optInFastD_Period": 3,
          "optInFastD_MAType": 0,
          "closeRateFactor": 0.9992,
          "time": 300,
          "keepTrendOpen": true,
          "alwaysIncreaseStop": false,
          "ensureProfit": true,
          "minOpenTicks": 12,
          "candleSize": 60,
          "orderStrategy": "TriggerOrder",
          "pair": "USD_BTC",
          "enableLog": true
        },
        "TriggerOrder": {
          "candleSize": 1,
          "pair": "USD_BTC",
          "enableLog": true
        }
      }
    }
  ]
}
This example will close 50% of a profitable long position on StochRSI high (respectively 50% of a profitable short position on StochRSI low).

The orderStrategy option can only be used in strategies that support it. It will (almost) always just have the same TriggerOrder strategy as value because the additional logic controlling the strategy is placed inside the calling strategy (TakeProfitStochRSI in the example above).
You can find the full source of this example on Github.
 
Last edited: