Login Page - Create Account

Support Board


Date/Time: Thu, 23 May 2024 06:41:54 +0000



Post From: Spreadsheet system for trading stop limit flatten after triggered but not filled

[2018-02-16 23:02:06]
Sawtooth - Posts: 4003
If you are cancelling an unfilled order where there are no existing working attached orders, use cell J27.
If you are cancelling an unfilled order where there might be existing working attached orders, use cell J78.

If the StopLimit was triggered in one bar but always cancelled in a subsequent bar, you can create a persistent variable of the trigger price in a Formula Column, and find where E3 crosses below that price in another Formula Column and reference it in J27 or J78, referencing row 3 for a first-occurrence intrabar cancel, or row 4 for a close of bar cancel, like this:
P3:
=IF(K3,limitprice,P4)
Q3:
=CROSSFROMABOVE(E3:E4,P3:P4)
J78:
=AND(J4>0,Q4)

If you need to cancel an unfilled order in the same bar as it was triggered, in J27 or J78 try referencing J41 > J90 and J90 > A3 and E3 < J22.
Since this is intrabar, it can only be the first occurrence.
J78:
=AND(FRACTIME(J41)>FRACTIME(J90),FRACTIME(J90)>FRACTIME(A3),E3<J22)

These are untested examples, and you'll probably need to tweak them for your situation.

SC Support: This would be easier to do if there was a Last Entry/Exit Order Price (read-only) companion to the J90 Last Entry/Exit Order Date-Time (read-only). Would you consider adding this output to the Spreadsheet System for Trading study?
Date Time Of Last Edit: 2018-02-17 14:38:02