Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 23:37:37 +0000



[Programming Help] - Automated Exit of Trade at bar close/new bar

View Count: 1520

[2017-01-09 18:30:24]
User713927 - Posts: 2
Was wondering how to close a current trade at the bar close using the automated spreadsheet trader.
[2017-01-10 18:14:29]
User713927 - Posts: 2
I was able to work this out myself. On the spreadsheet trader I first had to change the Buy Exit (Sell) condition to "=$J$5>0" which just means the current trade position quantity is greater than zero, and the Sell Exit (Buy) condition to "=$J$5<0" which just means the current trade position quantity is less than zero. This ensures that as long as I am in a trade regardless of size or position it will exit the trade.
Secondly by changing the input value of the "Strict Signal Only On Bar Close Evaluation" option to "Yes" (see http://www.sierrachart.com/index.php?page=doc/SystemsAlerts.php#SystemInputs for further reference) I was able to achieve what I wanted of the trade continuing to run once entered but closing out the position at the start of a new candlestick.
I also had the "Reset Condition On New Bar" condition set to "Yes".

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account