Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 13:24:18 +0000



Post From: Spreadsheet backtest/automated trading question: Exit or Cancel based on # of bars

[2018-01-10 13:42:19]
Sawtooth - Posts: 3993
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.