Available translations

DCA Levels Long

Summary: Dollar Cost Average (DCA) levels is an indicator that provides a set of take profit, stop loss signals and potential entry points based upon DCA principles. It is to be used for spot buying, or for long entries only, shorting is not currently suported by this indicator.
DCA Levels on the Charts:
For each candle, this indicator provides potential entry points marked as safetyDown, as well as potential take profit values. This indicator is based on using the Average True Range to provide the values and makes use of DCA principles to try and lower the overall cost of entry.
The following parameters can be modified by locating and opening the Javascript Code under Data Building Procedure -> Procedure Initialization under ’DCALevelsLong’ Product Definition.
Products & Properties
The following properties are available to access:
Product Name Product Variable Properties
DCALevelsLong DCALevelsLong tp1Up...tp3Up, safety1Down...safety3Down, slLong, atr
The Percentage calculation could be used to set a take profit or stop loss limit based on the desired percentage change.
The following example would set a take profit signal if the current candle close price rose above the tp2Up setpoint:
 if(chart.at01hs.DCALevelsLong.tp2Up < chart.at01hs.candle.close){
    let tp=chart.at01hs.candle.close
 tp \\returns take profit variable
To implement DCA, this indicator can be used to set up buy orders at the desired safety levels, such as safety1Down, safety2Down and safety3Down.
As these values will change for each candle period, it is recommended to copy the value to a user defined variable, such as tradingEngine.tradingCurrent.tradingEpisode.userDefinedVariables.userDefinedVariable[0].value, at a set moment in time to prevent the value being overwritten with each new candle period:
 let tp = tradingEngine.tradingCurrent.tradingEpisode.userDefinedVariables.userDefinedVariable[0].value
if ( tradingEngine.tradingCurrent.tradingEpisode.distanceToTradingEvent.takePosition.value == 1 ) {
    tp = chart.at01hs.DCALevelsLong.tp1Up
    tradingEngine.tradingCurrent.tradingEpisode.userDefinedVariables.userDefinedVariable[0].value = tp
 tp \\returns take profit variable