Single Green Candle Crosses Two SMA’s


Category:
0
0

Hi Pete, I’m trying to find a code to capture a single green candle that opens below two different SMA’s (ex: SMA4 and SMA8) and closes above both of those SMA lines in the same day. And having them as a signal “Point @ Close” if cannot be done, the arrow signal is fine as well.

Thanks in advance 🙂

RESOLVED
Marked as spam
Posted by (Questions: 7, Answers: 16)
Asked on December 15, 2018 4:39 pm
75 views
0
Private answer

Here you go.

plot smaOne = Average(close, 4);
plot smaTwo = Average(close, 8);
def crossBoth = open < smaOne and open < smaTwo and close > smaOne and close > smaTwo;
plot signal = crossBoth;
signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
signal.SetDefaultColor(Color.YELLOW);
signal.SetLineWeight(3);

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on December 17, 2018 8:02 am
0

Thanks big time Pete! You’re always helpful. I will drop a contribution for your great work!!!

?

( at December 17, 2018 8:08 am)