简体   繁体   中英

Pinescript: How can one plot two different symbols in one script, without them being too far away from each other?

I would like to plot two different symbols from Pinescript on the Chart. Let's take DXY and SPX as example. The problem is, that both have very different values with DXY at 112 and SPX at 3800. That leads to the issue of them being plotted far away from each other, because Pine automatically only uses one Scale for both.

Is there a way to fix that?

Even if the two symbols are far from each other, you can always adjust the chart scaling manually. https://best-trading-indicator.com/pages/how-to-install-a-custom-indicator-on-tradingview#menu-scaling-issues

To answer your question more in-depth, I'm not aware of a way to scale via script two assets with such a difference in price with Pinescript only and with 1 script only.

The indicator() function may use the scale parameter: https://www.tradingview.com/pine-script-reference/v5/#fun_indicator

Maybe, your solution would be to do what you want with 2 scripts instead of 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM