User Inputs:
Allows customization of parameters like SMA lengths, colors, and line thickness for SMA 20, SMA 200, and VWAP.
Enables setting target points for three profit levels.
Calculations:
Calculates SMA 20, SMA 200, and VWAP based on the close price.
Determines the minimum and maximum points for targets to ensure user inputs are within a specific range.
Signal Logic:
buySignal and sellSignal are initialized as false and reset daily.
Defines stop-loss levels based on the lowest (for long trades) or highest (for short trades) value among VWAP, SMA 20, and SMA 200.
Buy Signal:
A buy signal occurs if a green candle (close > open) is above all three indicators (SMA 20, SMA 200, and VWAP).
Sets the entry price, stop loss, and three target levels based on input values.
Creates labels and lines for the entry, stop loss, and each target on the chart.
Sell Signal:
A sell signal occurs if a red candle (close < open) is below all three indicators.
Similar to buy signals, it sets entry, stop loss, and target levels for short trades.
Plotting:
Plots the SMA 20, SMA 200, and VWAP on the chart using user-defined colors and thickness.
This code provides clear buy/sell points and visually marks entry, stop-loss, and target levels, which is useful for trend-following strategies based on moving averages and VWAP.