Trading View Pinescript MA Crossover Script Issue

We have an existing pine script for alerts for buy and sell using 2 MAs (moving averages) crossing over and under.

Problem: A buy order is sometimes followed by another buy order.

We believe this happens because sometimes the faster MA goes above the slower MA but the candle closes below the slower MA in one candle, bringing the faster MA below the slower MA again without a sell alert as we can only have one alert per bar.

Solution: We want you to modify our script so every buy alert to be followed by a sell alert based on the MAs crossing over or under in real time and not per bar close.



study("MA Alert 2")

src = input(close)

ma_1 = sma(src, 3)

ma_2 = sma(src, 30)

c = crossover(ma_1, ma_2)

d = crossover(ma_2, ma_1)

alertcondition(c, title='Red crosses blue', message='BUY_BITTREX_BTC-')

alertcondition(d, title='Blue crosses red', message='SELL_BITTREX_BTC-')

plot(ma_1, color=red)

plot(ma_2, color=blue)

plot(crossover(ma_2, ma_1) ? ma_2 : na, style = cross, linewidth = 7)

plot(crossover(ma_1, ma_2) ? ma_1 : na, style = circles, linewidth = 7)

Skills: Coding, Programming

See more: s.h.a.r.c, traducción español francés, poner a limpio trabajo., Hi, I need a creative logo for a new concept called \ LiveShop\ . It\ s basically a live FaceTime or Skype call from a retail st, tradingview strategy alert, moving average pine script, tradingview + custom alerts, pine script crossover, tradingview crossover, pine script alert, tradingview sms alerts, pine script strategy, what to do if an attorney does not close a deceased estate, seeking web developer s for a startup regina regina area jobs programmers computer, let's write a newspaper story, freelance editor proofreader to assist clients with editing and proofreading services candidate will have a bachelor's in a rele, bailey s 2011 a academic writing, i need a website for my company it has to very simple need 45 different pages homecontact about uscareer etc i need s, how to close a project, trading view, mysql export view data csv shell script

About the Employer:
( 5 reviews ) Dhaka, Bangladesh

Project ID: #15914853