In my current automated strategy I use the following code for a long limit entry, where "Contracts" = number of contracts, "Indicator.Resistance" represents an indicator developed by a friend where "Resistance" is the resistance line that price must close above to trigger the long entry (Resistance becomes "Support" in short entries), and "limEntry" is an int variable for the limit entry in ticks placed above the resistance line in longs (below the support line in shorts):