Sound and Arrow alert for EMA 8


0
0

Can you create an alert for when the EMA  8 touches the bottom of the wick on green candle and when the EMA 8 touches the top of red candle.

Attachments:
Marked as spam
Posted by (Questions: 4, Answers: 23)
Asked on November 20, 2017 7:59 pm
692 views
0
Private answer

There is quite a lot more involved here than just checking if the moving averages have made contact with the wicks of these candles. If you do some in depth research you will find that a simple solution will produce many signals you do not want. My expectation is that when you study this in detail you will find there are at least a half dozen other conditions you must account for in order to capture the exact signals you want and leave out the rest. By the time we arrive at all those other details we’ll be well beyond the scope of a free solution posted in the Q&A forum.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 20, 2017 10:26 pm
0
Private answer

If it’s going to cost me then I don’t mind I just need the EMA 8 to alert and sound when it touches the wick. I have a strategy I just need the alert not really worried about how many alerts I get.

Marked as spam
Posted by (Questions: 4, Answers: 23)
Answered on November 21, 2017 1:03 am
0
Private answer

Ok, so we’ll draw up some code that checks if only the wick of a candle has crossed the 8 ema. This will be accomplished by checking if the high is above the 8 ema, while the close and open are below it. For the other side we’ll be checking if the low is below the 8 ema, while the close and open are above it. This means the pattern is only complete once the bar has completely closed and the new bar has opened. So we’ll need to craft the signals to trigger on the open of the bar that follows this pattern. (that means the audible alerts will not sound until the bar that pierces the 8 ema has closed and the next bar has opened)

Here is the code. Screenshot attached. I have placed the crosshairs purposefully to demonstrate the extreme fringe of the signals. The displayed value of the 8 ema is rounded. So this looks like the open and the 8 ema are equal. However the 8 ema is actually below the open. Which means that is a valid signal given the specifications you listed.


def ema = ExpAverage(close, 8);
def piercingHigh = high > ema and open < ema and close < ema;
def piercingLow = low < ema and open > ema and close > ema;
plot signalHigh = piercingHigh[0];
signalHigh.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signalHigh.SetDefaultColor(Color.MAGENTA);
plot signalLow = piercingLow[0];
signalLow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
signalLow.SetDefaultColor(Color.CYAN);
Alert(signalHigh[1], "Piercing High", Alert.BAR, Sound.RING);
Alert(signalLow[1], "Piercing Low", Alert.BAR, Sound.RING);

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 21, 2017 10:09 am
0
Private answer

I’m getting error messages as shown in attachments.

Attachments:
Marked as spam
Posted by (Questions: 4, Answers: 23)
Answered on November 21, 2017 6:11 pm
0

The code I provided only contains 11 lines and your screenshot indicates you have more than 17 lines. This, combined with the error messages tells me you have likely pasted the code twice, duplicating every line.

( at November 21, 2017 9:02 pm)
0

Okay let me try again

( at November 21, 2017 9:08 pm)
0
Private answer

Thanks for the indicator but I have found that it creates to much noise and traffic so I’ve looked at maybe adding candlestick patterns and I found that the strategy works well with inverse hammers and hammers, hangman and shootingstar is there way you can possibly alert when the wix is touched on the top of red candle and wix is touched on the bottom of green candle. Still sticking with EMA 8 using the candlestick patterns listed.

Attachments:
Marked as spam
Posted by (Questions: 4, Answers: 23)
Answered on November 27, 2017 12:31 pm
0

I will refer back to my original comments about there being several other factors involved in order to achieve your desired results. I anticipated this very thing from the start. And having done so, I can also assure you that candle stick patterns will not get you there either. Something else will be identified, and something else after that. So if you want to pursue this further we can open up a custom thinkscript project. I can build each phase as you identify more conditions and filters to add. And I can bill you for each phase along the way until you achieve the desired result. Here is where you can get started: https://www.hahn-tech.com/about/

( at November 27, 2017 12:56 pm)
0

Okay sounds good.

( at November 27, 2017 3:30 pm)