Writing Candle and Indicator Conditions for Long and Short Signals
Summary
The document is a user’s request for help translating indicator values and candle direction into strategy conditions. The proposed rules are to open a long when a bullish candle aligns with a red volume bar, and to open a short when a bearish candle aligns with a red volume bar. The question includes boolean indicator flags and attempts to compare them with labels for bullish and bearish candles.
The reported TradingView error arises because those candle labels are strings, while the comparison expects a boolean expression. The author also questions whether declaring a boolean candle variable with a missing value is valid. No working correction or test result is provided, so the document records a coding problem rather than a verified trading method. Its usefulness is limited to identifying type consistency and signal-combination issues when expressing indicator conditions in a strategy.
Key ideas
- The requested long condition combines a bullish candle with a red volume bar.
- The requested short condition combines a bearish candle with a red volume bar.
- The reported error indicates that a string candle label is being compared where a boolean value is expected.
- The author also asks how to initialize and define the candle-direction variable correctly.
- The document does not provide a tested solution to the condition-writing problem.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.