Search code examples
pine-scriptindicator

Extraneous input '1' expecting ']'


so I was trying to make use of the look ahead conditions to refer to the close of the next candle

Line 171 : SMI_Long_Fut = (SMI_Long_1, close[1], lookahead=barmerge.lookahead_on)
Line 172 : SMI_Short_Fut = (SMI_Short_1, close[1], lookahead=barmerge.lookahead_on)

but I got an error on line 171 which said "Mismatched input ',' expecting ')' so i changed the code to this:

SMI_Long_Fut = (SMI_Long_1), close[1], lookahead=barmerge.lookahead_on)
SMI_Short_Fut = (SMI_Short_1), close[1], lookahead=barmerge.lookahead_on)

and I got this new error on line 171 which said extraneous input '1' expecting ']'. I need to know what I'm doing wrong. Thanks everyone.


Solution

  • I assume that you forgot to specify the name of the function security

    SMI_Long_Fut = security(SMI_Long_1, close[1], lookahead=barmerge.lookahead_on)
    SMI_Short_Fut = security(SMI_Short_1, close[1], lookahead=barmerge.lookahead_on)