Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 16:30:13 +0000



[Programming Help] - Cancel unfilled orders

View Count: 598

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

I am attempting to automate a strategy using spreadsheet trading. The strategy uses a Renko chart with the Visual Renko Open and Close indicator (ID2) and works as follows:

Following two consecutive green Renko bricks (I call them bricks 1 and 2) a buy order with an OCO bracket is submitted at a specified price. Following two consecutive red Renko bricks, a sell order with OCO bracket is submitted at a specified price.

These orders will be filled, if and when the currently forming brick (3) meets certain criteria. Upon the close of brick 3, if the criteria has not been met and therefore no buy or sell position has been entered into, I would like to cancel the unfilled orders.

I have been attempting to achieve this using cell J27 with the formula

=OR(AND(M3=0,ID2.SG1@4ID2.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.

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
[2018-06-30 08:38:33]
Sierra Chart Engineering - Posts: 104368
See if you can find any formula on this page which will help:
Spreadsheet Example Formulas and Usage
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account