PipFoundry

Pip Foundry - Auto Switching Fx Fut Volume

387 3 59
My premium indicators are available for monthly lease at http://www.tradingview.com/market/ah-pipfoundry/

I previously published a simple volume script that allowed you to manually apply a different security to the one you are charting as the volume plot. However, this script will automatically apply the correct volume data to whatever forex pair you are viewing without requiring a manual setting.
Remove from Favorite Scripts Add to Favorite Scripts
//Pip Foundry - Forex Market Volume from IDC
//v2 - Added Auto Switching
study(title="Pip Foundry - Auto Switching Fx Fut Volume", shorttitle="Pip Foundry - Fx Fut Volume", precision=0)

showMA = input(true)
SecInput =
	  ticker == "EURUSD" ? "FX_IDC:EURUSD" : 
	  ticker == "AUDCAD" ? "FX_IDC:AUDCAD" : 
	  ticker == "AUDCHF" ? "FX_IDC:AUDCHF" : 
	  ticker == "AUDJPY" ? "FX_IDC:AUDJPY" : 
	  ticker == "AUDNZD" ? "FX_IDC:AUDNZD" : 
	  ticker == "CADCHF" ? "FX_IDC:CADCHF" : 
	  ticker == "EURAUD" ? "FX_IDC:EURAUD" : 
	  ticker == "EURCAD" ? "FX_IDC:EURCAD" : 
	  ticker == "EURCHF" ? "FX_IDC:EURCHF" : 
	  ticker == "EURGBP" ? "FX_IDC:EURGBP" : 
	  ticker == "EURJPY" ? "FX_IDC:EURJPY" : 
	  ticker == "EURNOK" ? "FX_IDC:EURNOK" : 
	  ticker == "EURNZD" ? "FX_IDC:EURNZD" : 
	  ticker == "EURSEK" ? "FX_IDC:EURSEK" : 
	  ticker == "EURTRY" ? "FX_IDC:EURTRY" : 
	  ticker == "GBPAUD" ? "FX_IDC:GBPAUD" : 
	  ticker == "GBPCAD" ? "FX_IDC:GBPCAD" : 
	  ticker == "GBPUSD" ? "FX_IDC:GBPUSD" : 
	  ticker == "NZDCAD" ? "FX_IDC:NZDCAD" : 
	  ticker == "NZDCHF" ? "FX_IDC:NZDCHF" : 
	  ticker == "NZDJPY" ? "FX_IDC:NZDJPY" : 
	  ticker == "NZDUSD" ? "FX_IDC:NZDUSD" : 
	  ticker == "TRYJPY" ? "FX_IDC:TRYJPY" : 
	  ticker == "USDAED" ? "FX_IDC:USDAED" :
	  ticker == "USDAFN" ? "FX_IDC:USDAFN" :
	  ticker == "USDALL" ? "FX_IDC:USDALL" :
	  ticker == "USDAMD" ? "FX_IDC:USDAMD" :
	  ticker == "USDANG" ? "FX_IDC:USDANG" :
	  ticker == "USDAOA" ? "FX_IDC:USDAOA" :
	  ticker == "USDARS" ? "FX_IDC:USDARS" :
	  ticker == "USDAUD" ? "FX_IDC:USDAUD" :
	  ticker == "USDAWG" ? "FX_IDC:USDAWG" :
	  ticker == "USDAZN" ? "FX_IDC:USDAZN" :
	  ticker == "USDBBD" ? "FX_IDC:USDBBD" :
	  ticker == "USDBDT" ? "FX_IDC:USDBDT" :
	  ticker == "USDBGN" ? "FX_IDC:USDBGN" :
	  ticker == "USDBHD" ? "FX_IDC:USDBHD" :
	  ticker == "USDBIF" ? "FX_IDC:USDBIF" :
	  ticker == "USDBMD" ? "FX_IDC:USDBMD" :
	  ticker == "USDBND" ? "FX_IDC:USDBND" :
	  ticker == "USDBOB" ? "FX_IDC:USDBOB" :
	  ticker == "USDBRL" ? "FX_IDC:USDBRL" :
	  ticker == "USDBSD" ? "FX_IDC:USDBSD" :
	  ticker == "USDBTN" ? "FX_IDC:USDBTN" :
	  ticker == "USDBWP" ? "FX_IDC:USDBWP" :
	  ticker == "USDBYR" ? "FX_IDC:USDBYR" :
	  ticker == "USDBZD" ? "FX_IDC:USDBZD" :
	  ticker == "USDCAD" ? "FX_IDC:USDCAD" :
	  ticker == "USDCAX" ? "FX_IDC:USDCAX" :
	  ticker == "USDCDF" ? "FX_IDC:USDCDF" :
	  ticker == "USDCHF" ? "FX_IDC:USDCHF" :
	  ticker == "USDCLF" ? "FX_IDC:USDCLF" :
	  ticker == "USDCLP" ? "FX_IDC:USDCLP" :
	  ticker == "USDCNY" ? "FX_IDC:USDCNY" :
	  ticker == "USDCOP" ? "FX_IDC:USDCOP" :
	  ticker == "USDCRC" ? "FX_IDC:USDCRC" :
	  ticker == "USDCUP" ? "FX_IDC:USDCUP" :
	  ticker == "USDCVE" ? "FX_IDC:USDCVE" :
	  ticker == "USDCZK" ? "FX_IDC:USDCZK" :
	  ticker == "USDDJF" ? "FX_IDC:USDDJF" :
	  ticker == "USDDKK" ? "FX_IDC:USDDKK" :
	  ticker == "USDDOP" ? "FX_IDC:USDDOP" :
	  ticker == "USDDZD" ? "FX_IDC:USDDZD" :
	  ticker == "USDEGP" ? "FX_IDC:USDEGP" :
	  ticker == "USDERN" ? "FX_IDC:USDERN" :
	  ticker == "USDETB" ? "FX_IDC:USDETB" :
	  ticker == "USDEUR" ? "FX_IDC:USDEUR" :
	  ticker == "USDFJD" ? "FX_IDC:USDFJD" :
	  ticker == "USDFKP" ? "FX_IDC:USDFKP" :
	  ticker == "USDGBP" ? "FX_IDC:USDGBP" :
	  ticker == "USDGEL" ? "FX_IDC:USDGEL" :
	  ticker == "USDGHS" ? "FX_IDC:USDGHS" :
	  ticker == "USDGIP" ? "FX_IDC:USDGIP" :
	  ticker == "USDGMD" ? "FX_IDC:USDGMD" :
	  ticker == "USDGNF" ? "FX_IDC:USDGNF" :
	  ticker == "USDGTQ" ? "FX_IDC:USDGTQ" :
	  ticker == "USDGYD" ? "FX_IDC:USDGYD" :
	  ticker == "USDHKD" ? "FX_IDC:USDHKD" :
	  ticker == "USDHNL" ? "FX_IDC:USDHNL" :
	  ticker == "USDHRK" ? "FX_IDC:USDHRK" :
	  ticker == "USDHTG" ? "FX_IDC:USDHTG" :
	  ticker == "USDHUF" ? "FX_IDC:USDHUF" :
	  ticker == "USDIDR" ? "FX_IDC:USDIDR" :
	  ticker == "USDILS" ? "FX_IDC:USDILS" :
	  ticker == "USDINR" ? "FX_IDC:USDINR" :
	  ticker == "USDIQD" ? "FX_IDC:USDIQD" :
	  ticker == "USDIRR" ? "FX_IDC:USDIRR" :
	  ticker == "USDISK" ? "FX_IDC:USDISK" :
	  ticker == "USDJMD" ? "FX_IDC:USDJMD" :
	  ticker == "USDJOD" ? "FX_IDC:USDJOD" :
	  ticker == "USDJPY" ? "FX_IDC:USDJPY" :
	  ticker == "USDKES" ? "FX_IDC:USDKES" :
	  ticker == "USDKGS" ? "FX_IDC:USDKGS" :
	  ticker == "USDKHR" ? "FX_IDC:USDKHR" :
	  ticker == "USDKMF" ? "FX_IDC:USDKMF" :
	  ticker == "USDKPW" ? "FX_IDC:USDKPW" :
	  ticker == "USDKRW" ? "FX_IDC:USDKRW" :
	  ticker == "USDKWD" ? "FX_IDC:USDKWD" :
	  ticker == "USDKYD" ? "FX_IDC:USDKYD" :
	  ticker == "USDKZT" ? "FX_IDC:USDKZT" :
	  ticker == "USDLAK" ? "FX_IDC:USDLAK" :
	  ticker == "USDLBP" ? "FX_IDC:USDLBP" :
	  ticker == "USDLKR" ? "FX_IDC:USDLKR" :
	  ticker == "USDLRD" ? "FX_IDC:USDLRD" :
	  ticker == "USDLSL" ? "FX_IDC:USDLSL" :
	  ticker == "USDLTL" ? "FX_IDC:USDLTL" :
	  ticker == "USDLVL" ? "FX_IDC:USDLVL" :
	  ticker == "USDLYD" ? "FX_IDC:USDLYD" :
	  ticker == "USDMAD" ? "FX_IDC:USDMAD" :
	  ticker == "USDMDL" ? "FX_IDC:USDMDL" :
	  ticker == "USDMGA" ? "FX_IDC:USDMGA" :
	  ticker == "USDMKD" ? "FX_IDC:USDMKD" :
	  ticker == "USDMMK" ? "FX_IDC:USDMMK" :
	  ticker == "USDMNT" ? "FX_IDC:USDMNT" :
	  ticker == "USDMOP" ? "FX_IDC:USDMOP" :
	  ticker == "USDMRO" ? "FX_IDC:USDMRO" :
	  ticker == "USDMUR" ? "FX_IDC:USDMUR" :
	  ticker == "USDMVR" ? "FX_IDC:USDMVR" :
	  ticker == "USDMWK" ? "FX_IDC:USDMWK" :
	  ticker == "USDMXN" ? "FX_IDC:USDMXN" :
	  ticker == "USDMXV" ? "FX_IDC:USDMXV" :
	  ticker == "USDMYR" ? "FX_IDC:USDMYR" :
	  ticker == "USDMZN" ? "FX_IDC:USDMZN" :
	  ticker == "USDNAD" ? "FX_IDC:USDNAD" :
	  ticker == "USDNGN" ? "FX_IDC:USDNGN" :
	  ticker == "USDNIO" ? "FX_IDC:USDNIO" :
	  ticker == "USDNOK" ? "FX_IDC:USDNOK" :
	  ticker == "USDNPR" ? "FX_IDC:USDNPR" :
	  ticker == "USDNZD" ? "FX_IDC:USDNZD" :
	  ticker == "USDOMR" ? "FX_IDC:USDOMR" :
	  ticker == "USDPAB" ? "FX_IDC:USDPAB" :
	  ticker == "USDPEN" ? "FX_IDC:USDPEN" :
	  ticker == "USDPGK" ? "FX_IDC:USDPGK" :
	  ticker == "USDPHP" ? "FX_IDC:USDPHP" :
	  ticker == "USDPKR" ? "FX_IDC:USDPKR" :
	  ticker == "USDPLN" ? "FX_IDC:USDPLN" :
	  ticker == "USDPLX" ? "FX_IDC:USDPLX" :
	  ticker == "USDPYG" ? "FX_IDC:USDPYG" :
	  ticker == "USDQAR" ? "FX_IDC:USDQAR" :
	  ticker == "USDRON" ? "FX_IDC:USDRON" :
	  ticker == "USDRSD" ? "FX_IDC:USDRSD" :
	  ticker == "USDRUB" ? "FX_IDC:USDRUB" :
	  ticker == "USDRWF" ? "FX_IDC:USDRWF" :
	  ticker == "USDSAR" ? "FX_IDC:USDSAR" :
	  ticker == "USDSBD" ? "FX_IDC:USDSBD" :
	  ticker == "USDSCR" ? "FX_IDC:USDSCR" :
	  ticker == "USDSDG" ? "FX_IDC:USDSDG" :
	  ticker == "USDSEK" ? "FX_IDC:USDSEK" :
	  ticker == "USDSGD" ? "FX_IDC:USDSGD" :
	  ticker == "USDSHP" ? "FX_IDC:USDSHP" :
	  ticker == "USDSLL" ? "FX_IDC:USDSLL" :
	  ticker == "USDSOS" ? "FX_IDC:USDSOS" :
	  ticker == "USDSRD" ? "FX_IDC:USDSRD" :
	  ticker == "USDSTD" ? "FX_IDC:USDSTD" :
	  ticker == "USDSVC" ? "FX_IDC:USDSVC" :
	  ticker == "USDSYP" ? "FX_IDC:USDSYP" :
	  ticker == "USDSZL" ? "FX_IDC:USDSZL" :
	  ticker == "USDTHB" ? "FX_IDC:USDTHB" :
	  ticker == "USDTJS" ? "FX_IDC:USDTJS" :
	  ticker == "USDTMT" ? "FX_IDC:USDTMT" :
	  ticker == "USDTND" ? "FX_IDC:USDTND" :
	  ticker == "USDTOP" ? "FX_IDC:USDTOP" :
	  ticker == "USDTRY" ? "FX_IDC:USDTRY" :
	  ticker == "USDTTD" ? "FX_IDC:USDTTD" :
	  ticker == "USDTWD" ? "FX_IDC:USDTWD" :
	  ticker == "USDTZS" ? "FX_IDC:USDTZS" :
	  ticker == "USDUAH" ? "FX_IDC:USDUAH" :
	  ticker == "USDUGX" ? "FX_IDC:USDUGX" :
	  ticker == "USDUYU" ? "FX_IDC:USDUYU" :
	  ticker == "USDUZS" ? "FX_IDC:USDUZS" :
	  ticker == "USDVEF" ? "FX_IDC:USDVEF" :
	  ticker == "USDVND" ? "FX_IDC:USDVND" :
	  ticker == "USDVUV" ? "FX_IDC:USDVUV" :
	  ticker == "USDWST" ? "FX_IDC:USDWST" :
	  ticker == "USDXAF" ? "FX_IDC:USDXAF" :
	  ticker == "USDXCD" ? "FX_IDC:USDXCD" :
	  ticker == "USDXCU" ? "FX_IDC:USDXCU" :
	  ticker == "USDXDR" ? "FX_IDC:USDXDR" :
	  ticker == "USDXOF" ? "FX_IDC:USDXOF" :
	  ticker == "USDXPF" ? "FX_IDC:USDXPF" :
	  ticker == "USDYER" ? "FX_IDC:USDYER" :
	  ticker == "USDZAR" ? "FX_IDC:USDZAR" :
	  ticker == "USDZWL" ? "FX_IDC:USDZWL" :
	  ticker == "ZARJPY" ? "FX_IDC:ZARJPY" :
	  ""
	  
VolSrc = security(SecInput, period, volume, false)
plot(VolSrc, color = open > close ? red : green, style=columns, title="Volume", transp=65)
plot(showMA ? sma(VolSrc, 20) : na, style=area, color=blue, title="Volume MA", transp=85)

Related Ideas

Beautiful! Thanks a lot.
+1 Reply
This is fantastic! Thankyou so much!!!
+1 Reply
DangerousSpread DangerousSpread
a year ago
This script is still amazing, but i'm having some trouble on a TF above 1d.
snapshot
is what im seeing. Is there anyway we can fix this? I'm no coder, but looking at the script, I don't see any reason for this to be happening. It appears to happen on all forex pairs i've tested it on.... Oddly enough I slapped CrudeOil into the script, and that does NOT have this problem. THANKS PIP! Awesome script, one that ill be using for.....ever :P
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out