Login Page - Create Account

Support Board


Date/Time: Sat, 22 Feb 2025 09:08:26 +0000



Post From: Draw a line from the close 35 bars ago to the close of the current bar

[2021-01-23 04:31:26]
Sawtooth - Posts: 4174
You can do this with the Spreadsheet Study study.

Add the Spreadsheet Study study:
- Set the Chart Region to 1.
- Give it a name in the Spreadsheet Name field.
- On the Subgraphs tab, set the SG3 DrawStyle to Line, and all other DrawStyles to Ignore.
- On the spreadsheet, enter the following in the respective cells:
J1: Lookback Bars
J2: 35
K2: Last[-J2]
L2: (Last-Last[-J2])/J2
M2: Lookback Line
K3: =IF(ROW()=$J$2+3,E3,K4)
L3: =IF(ROW()>$J$2+3,0,($E$3-K3)/$J$2)
M3: =IF(ROW()>$J$2+3,0,IF(ROW()=$J$2+3,$K$3,M4+L3))

You can edit cell J2 for the number of lookback bars desired.