0
votes

I cannot find any document in TradingView, can any one help me out this problem:

I have Trend1 indicator from 3rd-party script, it has Buy and Sell data series:

enter image description here

And I wanna read Trend1 data on H1 and M15 timeframe like:

//@version=4
study("SupertrendSignal", overlay = true)

trend1_H1 = input(trend_1_result_on_H1, title="Trend1 on H1")
trend1_M15 = input(trend_1_result_on_M15, title="Trend1 on M15")

if (trend1_H1 is buy) and (trend1_M15 is buy)
then plot(1)
else plot(0)   

But I cannot find any guide to do this.

My big problem is I'm new to Pinescript and:

  • I don't know how to get data from SuperTrend custom indicator above
  • I don't know how to get H1 and M15 data at the same time from indicator
  • Is there anyway to debug the data better than plot it on the chart?, cause I'm familiar with the breakpoint in other languages, I don't know how to see its data structure.
1
Welcome to Pine! This is the best place to start your journey: pinecoders.com . For your question, search the Public Library for MTF SuperTrend scripts: tradingview.com/scripts/search/supertrend%20mtf - PineCoders-LucF
Many thanks, this helps me resolve first 2 problems - Neo.Mxn0

1 Answers

0
votes

You must use the security() function. Here is an example

//@version=4
study("Example security 1", overlay=true)
ibm_15 = security("NYSE:IBM", "15", close)
plot(ibm_15)