CANDLE EFFECT
TRADING SYSTEMS
School / Strategy Lab
Strategy Lab

Settings

Strategy Lab hands you the whole engine rather than a preset with a few dials on the front. What opens a deal, how the orders are built underneath it, how much each order commits, where the target sits, and when to walk away, all of it is yours to set.

This page explains what each of those controls does, in the same order as the panel in TradingView.

How a deal runs

A deal opens with a base order. If price moves against it, the tester adds safety orders on the way down, each one usually larger than the last. Those fills drag the average entry down toward price, and since the target is measured from the average, the target comes down with it. The deal then closes on a bounce that never has to reach the price it opened at.

The money is the same either way. One entry spends it all at the top and then waits for price to come all the way back. Averaging down spends the same amount on the way down, usually with the biggest order last, so break even sits lower and a small bounce is enough to close in profit.

ONE ENTRY AVERAGE ENTRY still down when the move ends AVERAGING DOWN TARGET AVERAGE ENTRY closed in profit on the same move

Charts on this page are examples drawn to show the idea, not real results.

The settings decide when those extra orders fire, how big they get, how many you are willing to take, and how far price has to come back before the deal closes.

Signal source

Signal ModeDefault: RSI
Where entry and exit signals come from.
RSIThe tester's own built-in RSI. Nothing else has to be on the chart for it to work. External IndicatorsSignals come from indicators you have put on the chart yourself.

RSI settings

Only when Signal Mode is RSI
RSI LengthDefault: 7  ·  min 1
How many candles the RSI looks back over. A shorter length reacts faster and fires more often, a longer one is slower and steadier.
BO ConditionDefault: Less Than
The comparison that has to be true before a base order opens.
Less ThanTrue for as long as RSI is sitting below the level. Greater ThanTrue for as long as RSI is sitting above the level. Crossing UpFires only on the candle where RSI crosses up through the level. Crossing DownFires only on the candle where RSI crosses down through it.
The first two stay true while the reading holds there. The last two fire once, on the crossing itself.
BO ValueDefault: 25  ·  0 to 100
The RSI level the condition above is measured against.
SO ConditionDefault: Less Than
The same four comparisons, applied to safety orders instead of the base order.
SO ValueDefault: 20  ·  0 to 100
The level safety orders are measured against. Keeping it separate from the base order's level lets a safety order demand a deeper reading than the one that opened the deal.

Base order signals

Only when Signal Mode is External Indicators
Long BODefault: close
Which plot from an indicator on your chart the tester watches for a long base order.
Short BODefault: close
The same, for short base orders.

Safety order signals

Only when Signal Mode is External Indicators
Long SODefault: close
Which plot the tester watches for a long safety order.
Short SODefault: close
The same, for short safety orders.
Last SO SignalDefault: off
When on, the final safety order listens to a different signal from all the ones before it. Useful when you want the last order, the one that commits the most money, to need stronger conditions than the rest.
Long Last SODefault: close
Which plot feeds that final long safety order, when the switch above is on.
Short Last SODefault: close
The same, for short.

Exit signals

Only when TP Mode is Signal Exit
Long ExitDefault: close
Which plot closes a long deal.
Short ExitDefault: close
Which plot closes a short deal.

Settings

This is the main group, and it is where the shape of the orders is decided. The rows below fall into three jobs: which direction the tester may trade, how big each order is, and how far apart they sit.

