Login Page - Create Account

Support Board


Date/Time: Sat, 30 Nov 2024 04:53:29 +0000



[Programming Help] - Trading Based on Alert - entry if price above level for a few candles back.

View Count: 358

[2022-12-13 14:25:05]
Dean Roberts - Posts: 79
Hi
I'm trying to write an long entry on a simple alert for if price crosses from above but only if the low of the previous candles have been 12 ticks above the level for a number of candles. I am getting a syntax error.

Can someone telling me where I am going wrong please?

=OR(CROSSFROMABOVE(C,ID19.SG2)>ID15.SG2), L[-1]>=ID19.SG2[-1]+(12*TICKSIZE), L[-2]>=ID19.SG2[-2]+(12*TICKSIZE), L[-3]>=ID19.SG2[-3]+(12*TICKSIZE))

ID15.SG2 is the ETH Developing VA Lines High
ID19.SG2 is the RTH Developing VA Lines High

So I am trying to get and entry if ID19.SG2 is higher than ID15.SG2 but only if the low of the price candle has been at least 12 ticks above ID19.SG2 for the previous 3 candles.

Much appreciated
Cad
[2022-12-13 16:00:49]
Sawtooth - Posts: 4123
Try this:
=AND(CROSSFROMABOVE(C,ID19.SG2), ID19.SG2>ID15.SG2, L[-1]>=ID19.SG2[-1]+(12*TICKSIZE), L[-2]>=ID19.SG2[-2]+(12*TICKSIZE), L[-3]>=ID19.SG2[-3]+(12*TICKSIZE))
[2022-12-14 10:12:24]
Dean Roberts - Posts: 79
This is fantastic. Thank you Tom.

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

Login

Login Page - Create Account