SIGNALS_INVALID
What happened
compute() returned something Forge cannot use as signals. The message says what, and points at the line where compute is defined.
Common causes
compute()did not returnfg.Signals(...).- An array in
fg.Signalsdoes not have one value per bar. This is checked for the entries and exits, forplots, forrecordand for each filter. long_entryandshort_entryare both true on the same bar.- A region in
plotsends after the last bar of the data.
What to do
Return fg.Signals(...) from compute(), with every array as long as the data, and one side at most on each bar.
Example
text
strategy.py, line 9, in compute: compute() must return fg.Signals(...), got tuple. [SIGNALS_INVALID]
strategy.py, line 9, in compute: long_entry has 499 values, but the data has 500 bars. Every array in fg.Signals has one value per bar. [SIGNALS_INVALID]
strategy.py, line 9, in compute: long_entry and short_entry are both true on 3 bars, first at bar 41. Choose one side per bar. [SIGNALS_INVALID]The wording of the message depends on your file, and the code does not.