Here’s a breakdown of the color scheme used in the script:
1. Donchian Levels (Upper and Lower Levels)
Color: color.yellow
Purpose:
The upper and lower levels of the Donchian Channel are plotted as yellow solid lines.
These levels represent the highest high and lowest low over the lookback period.
Example:
Upper Level: 4500 (yellow)
Lower Level: 4400 (yellow)
2. Take-Profit Levels
Buy Take-Profit:
Color: color.green
Purpose:
The take-profit level for a buy position is plotted as a green dashed line.
This level is calculated as upper_level + (2 * risk).
Example: 4600 (green)
Sell Take-Profit:
Color: color.red
Purpose:
The take-profit level for a sell position is plotted as a red dashed line.
This level is calculated as lower_level - (2 * risk).
Example: 4300 (red)
3. Target Levels
Upper Targets:
Color: color.teal
Purpose:
The upper target levels are plotted as teal dashed lines.
These levels are calculated as upper_level + (i * target_distance), where i is the target number (1 to 5).
Example:
Target 1: 4700 (teal)
Target 2: 4800 (teal)
Lower Targets:
Color: color.orange
Purpose:
The lower target levels are plotted as orange dashed lines.
These levels are calculated as lower_level - (i * target_distance), where i is the target number (1 to 5).
Example:
Target 1: 4300 (orange)
Target 2: 4200 (orange)
4. Stop-Loss Levels
Buy Stop-Loss:
Color: color.red
Purpose:
The stop-loss level for a buy position is plotted as a red dashed line.
This level is calculated as upper_level - (atr * stop_loss_distance).
Example: 4450 (red)
Sell Stop-Loss:
Color: color.red
Purpose:
The stop-loss level for a sell position is plotted as a red dashed line.
This level is calculated as lower_level + (atr * stop_loss_distance).
Example: 4350 (red)
5. Entry Labels
Buy Entry:
Color: color.green
Purpose:
A green label is displayed on the chart when a buy condition is met.
The label says "BUY" and is placed at the high of the bar where the breakout occurs.
Example: A green "BUY" label appears on the chart.
Sell Entry:
Color: color.red
Purpose:
A red label is displayed on the chart when a sell condition is met.
The label says "SELL" and is placed at the low of the bar where the breakout occurs.
Example: A red "SELL" label appears on the chart.
6. Text Labels on the Right Side
Color:
The text labels on the right side of the chart use the same colors as the corresponding levels (e.g., yellow for Donchian levels, green for buy take-profit, red for sell take-profit, etc.).
Purpose:
These labels display the price values of the levels (e.g., 4500, 4600, etc.) on the right side of the chart.
They are placed at the corresponding price levels for easy reference.