willco indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #260562 quote
    babatunde99babatunde99
    Participant
    New

    Hi everyone, Does anyone have the willco indicator for prorealtime?Hi everyone, Does anyone have the willco indicator for prorealtime?

    #260563 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I couldn’t find it in the library.

    Searching the web I found out that it requires multiple instruments and some data not available, for its calculations.

    Anyway, if anyone has some good news, please let us know.


    #260564 quote
    JSJS
    Participant
    Master

    The Williams Commercial Index is available on TradingView:

    https://in.tradingview.com/script/KKBYQPCZ-William-s-Commercial-Index/

    It is also discussed in this ProRealTime forum topic:

    https://www.prorealcode.com/topic/commoditer-of-trader-cot/#post-90159

    study("William's Commercial Index", shorttitle="WILLCO", precision=2)
    force_root = input("", title="Override Product")
    is_includeoptions = input(false, type=bool, title="Include Options")
    
    
    fxroot =
    	  ticker == "USDCAD" ? "CD" : 
    	  ticker == "USDCHF" ? "SF" : 
    	  ticker == "USDCZK" ? "CZ" : 
    	  ticker == "USDHUF" ? "FR" : 
    	  ticker == "USDILS" ? "IS" : 
    	  ticker == "USDJPY" ? "JY" : 
    	  ticker == "USDMXN" ? "MP" : 
    	  ticker == "USDNOK" ? "UN" : 
    	  ticker == "USDPLN" ? "PZ" : 
    	  ticker == "USDRUB" ? "RU" : 
    	  ticker == "USDSEK" ? "SE" : 
    	  ticker == "USDZAR" ? "RA" : 
    	  ticker == "EURUSD" ? "EC" : 
    	  ticker == "AUDUSD" ? "AD" : 
    	  ticker == "GBPUSD" ? "BP" : 
    	  ticker == "NZDUSD" ? "NE" : 
    	  ticker == "BRLUSD" ? "BR" : 
    	  ""
    root = force_root == "" ? fxroot == "" ? syminfo.root : fxroot : force_root
    code = root + (is_includeoptions ? "_FO_L_ALL" : "_F_L_ALL")
    
    
    is_inversed = 
    	  ticker == "USDCAD" ? true : 
    	  ticker == "USDCHF" ? true : 
    	  ticker == "USDCZK" ? true : 
    	  ticker == "USDHUF" ? true : 
    	  ticker == "USDILS" ? true : 
    	  ticker == "USDJPY" ? true : 
    	  ticker == "USDMXN" ? true : 
    	  ticker == "USDNOK" ? true : 
    	  ticker == "USDPLN" ? true : 
    	  ticker == "USDRUB" ? true : 
    	  ticker == "USDSEK" ? true : 
    	  ticker == "USDZAR" ? true : 
    	  false
    
    
    long_total = security("QUANDL:CFTC/"+code+"|4", "D", close)
    short_total = close
    oi = security("QUANDL:CFTC/"+code+"|0", "D", close)
    
    
    long = is_inversed ? short_total : long_total
    short = is_inversed ? long_total : short_total
    net = long-short
    willco = net / oi
    
    
    length = input(24, title="Period (weeks)")
    
    
    max = highest(willco, length)
    min = lowest(willco, length)
    index = 100 * (willco - min) / (max - min)
    
    
    index_adopted = security("QUANDL:CFTC/"+code+"|5", "D", index)
    
    
    plot(index_adopted, color = black, title="Index", style=line)
    hline(80, color=blue, linestyle=dashed)
    hline(20, color=blue, linestyle=dashed)
    
    babatunde99 and robertogozzi thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

willco indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by JSJS
4 months, 4 weeks ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/25/2026
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...