Polk
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: June 25th, 2021
Contact: TradingView Profile

Alert

Any know how i can make one alert for many coins?

I have one alert RSI 30%
How i can use this pinescript for alert my 50 coin in list?

I want to list all coin no scrip and not go 1 for 1 coins e make um new alert

it's is possible?

tks all

and sorry for bad english

CanYouCatchMe01
Pine Script Rookie
Pine Script Rookie
Posts: 6
Joined: June 28th, 2021

Re: Alert

This worked. I made a script that can plot multiple RSI lines of different symbols. The colour of the plot is green if the RSI value is below 30, and red if it is above 70. You can just copy the rows and add more symbols. I think the maximum number of stocks to plot is 40. You should also be able to add Alerts in the get_color_rsi().

Image

Code: Select all

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © CanYouCatchMe

//@version=4
study("My Script")

get_color_rsi(value) =>
    c = color.blue
    if (value < 30)
        //Alert: buy
        c:=color.green
    else if (value > 70)
        //Alert: sell
        c:=color.red
    c //Returning color

rsi_value = rsi(security("BTCUSD", timeframe.period, close), 14)
plot(rsi_value, color=get_color_rsi(rsi_value))

rsi_value := rsi(security("OMXS30", timeframe.period, close), 14) //Note: You need a := when assigning rsi_value again.
plot(rsi_value, color=get_color_rsi(rsi_value))

rsi_value := rsi(security("DAX", timeframe.period, close), 14)
plot(rsi_value, color=get_color_rsi(rsi_value))
I tried to make a string array of many symbols and then plotting them. When I tried to get a value from the array it returned a variable of the type "series[string]". The plot function only accepts a "sting", not a "series[string]".

The code that did not work:

Code: Select all

var a = array.new_string()
array.push(a, "OMXS30")
plot(security(array.get(a,0), timeframe.period, close)) //Error: "Cannot call 'security' with 'symbol'=series[string]. The argument should be of type: string"

Return to “Request Scripts”