This should do the trick:
input lengthOne = 9;
input lengthTwo = 20;
input lengthThree = 50;
input lengthFour = 100;
input lengthFive = 200;
input averageType = AverageType.EXPONENTIAL;
plot emaOne = MovingAverage(averageType, close, lengthOne);
plot emaTwo = MovingAverage(averageType, close, lengthTwo);
plot emaThree = MovingAverage(averageType, close, lengthThree);
plot emaFour = MovingAverage(averageType, close, lengthFour);
plot emaFive = MovingAverage(averageType, close, lengthFive);
plot crossingAbove = (emaOne[1] < emaTwo[1] and emaOne > emaTwo) or (emaOne[1] < emaThree[1] and emaOne > emaThree) or (emaOne[1] < emaFour[1] and emaOne > emaFour) or (emaOne[1] < emaFive[1] and emaOne > emaFive);
crossingAbove.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot crossingBelow = (emaone[1] > emaTwo[1] and emaOne < emaTwo) or (emaone[1] > emaThree[1] and emaOne < emaThree) or (emaone[1] > emaFour[1] and emaOne < emaFour) or (emaone[1] > emaFive[1] and emaOne < emaFive);
crossingBelow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
AssignPriceColor(if crossingAbove or crossingBelow then Color.WHITE else Color.CURRENT);
All of those things you just mentioned are a simple matter of adjusting settings that are common to all chart studies. There is no need to write any code to achieve any of that.
Thx, just found how can change color and size of an arrow. But there is no option of just intraday study. Thx
Perhaps I don’t understand your request about “just intraday study”. Simply change the time frame on the chart to anything measured in minutes. What am I missing? And you mentioned something about not premarket and not aftermarket. These are chart settings. Are you brand new to this platform? Those are very fundamental adjustments.
is there a way to have audio alert during the crossover?
Yes, alerts can be included by adding these two lines to the bottom of the code:
Alert(crossingAbove, “Cross Above”, Alert.BAR, Sound.RING);
Alert(crossingBelow, “Cross Below”, Alert.BAR, Sound.RING);
Hi Pete. I have the other code for the ema crossing, but I have a question about the SoundRing. TOS rings for about 2-3 hours and then it stops ringing. I still get the flash at the top of the watchlist area, but no sound. Any thoughts?
I can’t imagine anything that would make it work sometimes but not others. For that, I am going to have to refer you to TDA support. There is nothing we can do with code to address that.