Long DealsDefault: on
Whether the tester may open long deals.
Short DealsDefault: off
Whether it may open short deals. Both can be on at once. If a long signal and a short signal land on the same candle, the long one is taken.
Size ModeDefault: USD Amount
How order sizes are written.
USD AmountEvery order is sized in money. ContractsEvery order is sized in units of the instrument. CustomYou type each order's size yourself, one by one.
BO Size (USD)Default: 100
The money put into the base order. Used when Size Mode is USD Amount.
SO Size (USD)Default: 100
The money put into the first safety order. Every later one grows from this figure by the multiplier below.
BO ContractsDefault: 1
The base order in contracts instead of money. Used when Size Mode is Contracts.
SO ContractsDefault: 1
The first safety order in contracts. Later ones grow from it the same way.
Volume MultiplierDefault: 1.5  ·  min 1.0
How much bigger each safety order is than the one before it. At 1.5 the first is the size you set, the second is one and a half times that, the third is 2.25 times, and so on. At 1.0 they are all the same size. This is the setting that decides how hard the orders pull the average entry toward price, and also how quickly a deal starts costing real money.
Custom USDDefault: empty
A comma separated list of sizes, base order first and then one for every safety order. Used when Size Mode is Custom. You need one more value than Max SOs, so with Max SOs set to 2 you would type three. Type this into the field
100,BO150,SO 1250SO 2
Max SOsDefault: 5  ·  1 to 20
How many safety orders a single deal may use. Together with the sizes above, this decides the most money one deal can ever need.
SO Step % (Fixed)Default: 2.0  ·  min 0.1
How far price has to move against the deal before the next safety order fires. Used when Step Mode is Fixed.
Step MultiplierDefault: 1.0  ·  min 0.01
Widens each step compared with the one before. At 1.0 every step is the same distance. At 1.3 with a 2% step the first sits 2% away, the next 2.6%, the next 3.4%. Higher values spread the same number of orders over a much bigger move.
Step ModeDefault: Fixed
How the distance to the next order is worked out.
FixedOne percentage for every step, adjusted by the Step Multiplier above. Custom per SOYou type each distance yourself. CE AdaptiveCandle Effect onlyThe distance comes from market conditions instead of a number you set, so the steps tighten when things are quiet and spread out when they are not. You will not find this one on other DCA bots.
Custom StepsDefault: empty
A comma separated list of step percentages, one per safety order. Used when Step Mode is Custom per SO. Here you need exactly as many values as Max SOs, so two safety orders take two. Type this into the field
2,SO 13.5SO 2
Step ReferenceDefault: Last Fill Price
What the next step is measured down from.
Last Fill PriceFrom wherever the previous order actually filled, so the orders sit an even distance apart. Average Entry PriceFrom the deal's average, which sits above the last fill, so the next order ends up closer and gets reached sooner.
FROM LAST FILL PRICE base order safety order 1 next one lands here 2% an even distance below the last fill FROM AVERAGE ENTRY PRICE base order average safety order 1 next one lands here 2% the average sits higher, so this one is nearer

The same 2% step, measured both ways.

Signal for SOsDefault: on
When on, a safety order needs both the price distance and a signal before it fires. When off, the distance alone is enough and the orders fill mechanically.
Cooldown CandlesDefault: 1  ·  min 0
How many candles to sit out after a deal closes before another may open. Without it the tester can re-enter immediately on the very conditions that just closed the last deal.

CE Adaptive

Candle Effect exclusive
Only when Step Mode is CE Adaptive

Instead of a percentage you choose, the step distance comes from what the market has actually been doing. These five controls shape that reading.

CE Adaptive LengthDefault: 14  ·  min 1
How many candles the reading behind the steps is measured over. Shorter reacts to the last few candles, longer smooths across a wider stretch.
CE Adaptive IntensityDefault: Mid
Three different readings of the same market. Mid is the middle ground and the default; Low and High sit either side of it.
CE Adaptive MultiplierDefault: 1.0  ·  min 0.01
Scales the whole adaptive step up or down. Above 1 spreads the steps wider than the reading alone would, below 1 tightens it.
CE Adaptive WideningDefault: Volatility Only
Whether each step also widens as the orders go deeper.
Volatility OnlyEvery step is whatever the reading gives, and nothing more. ProgressiveEach step also widens compared with the one before, the same idea as the Step Multiplier in Fixed mode but with its own control.
Widening MultiplierDefault: 1.0  ·  min 0.01
How much each step widens over the previous one, when Widening is set to Progressive.

Take profit

Three ways to close a deal in profit. Pick the mode first, then fill in the group that belongs to it. The other groups sit there doing nothing.

TP ModeDefault: Fixed % TP
How a deal in profit gets closed.
Fixed % TPCloses at a set percentage above the average entry. Signal ExitWaits for an exit signal instead of a price target. CE TPCandle Effect onlySets the target from market conditions rather than a fixed percentage, so it asks for more when the market is moving and settles for less when it is not. Our own mode, same as CE Adaptive above.

Take profit, Fixed

Only when TP Mode is Fixed % TP
Fixed TP %Default: 0.5  ·  min 0.01
How far above the average entry the target sits. Because it is measured from the average and the average moves every time a safety order fills, the target follows the average down as the deal deepens. That is why a deal can close in profit on a bounce far below where it opened.
TP ScaleDefault: 1.0  ·  min 0.01
Changes the target as the deal gets deeper. Above 1 it widens with every safety order filled, below 1 it tightens, and at 1 it stays put no matter how deep the deal goes.

Take profit, CE

Candle Effect exclusive
Only when TP Mode is CE TP
CE LengthDefault: 14  ·  min 1
How many candles the reading behind the target is measured over.
CE MultiplierDefault: 1.0  ·  min 0.01
Scales how far away the target sits. Higher aims further and waits longer, lower takes profit sooner.
CE IntensityDefault: Mid
Three different readings of the same market. Mid is the middle ground and the default; Low and High sit either side of it.

Take profit, Signal Exit

Only when TP Mode is Signal Exit

An exit signal on its own does not care whether the deal is up or down. These two switches let you insist that it is up before the signal is allowed to act.

