♥ 0 |
Pete,
This is a follow on question to my previous question that in greater detail explains what I am looking to do.
The basis behind the request is to eliminate situations as shown in as shown in the pictures, where while the MACD+RSI would indicate a buy/sell condition but the RSI stays above the oversold/overbought input and continues on it’s upward/downward trend.
My thought would be that instead of plotting the indicator when the MACD histogram pivots while the RSI is oversold/overbought, it would instead make new variable “X” = -1 (oversold) or 1 (overbought) and remain at that value until plotted.
In conjunction, the Heikin Ashi code is always a 1 or -1 based on the current trend. A variable “Trend” in your Heikin Ashi code looks for when “haClose > haOpen then 1 else if haClose < haOpen then -1 else 0”
The indicator would then plot when, for example, variable”X” = -1 AND Trend = 1, which would signal that the MACD+RSI indicated a possible pivot and the Heikin Ashi trend change confirms it.
After plotting the indicator, the MACD+RSI would return from -1 or 1 to zero until these indicators establish another possible pivot.
I am trying to use the MACD+RSI indicator you developed here: https://www.hahn-tech.com/thinkorswim-scan-macd-rsi-part-two/
and the Heikin Ashi code you developed here: https://www.hahn-tech.com/ans/heikin-ashi-on-thinkorswim-mobile-app/
My current effort was able to insert the Heikin Ashi code developed into the MACD+RSI scan, modify it so that instead of plotting the “trend”, turn it into a variable to be used with the plot MACD+RSI plot. This works, however will only plot the buy/sell indicator if the Heikin Ashi trend change occurs at the time of the MACD+RSI condition, but does not capture the situations where the equity continues to be oversold/overbought RSI zone and remain on its trend as described above.
Code for this is below: <pre> input fastLength = 12; def Diff = MACD(fastLength, slowLength, MACDLength, averageTypeMACD).Diff; input length = 14; def NetChgAvg = MovingAverage(averageType, price – price[1], length); def RSI = 50 * (ChgRatio + 1); def pivotLowMACD = Diff > Diff[1] and Diff[1] > Diff[2] and Diff[2] < Diff[3] and Diff[3] < Diff [4]; def pivotHighMACD = Diff < Diff[1] and Diff[1] < Diff[2] and Diff[2] > Diff[3] and Diff[3] > Diff[4]; def oversoldRSI = RSI <= 27; def haClose = ohlc4; plot scan = pivotHighMACD and trend <= 0 and Highest(overboughtRSI[1], 4) > 0; </pre>
Marked as spam
|
Please log in to post questions.