Lesnewby
Member
Moving Average (MA) Heiken Ashi Trend Strategy for ThinkorSwim
Good morning, hope you are safe and well! Yes if you could share I would try it and give you some feedback!
Here is something that may interest you, it is a Strategy that I use with Expected Moves for SPY, QQQ, and IWM. I trigger a buy order on the second green bar, on the HA (Heiken-Ashi) candle without a tail. The exit is same on the 2nd red bar. I developed this with Pete Hahan, and paid him for the modifications so I can share. I only use the long order side and I only trade options on these signals.
Let me know what you think and how we can improve this!
Leslie (Lesnewby)
LJJ
Good morning, hope you are safe and well! Yes if you could share I would try it and give you some feedback!
Here is something that may interest you, it is a Strategy that I use with Expected Moves for SPY, QQQ, and IWM. I trigger a buy order on the second green bar, on the HA (Heiken-Ashi) candle without a tail. The exit is same on the 2nd red bar. I developed this with Pete Hahan, and paid him for the modifications so I can share. I only use the long order side and I only trade options on these signals.
Let me know what you think and how we can improve this!
Leslie (Lesnewby)
Code:
#start
#Software modified by Pete Hahn for #L.J.Jedrychowski
# Leslie Jedrychowski V 7.0 2grn HA bars after a HA red bar.
#---------- Strategy Inputs
input tradeSize = 100;
#---------- Moving Average Inputs
input maLengthOne = 20;
input maTypeOne = AverageType.EXPONENTIAL;
input maPriceOne = close;
input maLengthTwo = 100;
input maTypeTwo = AverageType.EXPONENTIAL;
input maPriceTwo = close;
#---------- Moving Average Section
plot maOne = MovingAverage(maTypeOne, maPriceOne, maLengthOne);
plot maTwo = MovingAverage(maTypeTwo, maPriceTwo, maLengthTwo);
#---------- Heiken-Ashi Candles Section
def haClose = ohlc4;
def haOpen = if haOpen[1] == 0 then haClose[1] else (haOpen[1] + haClose[1]) / 2;
def haHigh = Max(high, Max(haClose, haOpen));
def haLow = Min(low, Min(haClose, haOpen));
def greenCandle = haClose > haOpen;
def redCandle = haClose < haOpen;
def trendUp = greenCandle and greenCandle[1] and !greenCandle[2];
def trendDown = redCandle and redCandle[1] and !redCandle[2];
#---------- Strategy Orders Section
# Long order
AddOrder(OrderType.BUY_TO_OPEN, trendUp[-1], close[-1], tradeSize, Color.CYAN, Color.CYAN, "LE");
AddOrder(OrderType.SELL_TO_CLOSE, trendDown[-1], close[-1], tradeSize, Color.MAGENTA, Color.MAGENTA, "LX");
#Short order
#AddOrder(OrderType.SELL_TO_OPEN, trendDown[-1], close[-1], tradeSize, Color.CYAN, Color.CYAN, "HA 2 Bar SE");
#AddOrder(OrderType.BUY_TO_CLOSE, trendUp[-1], close[-1], tradeSize, Color.MAGENTA, Color.MAGENTA, "HA 2 Bar SX");
#end
LJJ
Last edited by a moderator: