Search code examples
pine-script

whats the solution of this error "Error at 16:53 Syntax error at input 'end of line without line continuation"?


Syntax error at input 'end of the line without line continuation'

// Check for buy condition
buyCondition = candleBody >= 0.8 * (high - low) and
               candleVolume > sma(volume, 3) and
               close > open

// Check for sell condition
sellCondition = candleBody >= 0.8 * (high - low) and
                candleVolume > sma(volume, 3) and
                close < open

After 10 o'clock, if the green candle is 80% formed, and the volume of the last formed candle breaks the last 3 volume bars, then a buy up arrow should appear on next candle opening. When a bearish reversal candle forms, the right sign symbol should appear.

if the red candle is 80% formed, and the volume of the last formed candle breaks the last 3 volume bars, then a sell down arrow should appear on next candle opening. When a bullish reversal candle forms, the right sign symbol should appear.

give a stoploss settings from the buy or sell arrows.

stoploss will place when entry we entry made eigher its buy or sell.

and show entry and stoploss label.


Solution

  • This is a line wrapping issue.

    Wrapped lines must be indented with any number of spaces, provided it’s not a multiple of four (those boundaries are used to indent local blocks)

    So change those blocks to:

    // Check for buy condition
    buyCondition = candleBody >= 0.8 * (high - low) and
                     candleVolume > sma(volume, 3) and
                     close > open
    
    // Check for sell condition
    sellCondition = candleBody >= 0.8 * (high - low) and
                     candleVolume > sma(volume, 3) and
                     close < open