0% found this document useful (0 votes)
69 views1 page

Tradingview Indicator

This document defines a custom trading indicator in Pine Script for TradingView. It calculates fast and slow simple moving averages (SMA) based on user-defined parameters and generates buy/sell signals based on crossover conditions and RSI levels. The indicator allows customization of colors for bullish and bearish signals and plots the moving averages on the chart.

Uploaded by

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

Tradingview Indicator

This document defines a custom trading indicator in Pine Script for TradingView. It calculates fast and slow simple moving averages (SMA) based on user-defined parameters and generates buy/sell signals based on crossover conditions and RSI levels. The indicator allows customization of colors for bullish and bearish signals and plots the moving averages on the chart.

Uploaded by

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

//@version=5

indicator("My Custom Indicator", shorttitle="MCI", overlay=true)

// Input parameters
length = input.int(14, title="Period Length", minval=1, maxval=100)
source = input.source(close, title="Source")
showSignals = input.bool(true, title="Show Buy/Sell Signals")

// Color inputs
bullishColor = input.color(color.green, title="Bullish Color")
bearishColor = input.color(color.red, title="Bearish Color")

// Calculate moving averages


fastMA = ta.sma(source, length)
slowMA = ta.sma(source, length * 2)

// Calculate RSI for additional signals


rsi = ta.rsi(source, length)

// Define conditions
bullishCondition = ta.crossover(fastMA, slowMA) and rsi < 70
bearishCondition = ta.crossunder(fastMA, slowMA) and rsi > 30

// Plot moving averages


plot(fastMA, color=color.blue, linewidth=2, title="Fast MA")
plot(slowMA, color=color.orange, linewidth=2, title="Slow MA")

// Plot buy/sell signals


plotshape(
series=bullishCondition and showSignals,
title="Buy Signal",

You might also like