Support Board
Date/Time: Fri, 09 May 2025 16:40:18 +0000
[User Discussion] - Spreadsheet Auto Trader : Cancel Working Orders [J27]
View Count: 1782
[2015-12-22 16:14:36] |
UserNameTodd - Posts: 4 |
My design intent: a signal is generated and sends a working parent order (price level from J22 or J24) that is based on a Chart Trader configuration with defined child Target and Stop OCO. If the condition on the next bar is "TRUE" in J27, I want the working order cancelled. This next bar also creates a signal to place a newly priced working order in the same direction as the first signal at the new price level of either J22 or J24. The net effect is to move the working order as the price moves and as long as the other studies are in agreement. In other words: let's say a signal is generated and working sell order is placed -5 ticks from the high of the current bar "H-5". On the next bar, a higher high +2 ticks prints and a new sell signal is generated. The existing order needs to be cancelled (J27 remains TRUE) and the new working order placed at "H-5" which ends up 2 ticks higher than the prior order. But this is not happening. What I thought to be relevant settings: Reset Condition on New Bar = TRUE Allow Multiple Entries in Same Direction = False Signal Only Once Per Bar = False What I'm seeing: when the order signal is triggered a working order is placed. This also sets J27 TRUE but the working order remains - which is what I want. If the next bar generates a new order signal (same direction) for an updated price location AND J27 remains TRUE, the first working order is not cancelled and remains in place. This working order remains at the first signal location as long as J27 remains TRUE until filled even though new order signal locations are generated - UNLESS (and here's what I don't understand) - one of the subsequent bars generates a condition to toggle J27 to False. At this point, the working order remains in place which is good. Then, if some bar later a new order signal is generated AND J27 then toggles from False to True, the first order is cancelled and a new working order is placed at the desired price. Is this logic for the "toggle" on J27 correct? My thought/hope was that by setting "Reset Condition on New Bar = TRUE" the signaled working order would cancel and be replaced with the new price level. Suggestions? Errors on my part? More information needed? Thank you. |
[2015-12-22 18:09:38] |
Sawtooth - Posts: 4214 |
Column J is not affected by the spreadsheet settings; those settings only apply to Formula Columns K-Z...BR. You are correct that J27 will need to go FALSE so that a new TRUE will do what you want. To make that happen, the J27 formula will need to reference some event. You may need to use a Formula Column to locate an event, and/or it may involve adding study to count or mark an event. I don't have enough info to provide an exact solution. |
[2015-12-22 20:04:58] |
UserNameTodd - Posts: 4 |
You knew enough! I took your advice, experimented with logic conditions in time as it relates to the present bar and saw that J27 will invoke the cancellation somewhat independent to the "toggle" condition...it got a little cloudy at that point.....so I changed my logic around in relation to when an order is actually entered and got it working...best guess is there was a race condition? The fix involved using price level comparisons from current bar to prior bar - move the order signal to the next bar after the "true" signal on the current bar with an "AND" condition - while keeping the cancellation as an immediate - it's not "perfect", but it works. Will be interesting to see if it holds in a fast moving market ;-). Might end up going to ACSIL after all.... Be that as it may = Done. Thanks again! Todd |
To post a message in this thread, you need to log in with your Sierra Chart account: