How do I plot a new series of candles based on script calculations?

To plot a new series of bars or candles, where OHLC values are based on your calculations, use plotcandle() or plotbar() functions. After adding them to the chart, a script with such functions will plot a series of bars or a series of candles with specified parameters. For example, this script will plot a series of red and green candles with OHLC values twice as much, when compared to values of the main series. 

//@version=3
study("My Script")
plotcandle(open*2, high*2, low*2, close*2, title='Title', color = open < close ? green : red, wickcolor=black)
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out