thinkScript painting strategy
PaintingStrategy.HORIZONTAL
PaintingStrategy.HORIZONTAL draws a plot as long horizontal segments instead of a connected line. Use it with SetPaintingStrategy to display fixed price levels, Point of Control, or Value Area boundaries on a thinkorswim chart.
plot Level = levelPrice;
Level.SetPaintingStrategy(
PaintingStrategy.HORIZONTAL);
Level.SetDefaultColor(Color.CYAN);- Constant
- PaintingStrategy.HORIZONTAL
- Applied with
- SetPaintingStrategy function
- Draws
- Horizontal segments at plot value
Direct answer
What PaintingStrategy.HORIZONTAL does
By default, a plot draws as a connected line between bars. PaintingStrategy.HORIZONTAL changes that to long horizontal segments. Each segment sits at the plot value for its bar, producing a stepped visual when the value changes between bars.
The thinkorswim Learning Center notes that this painting strategy is used by profile studies to draw Point of Control, Value Area High, Value Area Low, Profile High, and Profile Low. You can also use it in custom studies to mark fixed price levels or session reference prices.
Complete source
Horizontal level study code
This study plots a configurable price level as horizontal segments. The label shows the level value and turns green when close is at or above it.
input levelPrice = 100;
plot Level = if IsNaN(close) then Double.NaN else levelPrice;
Level.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Level.SetDefaultColor(Color.CYAN);
Level.SetLineWeight(2);
AddLabel(yes, "Level: " + AsText(levelPrice),
if close >= levelPrice then Color.GREEN else Color.RED);Double.NaN for bars where the level should not appear. The painting strategy draws no segment when the plot value is NaN.Choosing a painting strategy
HORIZONTAL vs. default line
The default painting strategy connects plot values with a broken line. HORIZONTAL replaces that with flat segments. Pick the one that matches the data: continuous series use lines, fixed or step-wise values use horizontal segments.
| Dimension | PaintingStrategy.HORIZONTAL | Default line |
|---|---|---|
| Visual shape | Long horizontal segments at a fixed value | Connected points forming a broken line |
| Best for | Fixed price levels, POC, Value Area High and Low | Continuous data series like moving averages |
| When value is NaN | No segment is drawn for that bar | The line breaks at the gap |
| Profile studies | Used by TPOProfile, VolumeProfile, MonkeyBars | Not used by profile studies |
Platform steps
Add the study to thinkorswim
- 1
Open the thinkorswim desktop Charts tab, then choose Studies and Edit Studies.
- 2
Click Create, remove the default plot, and paste the complete source from this page.
- 3
Let the thinkScript Editor parse the source. Review any messages before saving the study.
- 4
Add the study to a chart and adjust the levelPrice input to match the price level you want to mark.
Primary sources
Official thinkScript references used here
- PaintingStrategy.HORIZONTALOfficial constant reference for the horizontal painting strategy.
- SetPaintingStrategyFunction that applies a painting strategy to a plot.
- PaintingStrategy constantsFull list of available painting strategy constants.
- Formatting Output: Part ITutorial chapter on SetPaintingStrategy and visual output.
Frequently asked questions
Build custom painting strategies with AI
Describe the level, condition, and visual style you need. The Pineify thinkorswim AI Coding Agent generates a complete thinkScript file with the correct PaintingStrategy constant. Review the source, then test it in the thinkScript Editor.
This page is for educational and informational purposes. It does not provide investment advice, predict future prices, or guarantee trading results.