♥ 0 |
What are the codes for those conditions and for scanning? Please advise. Thanks!
Marked as spam
|
Private answer
So you actually have a lot going on there. You have defined an uptrend and a downtrend. For each trend direction you have defined two separate patterns. Which involves the 21 and the 50 exponential moving averages. I see you also mention hooking up from 20 and hooking down from 80. I am guessing those are for the Stochastic although you don’t specifically mention that. I’ll consider your previous post in which we cover the Stochastic portion: https://www.hahn-tech.com/ans/alert-fullk-crosses-fulld-overbought/ So excluding the Stochastic I have the following code for you. I’ve broken down all the elements into separate lines so you can follow the logic. The last four lines are your signals. I did not provide any plots, leaving it to you to work out how you want to use the last four signals in whatever method you choose. I have not tested this so there may be some errors. Let me know how it works and I’ll make any adjustments needed to get things dialed in.
Marked as spam
|
|||||||||
Private answer
Hi Pete, When I do this to the last 4 lines: Plot pullBack1 = uptrend and pullBackEMA1; Why does it give an error: “Exactly one plot expected”? Marked as spam
|
|||||||||
Private answer
Hi Pete, I used the “Plot scan” above and it gave attached error (it did not allow me to copy the error in Scan). Please see attached file. Thanks. Marked as spam
|
|||||||||
Private answer
I don’t think the logic is working. Please see attached file. Though price gets near EMAs, it’s not hooking up from 20, but it already gives scan result. Please check. Thanks. Marked as spam
|
|||||||||
Private answer
Please see attached screen shot. Scan gives this as a Sell signal. However, price is above EMAs and not even pulls back and it hooks down from 80. Price supposed to rally up if it’s a sell hooking down. Logic is not working somehow. Please show how to fix. Thanks Marked as spam
|
|||||||||
Private answer
Please see attached file. Scan gives as a Buy. Though hooks up from 20, price not even pullback near EMAs yet. It gives signal too soon. Thanks. Marked as spam
|
|||||||||
Private answer
See attached file. Scan gives as a Sell. However, price still above EMAs (even above 200). Logic is not working. Thanks. Marked as spam
|
|||||||||
Private answer
Please see attached file. Scan gives signal as a buy. However, price still above EMAs, even though it’s hooking down from 80. Marked as spam
|
|||||||||
Private answer
Ok, I regret that this post has dragged on for so long without coming to a conclusion. I had expected that the code I had provided was clear and concise enough that it could be easily understood and flexible enough for viewers to apply as they saw fit. I was incorrect, and I apologize. So here is the code and associated screenshot. This code combines the Stochastic “hooks” as well as the price pullbacks and rallies to the key moving averages of 21 EMA and 50 EMA. The 200 SMA is used as the trend direction. This code includes the elements from the Stochastic and everything is combined into a single cohesive program. There are two modes for this scan. One finds potential long signals while the other finds potential short signals. You cannot run them both together. The signals you are searching for almost never occurr at the same time. So the pullback to the EMA has to occur first, followed by the Stochastic “hook”. To accomplish this I have included 5 bars of space for both conditions to have occurred. The screenshot shows three charts, each were picked up in a current scan using daily time frame. In each chart you can see the pullback to a key EMA has occurred several bars prior to the Stochastic “hook”. Having provided this solution I am closing this topic so as to avoid any further confusion for future visitors to this post.
Marked as spam
|
Please log in to post questions.
The last four lines are your signals. You don’t turn them into plots. The scan only accepts one plot. You can add any number of your signals to the scan like this:
plot scan = pullBack1 or pullBack2 or rallyBack1 or rallyBack2;
Your code to measure pullbacks to the 200 sma cannot include uptrend. Because the uptrend contradicts the rule of the pullback to the 200 sma and the downtrend contradicts the rule for the rallyback to 200 sma.