Require Min Profit %Default: off
When on, an exit signal is ignored unless the deal is at least this far into profit.
Min Profit %Default: 1.0  ·  min 0.01
The profit the deal has to be showing before a signal may close it.
Require Min CE ProfitDefault: off
The same idea measured against market conditions instead of a fixed percentage, so the bar moves with the market rather than staying at one number.
Min CEDefault: 0.5  ·  min 0.01
How much of that reading the deal has to be up by before a signal may close it.

Stop loss

Stop LossDefault: off
Turns on a hard stop for the whole deal. Off by default, because a deal is built to survive the move a stop would cut it out of.
SL %Default: 5.0  ·  min 0.01
How far from the reference price below the stop sits.
SL ReferenceDefault: Base Order Price
What the stop is measured from.
Base Order PriceFrom where the deal opened, so the stop stays put no matter how many safety orders fill. Average Entry PriceFrom the moving average, so the stop travels down with it and the deal survives a deeper move before being cut.

Date filter

Date FilterDefault: off
Restricts the test to a window, so you can check a strategy against one particular stretch of history.
Start DateDefault: 1 Jan 2022
The first date a new deal may open.
End DateDefault: 1 Jan 2025
The last date a new deal may open. The window only gates new base orders, so a deal that is already running keeps filling its safety orders and closes normally even if that happens after the end date.

Webhook

WebhookDefault: off
Turns on the alert messages that carry orders out to your AstraBit bot. With it off the tester is a backtest and nothing leaves TradingView.
SecretDefault: empty
The ID of your AstraBit bot. Leave it blank while you are only backtesting.
Send TP/SL AlertsDefault: on
Whether a close by take profit or stop loss also sends a message. On by default, since without it the opening order would reach your exchange and the closing one would not.

Visuals

None of these change a single trade. They decide what you can see while you are reading the chart, and turning things off is the usual cure for a backtest that has become unreadable.

Entry MarkersDefault: off
Triangles on the candles where base and safety orders fire. Off by default because across a long backtest they bury the price action.
Exit MarkersDefault: off
A cross on the candle where a deal closes.
Deal LabelsDefault: on
The result of each closed deal, as a percentage and an amount, printed at the exit.
Avg Entry LineDefault: on
The moving average entry price of the open deal.
TP LineDefault: on
The take profit level of the open deal.
SL LineDefault: on
The stop loss level, when Stop Loss is on.
Next SO LineDefault: on
Where the next safety order will fire, which is the quickest way to see how much room the deal still has.
Info TableDefault: on
The readout in the corner of the chart. It has a page of its own, since it reports rather than configures.
Current TradeDefault: on
The half of the table describing the deal that is open right now.
Strategy StatsDefault: on
The half of the table describing every deal the test has run.
Advanced TableDefault: on
Adds extra detail to the rows above, plus a breakdown of how deep the orders actually went across the whole test.

Creating the alert in TradingView

Everything above shapes what the tester does. This last step is what carries those decisions out of TradingView and onto your exchange, through your AstraBit bot.

The tester writes the whole order message itself, so there is nothing to compose by hand. Your job is to create one alert and tell TradingView where to send it. You need a paid TradingView plan for this, since webhook alerts are not on the free tier.

1

Switch the webhook on

In the Webhook group above, turn on Webhook and paste your AstraBit bot ID into Secret. With the switch off the tester builds no message at all, and the alert you create next will arrive empty.

2

Open the alert dialog

With the chart in front of you, click the clock icon in the TradingView toolbar.

3

Set the condition to the tester

In Condition, choose Candle Effect – Strategy Lab from the list. Picking the strategy rather than the chart is what makes the alert fire on the tester's own orders.

4

Replace the message

Clear whatever TradingView has put in the Message box and type this, exactly as written:

This is the step people get wrong, and it fails quietly. The tester has already built the full order message and handed it to TradingView under that name. Anything else in this box gives you alerts that fire on time and orders that never reach your exchange.

5

Point it at your bot

Open the Notifications tab, tick Webhook URL, and paste the address AstraBit shows on the bot you want this strategy to drive.

6

Set the expiry and save

Give the alert an open-ended expiry so it keeps running, name it something you will recognise in a list of twenty, and save. From here the tester trades on its own.

Check it before you trust it

Watch the first order go all the way through before you walk away. The alert fires in TradingView, the message reaches AstraBit, the order appears on your exchange at the size you expected. Three places to look, and a problem in any one of them is silent until you check.

A wrong message field, a webhook pointed at the wrong bot, or a size you misread all look identical from the chart, which is to say they look like nothing happening.

Before you change anything

Three settings decide how much money a deal can ever ask for: the order sizes, the Volume Multiplier and Max SOs. Change any one of them and the worst case changes with it, usually by more than people expect. A 1.5 multiplier across five safety orders is not five times the base order, it is closer to eleven times.

Work that number out before you run anything live, and make sure you are happy holding it. A backtest that never filled the last order tells you nothing about the day it does.