Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 00:10:13 +0000



[Programming Help] - Multiple Exit Automated Trading question

View Count: 1523

[2017-05-09 22:22:45]
traderacefly - Posts: 57
Trying to build a formula for the buy/sell exit in my automated trading spreadsheet which utilizes an exit with two targets. The trade would be a 2 lot entry at the same price but the exits would be one off as each condition occurs.

I am looking at the "Multiple Exit Automated Trading Example" from: Spreadsheet Systems, Alerts and Automated Trading: Initiating Trades with Auto-Trading and Using Manual or Attached Orders Exits but do not understand how to apply my logic.

These are the separate conditions for the "Buy Exit" column. I would like to combine them to take one contract off as each condition is met:

=AND(ABS($J$8)<>0,CROSSFROMABOVE(E3:E4,AA3:AA4))
=AND(ABS($J$8)<>0,AM3=0)

Thanks in advance for any ideas.
[2017-05-10 02:58:06]
traderacefly - Posts: 57
Will test this tonight for Buy Exit Formula (Cell L3):

=OR(AND(ABS($J$8=2,AM3=0),AND(ABS($J$8=1,CROSSFROMABOVE(E3:E4,AA3:AA4)))
[2017-05-10 04:32:16]
Sawtooth - Posts: 3980
That should work for the trigger. Here's a corrected version:
=OR(AND($J$8=2,AM3=0),AND($J$8=1,CROSSFROMABOVE(E3:E4,AA3:AA4)))

But you'll also need to set the exit quantity using cells J82, J83.
[2017-05-10 04:44:57]
traderacefly - Posts: 57
Thanks Tom! will set these tonight. For J82 and J83, if I am using 2 contracts in J26 order quantity, then each one of the cells (J82/J83) would be set to "1" for each of the two exit conditions? Thanks again for your help
[2017-05-10 06:14:27]
Sawtooth - Posts: 3980
J82 turns on J83, so a 1 in J82 is the same as TRUE, and a 1 in J83 is the exit quantity.
[2017-05-11 12:57:17]
traderacefly - Posts: 57
Tom, I ended up having to leave the absolute value symbol in the formula to get it to work. Thanks for your help! Never would have thought about setting J82/J83.

=OR(AND(ABS($J$8)>1,AM3=0),AND(ABS($J$8)>0,CROSSFROMABOVE(E3:E4,AA3:AA4)))
Date Time Of Last Edit: 2017-05-11 12:57:40

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

Login

Login Page - Create Account