Skip to content

Ichimoku margin_pt

Criptonauta edited this page Feb 21, 2019 · 1 revision

Ichimoku (margin)

This page describes how margin trading on Bitmex works with the ichimoku strategy. The triggers for trades are slightly different than in the same strategy for regular trading.

Contents:

  1. How to work with this strategy
  2. Strategy parameters
  3. Margin settings
  4. Buy settings
  5. Sell settings
  6. Balance settings
  7. Indicator settings
  8. Dollar cost avg settings
  9. Reversal trading settings
  10. TrailMe settings
  11. Misc settings
  12. Placeholders

How to work with this strategy

The expected behavior for margin trading with Gunbot is that it will open one position, either long or short, and close this position when the target is reached. When the stop is hit before profitably closing a trade, Gunbot will place a stop order at loss. After closing a position, Gunbot will again look to open a new long or short position. Gunbot will not add to existing open positions.

Please don't manually add to or reduce positions opened by Gunbot, unless you stop running Gunbot on this trading pair until you've closed this position.

For this strategy it is recommended to use an additional momentum indicator to confirm long and short entries.

Long / Buy

Before a long position is opened, one of the following conditions must occur to put Gunbot on "long alert":

  1. The current candle crosses over Kumo. This means that all of open, close, high and low must be above Kumo.
  2. Tenkan-sen crosses over Kijun-sen, above Kumo.

A long position is then opened when both of the following confirmations happens in a later cycle, they do not have to happen in the same cycle:

  1. Chikou-span crosses over the "past Kumo" (Kumo value of x periods ago, defined by DISPLACEMENT).
  2. The "future Kumo" is bullish/green (Kumo value of x periods in the future, defined by DISPLACEMENT).

Short / Sell

Before a short position is opened, one of the following conditions must occur to put Gunbot on "short alert":

  1. The current candle crosses below Kumo. This means that all of open, close, high and low must be below Kumo.
  2. Tenkan-sen crosses under Kijun-sen, below Kumo.

A short position is then opened when both of the following confirmations happens in a later cycle, they do not have to happen in the same cycle:

  1. Chikou-span crosses under the "past Kumo" (Kumo value of x periods ago, defined by DISPLACEMENT).
  2. The "future Kumo" is bearish/red (Kumo value of x periods in the future, defined by DISPLACEMENT).

Close

A long position is closed when the current candle crosses under Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be below the selected item. Alternatively, you can set a ROE target for closing a position.

A short position is closed when the current candle crosses over Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be above the selected item. Alternatively, you can set a ROE target for closing a position.

You can configure which of the three items is used for closing a position, with TENKAN_CLOSE, KIJUN_CLOSE, KUMO_CLOSE or ROE_CLOSE. If multiple of these parameters are set to true, the first of which occurs will close the position.

Stop

A long position is stopped when the current candle crosses under Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be above the selected item.

A short position is stopped when the current candle crosses over Tenkan-sen, Kijun-sen or Kumo. This means that all of open, close, high and low must be under the selected item.

You can configure which of the three items is used for stopping a position, with TENKAN_STOP, KIJUN_STOP or KUMO_STOP. If multiple of these parameters are set to true, the first of which occurs will close the position. Make sure to use different lines for closing and stopping a position.

After a stop is hit, the "alert" conditions for a long or short must happen again before another position is opened.

Strategy parameters

Following settings options are available for ichimoku and can be set in the strategy configurator of the GUI or the strategies section of the config.js file.

These settings are global and apply to all pairs running this strategy. When you want a specific parameter to be different for one or more pairs, use an override at the pair level.

Using the BUY_METHOD and SELL_METHOD parameters you can combine different methods for buying and selling. This strategy page assumes both BUY_METHOD and SELL_METHOD are set to ichimoku. Accepted values are all strategy names as listed here.

Margin settings

Margin settings control settings like leverage and the target for ROE. These parameters are relevant when using ichimoku as buy and/or sell method.

Parameter Default value Description
ROE
1 Values: numerical - represents a percentage.


This sets the target for closing a position. ROE is measured as a percentage from the opening rate of a position, leverage and fees are not taken into consideration.

LEVERAGE
0 Values: numerical – between 0 and 100


For margin trading only. Sets the leverage for opening any position. Setting 0 places the order with cross margin.

ROE_TRAILING
false Values: true or false.


Use this to enable tssl-style trailing for ROE.

ROE_LIMIT
1 Values: numerical – represent a percentage of ROE.


This sets the range for ROE trailing. Setting a range of 5% at a ROE target of 1 would set an initial range between 0.95 and 1.05. As long as ROE keeps increasing, the range moves along with ROE. As soon as ROE start decreasing, the lower range gets frozen. A close order is placed when ROE crosses the lower limit.

PRE_ORDER
false Values: true or false.


When set to true, limit orders will placed at a configurable rate beyond the best bid/ask price to get ahead of the order book.

PRE_ORDER_GAP
0 Values: numerical - represents a percentage.


Sets the gap between the best bid/ask price in the orderbook and the rate at which a limit order gets placed. Long orders are placed at ask + gap. Short orders are placed at bid - gap.

It is possible to use negative values, this will increase the chance of receiving maker fees.

Example when set to 1 and a buy signal occurs at an ask price of 100: a limit order gets placed at a rate of 101. When set to -1 and a buy signal occurs at an ask price of 100: a limit order gets placed at a rate of 99.

