Ok, I give. I'm tired and I can't figure it out. I would like to capture the low (or the high) of the bar preceding the bar in which my AddOrder() is fired and use that as a stop for said order.
def longEntry = close > open; #simple example
def stopLevel = "the low of the bar prior to the bar in which close > open" <-- how the heck do i capture this?
AddOrder(OrderType.BUY_TO_OPEN, longEntry , close, 2, Color.WHITE, Color.WHITE, "LONG: " + close);
AddOrder(OrderType.SELL_TO_CLOSE, low < stopLevel, close, 2, Color.WHITE, Color.WHITE, "LONG STOP @ " + close + " for " + (close-EntryPrice()) + "pts");
def longEntry = close > open; #simple example
def stopLevel = "the low of the bar prior to the bar in which close > open" <-- how the heck do i capture this?
AddOrder(OrderType.BUY_TO_OPEN, longEntry , close, 2, Color.WHITE, Color.WHITE, "LONG: " + close);
AddOrder(OrderType.SELL_TO_CLOSE, low < stopLevel, close, 2, Color.WHITE, Color.WHITE, "LONG STOP @ " + close + " for " + (close-EntryPrice()) + "pts");