Ask Your Question
3

How can an indicator be created on Tradingview that displays the price of the same symbol from different periods?

asked 2021-10-25 11:00:00 +0000

scrum gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-07-27 23:00:00 +0000

david gravatar image

To create an indicator on TradingView that displays the price of the same symbol from different periods, you can follow these steps:

  1. Open TradingView and click on "New Indicator" from the top toolbar.

  2. Choose "Pine Editor" from the drop-down menu.

  3. In the Pine Editor, define the inputs for the indicator, such as the time periods you want to compare.

  4. Use the security() function to fetch the price data for the same symbol from different time periods. For example, if you want to compare the current price with the price from 1 week ago, you can use the following code:

price1 = security(syminfo.tickerid, "1W", close)
  1. Repeat the security() function for the other time periods you want to compare.

  2. Use the plot() function to display the price data on the chart.

  3. Format the indicator according to your preference by changing the line color, width, etc.

  4. Save the indicator and use it on your TradingView chart.

Note that creating an indicator that compares the same symbol from different time periods requires some basic knowledge of Pine Script. If you're new to the language, you may want to start with some of TradingView's tutorials or documentation.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-10-25 11:00:00 +0000

Seen: 7 times

Last updated: Jul 27 '21