Conversion r_COT (Commitment of Traders) de tradingview

Forums ProRealTime forum Français Support ProBuilder Conversion r_COT (Commitment of Traders) de tradingview

Viewing 2 posts - 1 through 2 (of 2 total)
  • #231499

    Bonsoir,
    Je ne le trouve pas chez nous, pouvez-vous le convertir SVP? Merci, cordialement.
    Bertrand.
    https://fr.tradingview.com/script/80mtI2rs-r-COT-Commitment-of-Traders/
    study(“COT”, shorttitle=”COT”, precision=0)
    force_root = input(“”, title=”Override Product”)
    is_includeoptions = input(false, type=bool, title=”Include Options”)

    fxroot =
    ticker == “USDCAD” ? “090741” :
    ticker == “CADUSD” ? “090741” :
    ticker == “A61!” ? “090741” :
    ticker == “USDCHF” ? “092741” :
    ticker == “USDCZK” ? “CZ” :
    ticker == “USDHUF” ? “FR” :
    ticker == “USDILS” ? “IS” :
    ticker == “USDJPY” ? “097741” :
    ticker == “USDMXN” ? “MP” :
    ticker == “USDNOK” ? “UN” :
    ticker == “USDPLN” ? “PZ” :
    ticker == “USDRUB” ? “RU” :
    ticker == “USDSEK” ? “SE” :
    ticker == “USDZAR” ? “RA” :
    ticker == “EURUSD” ? “099741” :
    ticker == “E61!” ? “099741” :
    ticker == “AUDUSD” ? “232741” :
    ticker == “A61!” ? “232741” :
    ticker == “GBPUSD” ? “096742” :
    ticker == “B61!” ? “096742” :
    ticker == “NZDUSD” ? “112741” :
    ticker == “BRLUSD” ? “BR” :
    ticker == “USOIL” ? “067651” :
    ticker == “CL1!” ? “067651” :
    ticker == “US30” ? “020601” :
    ticker == “ZB1!” ? “020601” :
    ticker == “RB1!” ? “111659” :
    ticker == “GC1!” ? “088691” :
    ticker == “XAUUSD” ? “088691” :
    ticker == “GC1!” ? “088691” :
    ticker == “XAGUSD” ? “084691” :
    ticker == “SI1!” ? “084691” :
    ticker == “SOYBNUSD” ? “005602” :
    ticker == “S1!” ? “005602” :
    ticker == “ES1!” ? “13874A” :
    ticker == “SPX” ? “13874A” :
    ticker == “FF1!” ? “045601” :
    ticker == “ZN1!” ? “043602” :
    ticker == “ZT1!” ? “042601” :
    ticker == “ZF1!” ? “044601” :
    “”
    root = force_root == “” ? fxroot == “” ? syminfo.root : fxroot : force_root
    codeCms = root + (is_includeoptions ? “_FO_L_ALL” : “_F_L_ALL”)
    codels = root + (is_includeoptions ? “_FO” : “_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_cms = security(“QUANDL:CFTC/”+codeCms+”|4”, “D”, close)
    short_total_cms = security(“QUANDL:CFTC/”+codeCms+”|5”, “D”, close)

    long_LargeSpecs = security(“QUANDL:CFTC/”+codels+”|1”, “D”, close)
    short_LargeSpecs = security(“QUANDL:CFTC/”+codels+”|2”, “D”, close)

    long_cms = is_inversed ? short_total_cms : long_total_cms
    short_cms = is_inversed ? long_total_cms : short_total_cms
    longls = is_inversed ? short_LargeSpecs : long_LargeSpecs
    shortls = is_inversed ? long_LargeSpecs : short_LargeSpecs

    //spread = security(“QUANDL:CFTC/”+codels+”|3”, “D”, close)
    //istue=dayofweek==monday ? green : na
    //bgcolor(istue, transp=90)

    //plot(long_cms, color = blue, title=”Long Comms”,linewidth=2)
    //plot(short_cms, color = orange, title=”Short Comms”,linewidth=2)
    plot(long_cms-short_cms, color = red, title=”Commercials”, style=line,linewidth=3,transp=0)
    hline(0, color=orange, linestyle=dotted,linewidth=2)

    //plot(longls, color = blue, title=”Long Large Specs”)
    //plot(shortls, color = orange, title=”Short Large Specs”)
    plot(longls-shortls, color = green, title=”Large Speculators”, style=line,linewidth=3,transp=0)
    //plot(spread, color = purple, title=”Spread”, style=area)
    //bgcolor(((long_cms[1]-short_cms[1]) <=0) and ((long_cms-short_cms) > 0), transp=40,color=yellow)

    #231517

    Bonjour, il n'est malheureusement pas possible de traduire ce code car PRT ne peut actuellement pas obtenir d'informations à partir d'autres actifs.

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login