Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 05:52:23 +0000



[Programming Help] - Buy entry not executing after bar that executes an attached order SL exit

View Count: 263

[2024-03-23 20:12:27]
PhiX - Posts: 36
When using Trading System Based On Alert Condition and trading NQ I have a BUY alert condition where ID1 is a moving average:

AND(
C>ID1.SG1,
C>O)

I have attached orders for TP and SL.
Evaluate on Bar Close Only is set to YES.

On Bar 1 the Buy condition is satisfied and a Buy is executed on the open of bar 2.
On bar 2 NQ sells off and touches the attached SL and exits the trade.
On the same bar, NQ reverses and closes above it's open and above the MA satisfying the Buy condition again.
On on the open of Bar 3 nothing happens even though the Buy on Alert Condition subgraph SG1 renders a point at the low of the bar.
Bars 4, 5, 6, 7 & 8 all satisfy the buy condition and print points at the low of the bars yet no trades are executed.
No buy trades are executed until after a bar that does not meet the buy condition closes which somehow resets everything.

I have tried every setting and cannot get it to execute the buy on bar 3... so what's the solution?
Date Time Of Last Edit: 2024-03-23 20:14:13
[2024-03-24 17:32:29]
Sawtooth - Posts: 4120
so what's the solution?
Try this formula instead:
=AND(CROSSFROMBELOW(C,ID1.SG1),C>O)

After a TRUE, there needs to be a FALSE before another TRUE can trigger.
On the Alerts tab, check 'Reset Condition On New Bar'.
[2024-03-24 17:59:19]
PhiX - Posts: 36
Thanks,

That makes sense.

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

Login

Login Page - Create Account