Support Board
Date/Time: Sat, 05 Jul 2025 10:57:25 +0000
Post From: Using ranges in a simple Spreadsheet Formula study
[2024-11-25 04:23:23] |
pjk0225 - Posts: 42 |
In a Spreadsheet Formula study (not a formula in the spreadsheet), I want it to output 1 or -1 depending on whether or not a crossover occurred in the last 12 bars. I want the study to produce the output for at least 12 bars, starting from the first trigger. I'm checking id65.sg1 over 12 consecutive bars against the value 0.10. The code I'm using is: if(CROSSOVER(id65.sg1[-1:-12], 0.10) =1,1, if(CROSSOVER(id65.sg1[-1:-12], 0.10) =-1,-1,0)) However, this only outputs 1 or -1 for 1 bar only (the trigger bar). How can I make it output for at least 12 bars? |