♥ 0 |
I am reposting this questions to include a screenshot.. Hello all. I am building a strategy to back test and I cannot figure out if there is a way to use the low of a previous candle for an entry. On this particular strategy, after a RED candle crosses below the 10EMA, and there is a RED candle after that, I want it to trigger in a “SELL” if the price drops to -.01 below the low of the 2nd Red candle. Is there a way to do that? Here is my code so far. input tradeSize = 100; def signal = high[1] crosses above MovAvgExponential(“length” = 10).”AvgExp” and (TTM_Squeeze().”Histogram”[1] is less than 0 and TTM_Wave().”Wave2High”[1] is less than 0) AND (close[1]< open[1]) AND (TTM_Wave().”Wave2LOW” < TTM_Wave().”Wave2LOW”[1]) AND (close[0] < open[0]); AddOrder(OrderType.SELL_TO_OPEN, signal, open[0], tradeSize, Color.CYAN, Color.CYAN); def exit = TTM_Wave().”Wave2LOW” > TTM_Wave().”Wave2LOW”[1]; AddOrder(OrderType.BUY_TO_CLOSE, exit, open, tradeSize, Color.MAGENTA, Color.MAGENTA); I know it sounds weird, but I prefer the “cross” signal to go off when the high crosses above the 10ema, because if it does that and comes back down to form a red candle, it reinforces the resistance of that 10ema. I copied a screen shot of my entry and stop. Then second candle needs to be red and go below the signal candle. Once that happens, take the trade .01$ below 2nd candle with protective stop .01$ above signal candle. If possible, I would like to get out the open of the first candle after the first “yellow” ttm squeeze bar. I hope this clarifies my question a bit more sir.
Marked as spam
|
Please log in to post questions.