πΎCONDITION MANAGER STRATEGY
Code Zero Visual Trading for TradingView
Last updated
Code Zero Visual Trading for TradingView
Last updated
Association
This is a strategy backtester module that tests your ideas on history and sends trading signals for algo-trading.
CONDITION MANAGER STRATEGY is a module on TradingView that allows you to test your trading ideas without writing any code.
All you need to do is set signals for buying and selling, as well as configure desired prices for taking profit (Take-Profit) and minimizing losses (Stop-Loss). After that, the module will show how your strategy could have performed in the past, and you can immediately make adjustments or set up the sending of signals for trading.
In order to test on history your trading idea, which you have customized with the help of modules of the complex CDZV, you need to configure the parameters of the universal strategy CONDITION MANAGER STRATEGY, which will do everything for you without the need to write a single line of code.
Select the Backtesting mode of operation.
Select the period for which you want to test the strategy. Take into account the TradingView platform's limitations on the depth of historical data - the higher the timeframe, the longer the period you can test.
Parameters | Description |
---|---|
Setting up initial capital and risk in a single trade
Set the direction of trade to be tested.
Select the mode of closing the deal.
Choose an algorithm for calculating profit in an open position.
Choose a source/indicator that generates a signal to open a deal (mandatory), as well as customize additional parameters.
Select a source/indicator that generates a signal to close a deal (works only in SIGNAL and SIGNAL+TP/SL modes)
Adjust Take/Profit (T/P) (works only in CLOSING MODE: TP/SL and SIGNAL+TP/SL modes) If necessary, you can disable this trade closing mode by turning off the Enable switch.
The mode of operation of fixed price (limit order) and dynamic price (crossing of sliding, channel, etc. and closing by market) is set by the parameter βRemember the price when entering a tradeβ:
Setting Stop/Loss (S/L) (works only in CLOSING MODE: TP/SL and SIGNAL+TP/SL) If necessary, you can disable this trade closing mode by turning off the Enable switch.
The mode of operation of fixed price (limit price) and dynamic price (channel crossing, etc.) is set by the parameter βRemember value when openingβ.
If it is necessary to set the mode of automatic transfer of Stop/Loss to no loss (Breakeven), there is a corresponding section of the strategy settings for this purpose, which can be enabled using the Enable switch.
Breakeven Modes:
If necessary, enable the Pyramiding mode, which can be enabled using the Enable switch. When it is activated, the input signal will initiate re-entry into a trade even when the trade has already been opened. For example, if the deal has already been opened (1 order), the new signal will additionally increase the position by the amount of the initial order (there will be 2 orders), and the next signal will increase the position by the amount of the initial order (there will be 3 orders).
In this mode of operation, special attention should be paid to the Take/Profit and Stop/Loss values in the TP/SL and SIGNAL+TP/SL modes of operation.
If desired, you can change the strategy parameters (Properties tab), which are used by the TradingView platform for testing on history.
In addition to the reports built into the TradingView platform, the CONDITION MANAGER STRATEGY module has additional reports that can be enabled or disabled using the Enable switch.
In the upper right corner of the chart you will see an information box informing you about:
- the minimum leverage with which you should trade this strategy
- maximum drawdown per trade
- maximum losing series of trades
- the maximum Stop-Loss that was in the losing trades
In the bottom right corner of the chart, a table will appear, grouped by year and month, which informs you of the effectiveness of the strategy from month to month. There are two types of reports.
After back-testing you have an opportunity to set up and run the strategy to send trading signals via Webhook messages. To do this, you need to enable Trading mode and configure the risk management parameters so that the strategy would automatically stop when its parameters leave the back-testing limits.
customize Risk-Management
In case of triggering the risk management subsystem, the strategy will generate an alert with a specified message, which can be specified in the βAlert message, when Risk Management is triggeredβ field.In this message you can use special substitute variables that can provide additional information about the reasons for triggering the risk management subsystem.
You should familiarize yourself with the strategy parameters on the TradingView platform itself: https://www.tradingview.com/support/solutions/43000628599-strategy-properties/
Information
Below you can read an instructional video from TradingView team on how to analyze the strategy and its results, and the full description can be found here:https://www.tradingview.com/support/solutions/43000562362/.
Parameters | Description |
---|---|
Close Mode | Description |
---|---|
Algorithm | Description |
---|---|
Parameters | Description |
---|---|
Parameters | Description |
---|---|
Source | Description |
---|---|
Mode of operation | Description |
---|---|
Parameter | Description |
---|---|
Source | Description |
---|---|
Mode of operation | Description |
---|---|
Parameter | Description |
---|---|
MODE | Description |
---|---|
Parameters | Description |
---|---|
Who initiates TP/SL | Description |
---|---|
Type of report | Description |
---|---|
Parameters | Description |
---|---|
Variable | Description |
---|---|
Order size
How the order size will be calculated when entering a trade:
AMOUNT_IN_USD - specify the order size in USD
RISK_%_OF_EQUITY - what the maximum risk in a deal can be as a percentage of the capital (works only in π Stop Loss (SL) mode). Specify the % of risk.
RISK_IN_USD - what is the maximum risk in a deal in USD (works only in π Stop Loss (SL) mode). Specify the amount of risk in USD.
Use Leverage
Can the order size be larger than the capital?
If yes, we use leverage.
If not, the maximum order size is limited by the amount of capital.
SIGNAL
Closing a trade on the signal from the indicator (The fields in the CLOSE SIGNAL settings section are mandatory.)
TP/SL
Closing the trade when the TakeProfit or StopLoss price is reached. Please note that below, the fixed price modes (limit order) and dynamic price modes (channel crossing, etc.) will be described (The fields in the CLOSE SIGNAL settings section are ignored).
SIGNAL+TP/SL
Mixed closing mode of the trade. The trade is closed based on whichever market situation occurs first (the strategy receives a signal to close, or there is a price crossover).
PRICE
Profit, which is calculated as the difference between the average entry price of a trade and the current price of the asset.
OPEN PNL
Profit in an open position taking into account the trade entry volume and commission fees.
BUY SIGNAL
Source of the signal for opening a buy deal (the signal is a value equal to 1)
SELL SIGNAL
The source of signal for opening a deal for sale (signal is a value equal to 1)
Bars to wait after trade
How many bars you have to wait after closing a trade to enter a new trade.
After how many bars to close a trade
How many bars after opening a trade to forcefully close it.
CLOSE BUY
Source of the signal to close a buy trade (the signal is a value equal to 1)
CLOSE SELL
Source of the signal for closing a sell trade (the signal is a value equal to 1)
BUY
The source of the closing bid price (this is the source that communicates the closing bid price).
SELL
The source of the closing price of the sale (this is the source that communicates the closing price of the sale).
The value will be memorized when opening a trade, and T/P will be fixed (for better understanding - it is a limit order to close) (except for Pyramiding mode - see below).
Disable
The value will be dynamic and can change on each bar. For example, if the entry source is a moving line or a channel boundary, the order should be closed at the intersection with the current price.
Min T/P for entry, %
Skip entering a trade if its expected T/P is less than the specified percentage. Only works if the βRemember the price when entering a tradeβ option is enabled. For example, do not enter a trade if the profit in the trade is expected to be less than 3%.
BUY
The source of the closing bid price (this is the source that communicates the closing bid price).
SELL
The source of the closing price of the sale (this is the source that communicates the closing price of the sale).
The value will be memorized when opening a trade, and S/L will be fixed (for better understanding - it is a limit order to close) (except for Pyramiding mode - see below).
Disable
The value will be dynamic and can change on each bar. For example, if the entry source is a moving line or a channel boundary, the order should be closed at the intersection with the current price.
Max S/L for entry, %
Skip entering a trade if its expected S/L is greater than the specified percentage. Only works if the βRemember the price when entering a tradeβ option is enabled.
For example, do not enter a trade if the loss in the trade is expected to be more than 5%.
1οΈβ£ ABSOLUTE
The mode of transferring a trade to no loss is activated when a position starts generating a specified percentage profit in an open trade.
For example, if a position generates a 1% profit, then the S/L is transferred to no loss.
2οΈβ£ FROM TP
The mode of transferring a trade to no loss is activated when the profit in an open position reaches the specified percentage of the expected profit in this position.
For example, when the profit in an open position reaches 25% of the expected profit in this position, then the S/L is transferred to no loss.
1οΈβ£ Profit from entry, %
Parameter for operation mode: 1οΈβ£ ABSOLUTE.
How much profit an open position must generate to transfer the S/L level to a no loss.
2οΈβ£ Profit from full T/P, %
Parameter for operation mode: 2οΈβ£ FROM TP.
How much profit an open position must generate as a percentage of the expected profit value in this position to convert the S/L level to no loss.
Shift from entry price, %
Offset from the price without loss (price of entry into the deal) in %. For example, the trade entry price is 100, the offset is specified as 0.5%. Then the actual point without loss will be 100.50.
FIRST
If the memorization mode βRemember the price when entering a tradeβ is enabled, then T/P and S/L values are memorized when opening the first trade and all other orders in Pyramiding mode do not change these values until the whole trade is closed.
LAST
Each new trade entry changes the values of T/P and S/L.
From the initial position
The report shows how the initial capital (in percent) allocated to the strategy changed from month to month (see Figure 1 below).
Green color - capital has increased.
Yellow color - capital has decreased but is higher than the initial capital.
Red color - capital is lower than the initial capital.
Monthly balance changes
The report shows how the amount of funds on the trading account changed (in percent) compared to the previous month. Open trades are taken into account (see Figure 2 below).
Green color - balance increased.
Red color - the balance decreased.
Blue color - no changes (no deals were made).
Max losing series
The number of losing trades in a row, after which the strategy will stop opening new trades.
Max drawdown, %
The maximum possible drawdown of capital allocated to this strategy, in %, after which the strategy will stop opening new trades.
{{RISK_MANAGMENT_STOP}}
Returns value 1 - if the risk management subsystem was triggered and the strategy was stopped.
{{STOP_MAX_LOSS_TRADES}}
Returns value 1 - if the risk management subsystem was triggered and it was stopped due to exceeding the maximum possible loss series.
{{STOP_MAX_DRAWDOWN}}
Returns value 1 - if the risk management subsystem was triggered and it was stopped due to exceeding the maximum possible drawdown of the capital allocated to this strategy.
Start date
The date/time of the start of the backtesting period.
End date
The date/time of the end of the backtesting period.
Close open trades on the end date
If this option is activated, then open trades will be forcibly closed at the end of the backtesting period.
This option is most suitable for investment strategies, when it is necessary to evaluate the state of the portfolio for a specific period of time.