Buy settings

Buy settings are the primary trigger for opening long positions. These parameters control the execution of buy orders when using ichimoku as buy method.

Parameter Default value Description
BUY_ENABLED
true Values: true or false.


Set this to false to prevent Gunbot from placing buy orders. Affects all types of buy orders.

NBA
0 Values: numerical, represents a percentage


"Never Buy Above". Use this to only allow buy orders below the last sell rate. This sets minimum percentage difference between the last sell order and the next buy. The default setting of 0 disables this option.

When set to 1, Gunbot will only place a buy order when the strategy buy criteria meet and price is at least 1% below the last sell price.

BUY_LEVEL
1 Values: numerical – represent a percentage.


This sets entry point for TAKE_BUY at a percentage below the lowest EMA.

When you set this to 1, the entry point will be set 1% below the currently lowest EMA.

Sell settings

Sell settings are the primary trigger for opening short positions. These parameters control the execution of sell orders when using ichimoku as sell method.

Parameter Default value Description
SELL_ENABLED
true Values: true or false.


Set this to false to prevent Gunbot from placing sell orders. Affects all types of sell orders.

Balance settings

Go to balance settings

Indicator settings

Relevant indicators for buying with ichimoku

These settings have a direct effect on buying with ichimoku.

Parameter Default value Description
PERIOD
15 Values: numerical– represents candlestick size in minutes.


This sets the candlestick period used for trading, this affects all indicators within the strategy and the BUY_LEVEL. Only use supported values.

Setting a short period allows you to trade on shorter trends, but be aware that these will be noisier than longer periods.

TENKAN_PERIOD
9 Values: numerical, represents a number of candlestick periods.


Set this to the number of candlestick periods you want to use for calculating Tenkan-sen.

KIJUN_PERIOD
26 Values: numerical, represents a number of candlestick periods.


Set this to the number of candlestick periods you want to use for calculating Kijun-sen.

SENKOUSPAN_PERIOD
52 Values: numerical, represents a number of candlestick periods.


Set this to the number of candlestick periods you want to use for calculating Senkou span.

DISPLACEMENT
26 Values: numerical, represents a number of candlestick periods.


Set this to the number of candlestick periods you want to use for displacing Kumo and Chikou-span.

KUMO_CLOSE
false Values: true or false.


Enable this to close a position when the current candle moves completely below (long) or above (short) Kumo.

Do not enable multiple close methods.

KIJUN_CLOSE
false Values: true or false.


Enable this to close a position when the current candle moves completely below (long) or above (short) Kijun-sen.

Do not enable multiple close methods.

TENKAN_CLOSE
true Values: true or false.


Enable this to close a position when the current candle moves completely below (long) or above (short) Tenkan-sen.

Do not enable multiple close methods.

ROE_CLOSE
false Values: true or false.


Enable this to stop a position when ROE is reached.

Do not enable multiple close methods.

KUMO_STOP
true Values: true or false.


Enable this to stop a position when the current candle moves completely below (long) or above (short) Kumo.

Do not enable multiple stop methods.

KIJUN_STOP
false Values: true or false.


Enable this to stop a position when the current candle moves completely below (long) or above (short) Kijun-sen.

Do not enable multiple stop methods.

TENKAN_STOP
false Values: true or false.


Enable this to close a position when the current candle moves completely below (long) or above (short) Tenkan-sen.

Do not enable multiple stop methods.

Confirming indicators + advanced indicator settings

Go to confirming indicators

Dollar cost avg settings

DCA is not intented to be used for margin trading.

Reversal trading settings

RT is not intented to be used for margin trading.

TrailMe settings

TrailMe is not intented to be used for margin trading.

Misc settings

Go to misc settings

Placeholders

The following parameters in config.js have no function for this strategy and act as placeholder.

Parameter Description
ATRX Placeholder.
ATR_PERIOD Placeholder.
BUYLVL1 Placeholder.
BUYLVL2 Placeholder.
BUYLVL3 Placeholder.
BUYLVL Placeholder.
BUY_LEVEL Placeholder.
BUY_RANGE Placeholder.
DOUBLE_CHECK_GAIN Placeholder.
FAST_SMA Placeholder.
GAIN Placeholder.
HIGH_BB Placeholder.
ICHIMOKU_PROTECTION Placeholder.
KIJUN_BUY Placeholder.
KIJUN_SELL Placeholder.
KUMO_BUY Placeholder.
KUMO_SELL Placeholder.
KUMO_SENTIMENTS Placeholder.
LONG_LEVEL Placeholder.
LOW_BB Placeholder.
MACD_LONG Placeholder.
MACD_SHORT Placeholder.
MACD_SIGNAL Placeholder.
MEAN_REVERSION Placeholder.
PP_BUY Placeholder.
PP_SELL Placeholder.
SELLLVL1 Placeholder.
SELLLVL2 Placeholder.
SELLLVL3 Placeholder.
SELLLVL Placeholder.
SELL_RANGE Placeholder.
SHORT_LEVEL Placeholder.
SLOW_SMA Placeholder.
STOP_LIMIT Placeholder.
TAKE_BUY Placeholder.
TBUY_RANGE Placeholder.
TENKAN_BUY Placeholder.
TENKAN_SELL Placeholder.
TP_PROFIT_ONLY Placeholder.
TP_RANGE Placeholder.
TSSL_TARGET_ONLY Placeholder.
Clone this wiki locally