Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 19:21:17 +0000



Post From: Cancel unfilled orders

[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