Support Board
Date/Time: Sat, 18 Jan 2025 08:01:57 +0000
Post From: Spreadsheet backtest/automated trading question: Exit or Cancel based on # of bars
[2018-01-10 13:42:19] |
Sawtooth - Posts: 4154 |
The way to do this with the Spreadsheet System for Trading study is to use a Formula Column to count bars since an event, like an entry signal in K3. Use a formula like this, e.g. in P3: =IF(M3,0,IF(OR(K3,P4>0),P4+1,P4)) This formula also turns it off if there is a signal in the opposite direction. |