I've read this is often caused by Indentation errors, but for the life of me I can't find any problem. Here is the text for the problem section of code:
// Create new entry label
long_entry_label := label.new(
bar_index, low,
text="LONG ENTRY\nLeverage: " + str.tostring(leverage_long) + "x\nPrice: " + str.tostring(close, format.mintick),
color=bgcolor_with_transparency(long_entry_color),
style=label.style_label_up,
textcolor=label_text_color,
size=label_text_size,
yloc=yloc.belowbar
)
Pine Script Editor pic
I've read this is often caused by Indentation errors, but for the life of me I can't find any problem. Here is the text for the problem section of code:
// Create new entry label
long_entry_label := label.new(
bar_index, low,
text="LONG ENTRY\nLeverage: " + str.tostring(leverage_long) + "x\nPrice: " + str.tostring(close, format.mintick),
color=bgcolor_with_transparency(long_entry_color),
style=label.style_label_up,
textcolor=label_text_color,
size=label_text_size,
yloc=yloc.belowbar
)
Pine Script Editor pic
Share Improve this question edited Mar 20 at 9:42 CRYPTO FUTURE asked Mar 20 at 9:39 CRYPTO FUTURECRYPTO FUTURE 11 bronze badge1 Answer
Reset to default 0It's an indexing error
Try like this:
// Create new entry label
long_entry_label := label.new(
bar_index, low,
text="LONG ENTRY\nLeverage: " + str.tostring(leverage_long) + "x\nPrice: " + str.tostring(close, format.mintick),
color=bgcolor_with_transparency(long_entry_color),
style=label.style_label_up,
textcolor=label_text_color,
size=label_text_size,
yloc=yloc.belowbar)