'3 White Soldiers - errors

Working on this script:-

This the script:-

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ //@version=5 //Three White Soldiers :D

// Each successive candlestick opens lower than the previous close and then closes // higher than the previous close.

study(title = "Three White Soldiers", overlay = true)

barcolor(close > open ? close[1] > open[1] ? close[2] > open[2] ? close > high[1] ? close[1] > high[2] ? open < close[1] ? open[1] < close[2] ? (high - close ) * 3 < close - open ? (high[1] - close[1]) * 3 < close[1] - open[1] ? (high[2] - close[2]) * 3 < close[2] - open[2] ? yellow : na : na : na : na : na : na:na : na : na : na)

alertcondition(Three White Soldiers, title='WS', message='WS')

The issues are this error code:-

  1. error message: line 11: Syntax error at input 'end of line without line continuation'. Why is this coming up? How do I fix this?

  2. How would you change this to look for 2 candles not 3 in a row?

Cheers



Solution 1:[1]

You also need to request permissions at runtime. Have a look at the links below for more information:-

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Youssif Saeed