convert pine-script strategy into indicator alert

Forums ProRealTime English forum ProBuilder support convert pine-script strategy into indicator alert

Viewing 2 posts - 1 through 2 (of 2 total)
  • #182337

    // please help me with this strategy into alert indicator!!
    //@version=5
    strategy(title=’trail_points’, overlay=true, initial_capital=5000, default_qty_value=50)

    rib_grp = ‘Moving Average Settings’
    ma(source, length, type) => type == “SMA” ? ta.sma(source, length) : type == “EMA” ? ta.ema(source, length) : type == “SMMA (RMA)” ? ta.rma(source, length) : type == “WMA” ? ta.wma(source, length) : type == “VWMA” ? ta.vwma(source, length) : na

    show_ma1 = input(true , “MA №0″, inline=”MA #0”, group=rib_grp)
    ma1_type = input.string(“SMA” , “” , inline=”MA #0″, options=[“SMA”, “EMA”, “SMMA (RMA)”, “WMA”, “VWMA”], group=rib_grp)
    ma1_source = input(low , “” , inline=”MA #0″, group=rib_grp)
    ma1_length = input.int(34 , “” , inline=”MA #0″, minval=1, group=rib_grp)
    ma1_color = input(#000000, “” , inline=”MA #0″, group=rib_grp)
    ma1 = ma(ma1_source, ma1_length, ma1_type)
    plot(show_ma1 ? ma1 : na, color = ma1_color, title=”MA №0″)

    // ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //
    long_entry = ma1<close
    long_exit = ta.crossover(ma1, close)

    // ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ //

    trail_p = input.int(defval=460, step=10)
    trail_o = input.int(defval=0, step=10)

    strategy.entry(‘long’, strategy.long, when=long_entry) //true
    strategy.exit(‘TP’, ‘long’, trail_points=trail_p, trail_offset=trail_o)
    strategy.close(‘long’, when=long_exit, comment=’close’)

    #182464

    Alert on what conditions please?

    If it is about the “long entry”, the condition is simple: the moving average of X type (SMA by default) applied on price Low and period of 34 is under the Close. You can create it by using the embedded Alert tool of the platform. It’s easy:

    https://www.prorealtime.com/en/help-manual/create-market-alerts

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login