Whitebox Strategy Engine ยป Properties


Overview

So far we have been looking at the settings under the Inputs tab. All the configuration you see on the Inputs tab is provided by the scripts; the scripts are in complete control of what is shown there.

However, there are a few "core" settings that are outside the control of the scripts, and therefore cannot be configured via the Inputs tab. These additional "core" settings can be changed via the Properties tab.

The options found on the Properties tab of the strategy configuration window is automatically provided by TradingView. A script creator doesn't have any control over what is shown there.

Strategy Properties

For more info on the Properties tab please see https://www.tradingview.com/support/solutions/43000628599-strategy-properties/

While strictly speaking, the Properties tab and its settings are not part of the Whitebox Strategy Engine, we think it makes sense to discuss it in this section, as the Properties tab is shared by all strategies.

Settings

Let's review each of these settings one by one.

Initial capital

This is the amount of capital the strategy is going to start trading with. The currency can be set below via Base currency.

Base currency

The currency used for calculations. Results appearing in the Strategy Tester tab (profit, loss, drawdown, etc.) are expressed in this currency.

If you leave the Base currency on Default, TradingView will assume your capital is in the quote currency. For EUR/USD that will be USD. For BTC/USDT it will be USDT, etc.

If you set a custom Base currency, the Trading Widget will display the relevant values in both the quote currency and your custom currency.

For more information about how the currency conversion works on TradingView, please see the following article: https://kodify.net/tradingview/strategy-settings/strategy-currency-setting/#how-does-currency-conversion-in-tradingview-work

Order size

The size of each order the strategy will use to enter into long/short positions.

It requires a value and a calculation mode.

  • Contracts: The strategy will enter with the specified number of contracts/shares/lots.
  • Amount in currency: The strategy will enter the amount specified in the base currency.
  • Percentage of equity: Position sizes will be calculated as a percentage of the available equity when the trade opens.

On most charts, the calculation mode dropdown will display the following values (on an EUR/USD chart):

Order Size Calculation Mode

Where USD is the quote currency of the chart.

There are some charts however, where TradingView cannot recognise the quote currency, and will display NONE instead (e.g. BTC/USDC):

Order Size Calculation Mode NONE

While slightly annoying, it is really just a cosmetic issue. Whereever TradingView displays values related to how much USDC you've made or lost (i.e. under the Strategy Tester tab), the values will be shown without a currency.

Finding the options listed in the calculation mode dropdown quite limited, we decided to implement our own position sizing mechanism under the Inputs tab. For more info please see Order Size Settings.

Pyramiding

Pyramiding specifies the maximum number of successive entries allowed in the same direction.

This setting is completely ignored by our strategies as there can only ever be a single position open at a time (except when you have DCA enabled, however even in that case the strategy is not affected by the pyramiding settings).

Commission

It is the amount paid in trading fees for each trade. A value and calculation mode must be supplied. Note that commission is applied on both entries and exits, and that when a percentage is used, the calculated commission will vary with the value of the transaction:

  • Percentage of the transacted value: Imposes a commission on each order equal to the specified percentage.
  • Currency per contract: Imposes a commission on each contract.
  • Currency per order: Imposes a commission on each order.

Verify price for limit orders

Makes the conditions for entering a position using limit orders more strict. By default, this value is 0, i.e. limit orders are filled on historical data as soon as the price indicated in the order is reached. If the parameter is not zero, then limit orders can enter a position within the bar only if the market price has exceeded the level of the limit order by the specified number of ticks.

Slippage

Specifies the value in ticks to be added to the fill price of market or stop orders. It can be used to account for the spread.

Margin for Long/Short positions

Specifies the margin for each trade, i.e., the percent of the position that the trader must fund. For example, if the Margin for long positions is set to 25%, the trader has to have enough funds to cover 25% of the open trade and can potentially spend up to 400% of their equity on every trade.

If a trade has been opened and it starts losing money to the extent where the trader's funds are not enough to cover their portion of the trade, a Margin Call occurs and forcibly liquidates a part of the original position. The precise number of units that will be liquidated is 4 times the amount it takes to simply cover the loss.

For more info please see the following articles:

Recalculate

The checkboxes in this section control how often the strategy script should get executed on each bar.

Please do not change the default settings, always keep:

  • After order is filled enabled
  • On every tick enabled
  • On bar close disabled

If you change any of these settings the strategy will not function properly.

Backtesting Precision

It allows the strategy to make backtesting more accurate. This feature is also known as the Bar Magnifier.

Unfortunately the Bar Magnifier is only available for Premium TradingView subscribers.

If you have a Premium TradingView subcription, please make sure that this checkbox is always enabled.