hi i want to know how to make a Trading-view script with alert, condition when ema 2 crossed above by previous close candle and new open candle also close above it. the color of the candle should be green.
Asked
Active
Viewed 30 times
-1
-
Welcome to SO. We are not a free code writing service. We're more than happy to help once you've made an effort to solve the problem yourself and run into difficulties. When that happens, you can explain the problem you're having, include the relevant portions of your code in the form of a [mre], and ask a specific question about that code, and we'll try to help. You'll find your experiences here will be much better if you spend some time taking the [tour] and reading the [help] pages to learn how the site works before you begin posting. – Ken White Oct 07 '22 at 01:47
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 07 '22 at 11:49
1 Answers
0
This is quite easy script, resolvable with little googling and reading the basic documentation, so next time try to do it yourself. Here is the answer of this question.
var ema = ta.ema(close,2)
if close[1] > ema[1] and ema > close and close > open // IF PREVIOUS BAR NEEDS TO BE GREEN AS WELL, ADD THIS: and close[1] > open[1]
alert("add your message here", alert.freq_once_per_bar_close)

vlad
- 139
- 1
- 4
- 12