armybender
Active member
I use this indicator as a way to help me manage my trade entries, stop loss orders, and initial limits. Other platforms like NinjaTrader offer ATM (automated trade management) strategies that automatically place stops and limits, including trailing stops and other techniques, to help you enter and exit trades based on specific conditions.
To replicate that in ThinkOrSwim, I created a "helper" indicator that plots various price levels based on 1x and 2x risk/reward. I trade on range charts (since I believe only price movement matters, not how long it takes to get there), and I have found it to be tremendously helpful to speed up my trade entry and stop / limit setting.
Here is an image of how I setup my chart and Active Trader ladder, along with the code of the indicator itself.
Indicator Image (Range Bars)
Indicator Image (Tick Bars or Time Bars)
Indicator Code
To replicate that in ThinkOrSwim, I created a "helper" indicator that plots various price levels based on 1x and 2x risk/reward. I trade on range charts (since I believe only price movement matters, not how long it takes to get there), and I have found it to be tremendously helpful to speed up my trade entry and stop / limit setting.
Here is an image of how I setup my chart and Active Trader ladder, along with the code of the indicator itself.
Indicator Image (Range Bars)
Indicator Image (Tick Bars or Time Bars)
Indicator Code
Code:
#Plots various information to help manage trades
#DECLARATIONS
declare hide_on_daily;
declare upper;
#INPUTS
input DisplayNumBars = 15;
input Show2X = Yes;
input ShowRiskLabels = No;
input ShowRiskValues = Yes;
input ShowActualRiskLine = No;
input TicksForEntry = 1;
input ShowRangeEntryDot = Yes; #Plots a value specific to range charts
#DEFINITIONS
def EntryTicks = TicksForEntry * TickSize();
def IsLastBar = !IsNaN(close) and IsNaN(close[-1]);
def IsOtherPlotBar = !IsNaN(close) and IsNaN(close[-DisplayNumBars]);
def AddTicks =
if IsLastBar then
high[1] - low[1] + (2 * TickSize())
else if IsOtherPlotBar then
high - low + (2 * TickSize())
else
Double.NaN;
#PLOTS
plot RangeEntLong = if IsLastBar and ShowRangeEntryDot then low + GetAggregationPeriod() + EntryTicks else Double.NaN;
plot RangeEntShort = if IsLastBar and ShowRangeEntryDot then high - GetAggregationPeriod() - EntryTicks else Double.NaN;
plot LongEnt = if IsLastBar then high[1] + EntryTicks else if IsOtherPlotBar then high + EntryTicks else Double.NaN;
plot ShortEnt = if IsLastBar then low[1] - EntryTicks else if IsOtherPlotBar then low - EntryTicks else Double.NaN;
plot LongTgT = if IsLastBar then LongEnt[1] + AddTicks else if IsOtherPlotBar then LongEnt + AddTicks else Double.NaN;
plot ShortTgT = if IsLastBar then ShortEnt[1] - AddTicks else if IsOtherPlotBar then ShortEnt - AddTicks else Double.NaN;
plot LongTgT2 = if Show2X then if IsLastBar then LongEnt[1] + (2 * AddTicks) else if IsOtherPlotBar then LongEnt + (2 * AddTicks) else Double.NaN else Double.NaN;
plot ShortTgT2 = if Show2X then if IsLastBar then ShortEnt[1] - (2 * AddTicks) else if IsOtherPlotBar then ShortEnt - (2 * AddTicks) else Double.NaN else Double.NaN;
plot BarRisk = if ShowRiskValues and IsOtherPlotBar then (LongEnt - ShortEnt) / TickSize() else if ShowRiskValues and IsLastBar then ((high - low) + (2 * TicksForEntry)) / TickSize() else Double.NaN;
plot ActualRiskLong = if ShowActualRiskLine then LongTgT - AbsValue(low[-1] - low) else Double.NaN;
plot ActualRiskShort = if ShowActualRiskLine then ShortTgT + AbsValue(high[-1] - high) else Double.NaN;
#FORMATTING
RangeEntLong.SetDefaultColor(Color.CYAN);
RangeEntLong.SetPaintingStrategy(PaintingStrategy.DASHES);
RangeEntLong.HideTitle();
RangeEntLong.HideBubble();
RangeEntShort.SetDefaultColor(Color.CYAN);
RangeEntShort.SetPaintingStrategy(PaintingStrategy.DASHES);
RangeEntShort.HideTitle();
RangeEntShort.HideBubble();
LongEnt.SetDefaultColor(Color.DARK_GREEN);
LongEnt.SetPaintingStrategy(PaintingStrategy.DASHES);
LongEnt.HideTitle();
ShortEnt.SetDefaultColor(Color.RED);
ShortEnt.SetPaintingStrategy(PaintingStrategy.DASHES);
ShortEnt.HideTitle();
LongTgT.SetDefaultColor(Color.YELLOW);
LongTgT.SetPaintingStrategy(PaintingStrategy.DASHES);
LongTgT.HideTitle();
ShortTgT.SetDefaultColor(Color.YELLOW);
ShortTgT.SetPaintingStrategy(PaintingStrategy.DASHES);
ShortTgT.HideTitle();
LongTgT2.SetDefaultColor(Color.MAGENTA);
LongTgT2.SetPaintingStrategy(PaintingStrategy.DASHES);
LongTgT2.HideTitle();
ShortTgT2.SetDefaultColor(Color.MAGENTA);
ShortTgT2.SetPaintingStrategy(PaintingStrategy.DASHES);
ShortTgT2.HideTitle();
BarRisk.SetDefaultColor(Color.MAGENTA);
BarRisk.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
BarRisk.HideTitle();
ActualRiskLong.SetDefaultColor(Color.WHITE);
ActualRiskLong.SetPaintingStrategy(PaintingStrategy.DASHES);
ActualRiskLong.HideTitle();
ActualRiskShort.SetDefaultColor(Color.WHITE);
ActualRiskShort.SetPaintingStrategy(PaintingStrategy.DASHES);
ActualRiskShort.HideTitle();
Last edited: