Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 11:00:46 +0000



[Programming Help] - Cancelling Unfilled Orders on Renko Close

View Count: 1047

[2018-06-29 13:41:14]
User640497 - Posts: 2
Hello

I have been attempting to cancel an unfilled buy order if the Renko brick during which it was submitted closes as a red brick and to cancel an unfilled sell order if the Renko brick closes green.

I've been using cell J27 with the formula:

=OR(AND(M3=0,ID2.SG1@4<ID2.SG2@4), AND(K3=0,ID2.SG1@4>ID2.SG2@4))

This formula is accepted by the cell (no syntax error) but returns a value of 1 for every brick and doesn't cancel any unfilled orders. (ID2 is the 'Visual Renko Open/Close' indicator)

I have tried just entering the 'cancel unfilled buy order' formlua

=AND(K3=0,ID2.SG1@4>ID2.SG2@4)

Which successfully cancels unfilled buy orders and their associated OCO working orders when brick 3 closes as a red Renko brick and no buy position has been entered

I've also entered just the 'cancel unfilled sell order formula'

=AND(M3=0,ID2.SG1@4<ID2.SG2@4)

Which successfully cancels unfilled sell orders and their associated OCO working orders when brick 3 closes as a green Renko brick and no sell position has been entered

However the =OR expression

=OR(AND(M3=0,ID2.SG1@4<ID2.SG2@4), AND(K3=0,ID2.SG1@4>ID2.SG2@4))

that I think should have the spreadsheet evaluate both expressions and cancel the orders if either is true, doesn't work for either expression and the spreadsheet completely ignores all unfilled orders

is there something wrong with the =OR formula? Or is there a better approach to achieving the cancellation of unfilled orders in this manner? I've checked the support page

http://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php

and related threads from the support board but haven't found any answers.

Please advise

Thanks
[2018-06-29 21:06:02]
Sawtooth - Posts: 3976
All of the example 'cancel unfilled orders' formulas at that link reference J4.

You probably just need to include a reference to J4.

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

Login

Login Page - Create Account