Bitcoin Forum
May 01, 2024, 11:56:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [GUIDE] create your TA Indicators {TradingView}  (Read 110 times)
Husires (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 1284



View Profile WWW
July 18, 2021, 06:18:02 PM
Merited by Symmetrick (5), Wind_FURY (1), rhomelmabini (1), OcTradism (1)
 #1

Table of contents

      1. What is TradingView?
      2. How Does TradingView Work?
      3. What is Pine Script?
      4. The Pine Editor
      5. “study” vs “strategy”
      6. Plotting (RSI) indicator

What is TradingView?

TradingView is cloud-based go-to charting and social-networking platform for both beginner and advanced active investment traders for tracking movements in the Forex, traditional stock markets and cryptocurrency.

TradingView have some features:

  • HTML5 Charts
  • Server-Side Alerts
  • Trading
  • Social Community of Active Traders
  • publish trading ideas within its social network


How Does TradingView Work?

When you log-in for a free account, you'll have access to the TradingView community and basic features.
You get one chart per layout and one alert with three indicators to use on one device.

we will work on free account and when you need to add more charts you can buy Pro/Pro+ and Premium account.


What is Pine Script?


Pine Script is a scripting language that can be used to control and edit your TradingView charts.It allows users to create custom indicators and run them on our servers.
each script uses computational resources in the cloud, some limits must be imposed in order to share these resources between users.

we will use BTCUSDT trading pair. you can find it  https://www.tradingview.com/symbols/BTCUSDT/

click on full-featured chart button and down for Pine Editor



The Pine Editor

we will write some codes and then click on click on Add to Chart to see our annotations.


study("First Script")  just setting up our annotation which have a new name (First Script in our case)
plot() gives us a line chart
overlay=true adds the indicator to the existing chart
now you can use some of TA indicators as moving averages, simple moving average (SMA), exponential moving average (EMA)


Code:
plotcandle(sma(open, 7))
EMA = (Close - Previous Day’s EMA) * Multiplier - Previous Day’s EMA
Multiplier = 2 / (Length of EMA + 1)


Example of a Pine script
Code:
//@version=4
study("MACD")
fast = 12, slow = 26
fastMA = ema(close, fast)
slowMA = ema(close, slow)
macd = fastMA - slowMA
signal = sma(macd, 9)
plot(macd, color=color.blue)
plot(signal, color=color.orange)

Source: https://www.tradingview.com/pine-script-docs/en/v4/Quickstart_guide.html


“study” vs “strategy”

Pine strategies: used to run backtests and normal script calculations, they also contain strategy.*() calls to send buy and sell orders. see https://www.tradingview.com/pine-script-docs/en/v4/essential/Strategies.html

Pine studies: cannot be used in backtesting. Because they do not make use of the broker emulator, they use less resources and will run faster.

Code:
study(title="New Script", overlay=true)
emaLength = input(title="EMA Length", type=input.integer, defval=20, minval=0)
emaVal = ema(close, emaLength)


Plotting (RSI) indicator

Click on New > RSI Strategy


Code:
//@version=4
strategy("ToDaMoon", overlay=true)
enter = input(11000)
exit = input(11300)
price = close

if (price <= enter)
    strategy.entry("BuyTheDip", strategy.long, comment="BuyTheDip")
if (price >= exit)
    strategy.close_all(comment="SellTheNews")


you can change entry and exit variables

this the basic codes and you can change it or build your own code



Sources

Code:
https://investorjunkie.com/reviews/tradingview/
https://www.tradingview.com/pine-script-docs/en/v4/Introduction.html
https://academy.binance.com/en/articles/how-to-create-ta-indicators-on-tradingview

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
1714607806
Hero Member
*
Offline Offline

Posts: 1714607806

View Profile Personal Message (Offline)

Ignore
1714607806
Reply with quote  #2

1714607806
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714607806
Hero Member
*
Offline Offline

Posts: 1714607806

View Profile Personal Message (Offline)

Ignore
1714607806
Reply with quote  #2

1714607806
Report to moderator
1714607806
Hero Member
*
Offline Offline

Posts: 1714607806

View Profile Personal Message (Offline)

Ignore
1714607806
Reply with quote  #2

1714607806
Report to moderator
Wind_FURY
Legendary
*
Offline Offline

Activity: 2898
Merit: 1824



View Profile
July 20, 2021, 06:36:37 AM
 #2

Good job, OP. Discovering TradingView, learning Pine Script, and back-testing were what I missed during my newbie years in trading. Cryptocurrencies was my first time to be exposed in investing/trading. If I discovered TradingView from the first day, I would have learned more and might not have lost my initial investment. BUT, I would not have discovered HODL-type + DCA investing too. Cool

██████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
██████████████████████
.SHUFFLE.COM..███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
█████████████████████
████████████████████
██████████████████████
████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
██████████████████████
██████████████████████
██████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
███████████████████████
.
...Next Generation Crypto Casino...
OcTradism
Hero Member
*****
Offline Offline

Activity: 1722
Merit: 801



View Profile WWW
July 20, 2021, 09:21:42 AM
 #3

When Trading view launched that feature about 3 years ago, it was highly accepted by communities. Not all people who join the market knows coding but that feature brings more advantages to coders.

People who are not coders, can buy good scripts to use. There are free scripts but there are paid scripts and if scripts are good, can bring profits for your trading, it's worth to be paid.

.
.Duelbits.
█▀▀▀▀▀











█▄▄▄▄▄
TRY OUR
  NEW  UNIQUE
GAMES!
.
..DICE...
███████████████████████████████
███▀▀                     ▀▀███
███    ▄▄▄▄         ▄▄▄▄    ███
███   ██████       ██████   ███
███   ▀████▀       ▀████▀   ███
███                         ███
███                         ███
███                         ███
███   ▄████▄       ▄████▄   ███
███   ██████       ██████   ███
███    ▀▀▀▀         ▀▀▀▀    ███
███▄▄                     ▄▄███
███████████████████████████████
.
.MINES.
███████████████████████████████
████████████████████████▄▀▄████
██████████████▀▄▄▄▀█████▄▀▄████
████████████▀ █████▄▀████ █████
██████████      █████▄▀▀▄██████
███████▀          ▀████████████
█████▀              ▀██████████
█████                ██████████
████▌                ▐█████████
█████                ██████████
██████▄            ▄███████████
████████▄▄      ▄▄█████████████
███████████████████████████████
.
.PLINKO.
███████████████████████████████
█████████▀▀▀       ▀▀▀█████████
██████▀  ▄▄███ ███      ▀██████
█████  ▄▀▀                █████
████  ▀                    ████
███                         ███
███                         ███
███                         ███
████                       ████
█████                     █████
██████▄                 ▄██████
█████████▄▄▄       ▄▄▄█████████
███████████████████████████████
10,000x
MULTIPLIER
NEARLY UP TO
.50%. REWARDS
▀▀▀▀▀█











▄▄▄▄▄█
Bitcoin_Arena
Copper Member
Legendary
*
Offline Offline

Activity: 2016
Merit: 1786


฿itcoin for all, All for ฿itcoin.


View Profile
July 22, 2021, 02:28:54 AM
 #4

I have been seeing the pine editor on tradingview but I wasn't sure how it works and I don't know any of those programming languages which brings me to a couple of questions.

1. What does it take to learn pine scripting language? Any other Knowledge requirements one needs like knowing Java script, Python etc?
2. How long can it take for one to learn pine script language?

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Zilon
Sr. Member
****
Offline Offline

Activity: 966
Merit: 421

Bitcoindata.science


View Profile WWW
July 24, 2021, 08:24:31 AM
 #5

Back testing has helped me a couple of times in making my trading decision. But for pine script I haven't used it before I only make use of the readily available indicators on my trading view mostly CCI and William's percentage. But with a job well done @Op I think giving pine script a trial would add more color and experience to my trading platform.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!