Login Page - Create Account

Support Board


Date/Time: Tue, 23 Apr 2024 10:57:13 +0000



[User Discussion] - Spread sheet exit entire position????

View Count: 1084

[2014-04-04 16:42:55]
User14682 - Posts: 83
If I have multiple entries programmed at 1 lots and accumulate up to 5 total contracts how do I exit all 5 positions on one signal not just 1 contract. If you can help it would be greatly appreciated!!!!

Thanks
[2014-04-04 17:13:17]
Sawtooth - Posts: 3976
The easiest way is probably using cell J29, or you could control the quantity with Cell J26 and use signals in L3, or N3.
[2014-04-04 18:56:37]
User14682 - Posts: 83
How would I write the code?

This is what I currently have and the quantities are set to 1 and I want to exit entire position

=OR(AND(AA3<AE3,AA4>AE4),AND(AA3<AG3,AA4>AG4))
[2014-04-04 19:21:21]
Sawtooth - Posts: 3976
I'll assume that formula is for exiting a long position, so I'll create the opposite direction exit also.

Put this in J29, and remove formulas in L3 and N3:
=IF(J8>0,OR(AND(AA3<AE3,AA4>AE4),AND(AA3<AG3,AA4>AG4)),IF(J8<0,OR(AND(AA3>AE3,AA4<AE4),AND(AA3>AG3,AA4<AG4)),FALSE))

If you have Signal Only On Bar Close set to Yes, you'll need to increment the rows 1 row higher:
=IF(J8>0,OR(AND(AA4<AE4,AA5>AE5),AND(AA4<AG4,AA5>AG5)),IF(J8<0,OR(AND(AA4>AE4,AA5<AE5),AND(AA4>AG4,AA5<AG5)),FALSE))


Date Time Of Last Edit: 2014-04-04 19:24:09

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

Login

Login Page - Create Account