Buy at specific ADX level?

hello…

Is it possible to code in amibroker such that the buy/sell is at particular price?

eg. buy when +DMI=30; short when -DMI=30.

the trigger may be one that crosses this level --> +DMI=32 / -DMI = 33 etc. but i want the buy/sell price to be what would have been when the DMI was 30.

thank you!

Try this
Buy
SET A = IF(DIP=30, CLOSE, 0) AND
DIP>32 AND
LAST = A
Exit
SET A = IF(DIN=30, CLOSE, 0) AND
DIN>32 AND
LAST = A