0% found this document useful (0 votes)
11 views

indicator 11

The document outlines a trading script that generates buy and sell signals based on specified conditions. It includes options for different types of moving averages and Bollinger Bands, allowing users to customize the smoothing method and parameters. The script also plots the signals and moving averages on a chart for visual analysis.

Uploaded by

rihim69961
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

indicator 11

The document outlines a trading script that generates buy and sell signals based on specified conditions. It includes options for different types of moving averages and Bollinger Bands, allowing users to customize the smoothing method and parameters. The script also plots the signals and moving averages on a chart for visual analysis.

Uploaded by

rihim69961
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

lastBuySignal := true

lastSellSignal := false

if (sellCondition)

lastSellSignal := true

lastBuySignal := false

plotshape(series=buyCondition, location=location.belowbar,
color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")

plotshape(series=sellCondition, location=location.abovebar,
color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")

// Smoothing MA inputs

GRP = "Smoothing"

TT_BB = "Only applies when 'SMA + Bollinger Bands' is selected.


Determines the distance between the SMA and the bands."

maTypeInput = input.string("None", "Type", options = ["None", "SMA",


"SMA + Bollinger Bands", "EMA", "SMMA (RMA)", "WMA", "VWMA"], group
= GRP, display = display.data_window)

maLengthInput = input.int(14, "Length", group = GRP, display =


display.data_window)

bbMultInput = input.float(2.0, "BB StdDev", minval = 0.001, maxval = 50,


step = 0.5, tooltip = TT_BB, group = GRP, display = display.data_window)

var enableMA = maTypeInput != "None"

var isBB = maTypeInput == "SMA + Bollinger Bands"

// Smoothing MA Calculation

ma(source, length, MAtype) =>

switch MAtype

"SMA" => ta.sma(source, length)

"SMA + Bollinger Bands" => ta.sma(source, length)


"EMA" => ta.ema(source, length)

"SMMA (RMA)" => ta.rma(source, length)

"WMA" => ta.wma(source, length)

"VWMA" => ta.vwma(source, length)

// Smoothing MA plots

smoothingMA = enableMA ? ma(out, maLengthInput, maTypeInput) : na

smoothingStDev = isBB ? ta.stdev(out, maLengthInput) * bbMultInput : na

plot(smoothingMA, "EMA-based MA", color=color.yellow, display =


enableMA ? display.all : display.none, editable = enableMA)

bbUpperBand = plot(smoothingMA + smoothingStDev, title = "Upper


Bollinger Band", color=color.green, display = isBB ? display.all :
display.none, editable = isBB)

bbLowerBand = plot(smoothingMA - smoothingStDev, title = "Lower


Bollinger Band", color=color.green, display = isBB ? display.all :
display.none, editable = isBB)

fill(bbUpperBand, bbLowerBand, color= isBB ? color.new(color.green, 90) :


na, title="Bollinger Bands Background Fill", display = isBB ? display.all :
display.none, editable = isBB)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy