Last active
June 24, 2020 13:48
-
-
Save princefr/307deb1aba74a12dd494dae89ef07050 to your computer and use it in GitHub Desktop.
ma_alert is changing color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ | |
// © prince_ond | |
//@version=4 | |
study("Mon Script", overlay=true) | |
ma = ema(close, 20) | |
ma_color() => ma[5] > ma[2] ? color.red : color.green | |
ma__isdown = ma[5] > ma[2] | |
ma_is_up = ma[5] < ma[2] | |
plot(ma, color=ma_color()) | |
alertcondition(ma_is_up, title='Buy Signal {{exchange}} ', message='{"exchange" : "{{exchange}}" , "pairs": "{{ticker}}" , "direction": "buy", "price": "{{close}}", "type": "enter_long"}') | |
alertcondition(ma__isdown, title='Sell Signal {{exchange}} ', message='{"exchange" : "{{exchange}}" , "pairs": "{{ticker}}" , "direction": "buy", "price": "{{close}}", "type": "enter_sell"}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment