GDP Breakdown
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EsIstTurnt

//@version=5
indicator("GDP Breakdown",overlay=false,shorttitle='GDPB')
//Not every country provides all data needed, only countries providing data for all sub sections below are able to be selected below.
local=input.string('US',title='Select Country',options=['AM','AR','AZ','BD','BH','BN','BR','BT','BY','CA','CR','CV','EC','GE','GH','GN','JM','JO','JP','KE','KH','KZ','LA','LK','LS','MA','MW','MX','MZ','NA','NG','NL','NP','NZ','OM','PE','PH','PS','QA','SE','SV','TW','UA','US','VN','XK'])
var string agr= local+"GDPA  "
var string con= local+"GDPC  "
var string ser= local+"GDPS  "
var string pub= local+"GDPPA "
var string min= local+"GDPMIN"
var string uti= local+"GDPU  "
var string man= local+"GDPMAN"
var string gdp= local+"GDP   "
total=input.bool(false,'Show Total GDP')

agriculture  =request.security(agr,'M',close)
construction =request.security(con,'M',close)
manufacturing=request.security(man,'M',close)
mining       =request.security(min,'M',close)
publicadmin  =request.security(pub,'M',close)
services     =request.security(ser,'M',close)
utilities    =request.security(uti,'M',close)


combined     =total?request.security(gdp,'M',close):na
plot(agriculture  ,color=color.green  ,title='Agriculture           ',linewidth=1)
plot(construction ,color=color.orange ,title='Construction          ',linewidth=1)
plot(manufacturing,color=color.blue   ,title='Manufacturing         ',linewidth=1) 
plot(mining       ,color=color.gray   ,title='Mining                ',linewidth=1)
plot(publicadmin  ,color=color.fuchsia,title='Public Administration ',linewidth=1)
plot(services     ,color=color.red    ,title='Services              ',linewidth=1)
plot(utilities    ,color=color.yellow ,title='Utilities             ',linewidth=1)

plot(combined     ,color=color.white  ,title='Total                 ',linewidth=2)