MCDX INDICATOR

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #234954 quote
    jcljcl
    Participant
    Junior

    Buenos días:

    ¿Sería posible traducir este código de tradingview a prorealtime?

    Basado en múltiples RSI, buscamos detectar el impulso del comprador y del vendedor en función del precio y el volumen.

    Este indicador ayuda a detectar actividades de compradores fuertes (manos fuertes – ballenas)

    Gracias

    CSS:

    #// © Mango2Juice

    #// MCDX is an indicator based on mutilple relative strength index (RSI) with different period, then classify into 3 categories – Retailer, Hot Money and Banker

    #// Green – Retailer

    #// Yellow – Hot money

    #// Red – Banker

    #// the higher and many reds are more preferable

    # study(“[M2J] Indicator | MCDX”, “MCDX”)

    # Converted by Sam4Cok@Samer800 – 11/2022

    declare lower;

    input RSIBaseBanker = 50; # “Banker Base”, minval = 10)

    input RSIPeriodBanker = 50; # “Banker RSI Period”, minval = 10)

    input RSIBaseHotMoney = 30; # “Hot Money RSI Base”, minval = 10)

    input RSIPeriodHotMoney = 40; # “Hot Money RSI Period”, minval = 10)

    input SensitivityBanker = 1.5;# “Sensitivity Banker”, minval = 0.1, step = 0.1)

    input SensitivityHotMoney = 0.7;# “Sensitivity Hot Money”, minval = 0.1, step = 0.1)

    def na = Double.NaN;

    #rsi_function(sensitivity, rsiPeriod, rsiBase) =>

    script rsi_function {

    input sensitivity = 0;

    input rsiPeriod = 14;

    input rsiBase = 0;

    def rsi = sensitivity * (rsi(Length=rsiPeriod) – rsiBase);

    def nRSI;

    if rsi > 20 {

    nrsi = 20;

    } else {

    if rsi < 0 {

    nrsi = 0;

    } else {

    nrsi = rsi;

    }}

    plot result = nrsi;

    }

    def rsi_Banker = rsi_function(SensitivityBanker, RSIPeriodBanker, RSIBaseBanker);

    def rsi_HotMoney = rsi_function(SensitivityHotMoney, RSIPeriodHotMoney, RSIBaseHotMoney);

    plot “5” = if(isNaN(close),na,5);#, “5” , color.silver, 2, editable = false)

    “5”.SetDefaultColor(Color.GRAY);

    “5”.SetLineWeight(2);

    plot “10” = if(isNaN(close),na,10);#, “10”, color.fuchsia, 2, editable = false)

    “10”.SetDefaultColor(Color.MAGENTA);

    “10”.SetLineWeight(2);

    plot “15” = if(isNaN(close),na,15);#, “15”, color.silver, 2, editable = false)

    “15”.SetDefaultColor(Color.GRAY);

    “15”.SetLineWeight(2);

    plot Banker = if(isNaN(close),na,rsi_Banker);#, “Banker”, #ff0000, 6, plot.style_histogram)

    Banker.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);

    Banker.SetDefaultColor(CreateColor(255,0,0));

    plot HotMoney = if(isNaN(close),na,rsi_HotMoney);#, “Hot Money”, #d8c200, 6, plot.style_histogram)

    HotMoney.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);

    HotMoney.SetDefaultColor(CreateColor(216,194,0));

    plot Retailer = if(isNaN(close),na,20);# “Retailer”, #005e07, 6, plot.style_histogram)

    Retailer.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);

    Retailer.SetDefaultColor(CreateColor(0,94,7));

    #— END Code

    MCDXDaxM5.png MCDXDaxM5.png
    #234976 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Buenas! Aquí lo tienes:

    //-----------------------------------------------------------------//
    //PRC_MCDX (rsi)
    //version = 0
    //09.07.2024
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //-----------------------------------------------------------------//
    //-----Inputs------------------------------------------------------//
    RSIBaseBanker=50 //Banker Base
    RSIPeriodBanker=50 //Banker RSI Period
    RSIBaseHotMoney=30 //Hot Money RSI base
    RSIPeriodHotMoney=40 //Hot Money RSI Period
    SensivityBanker=1.5 //Sensivity banker
    SensivityHotMoney=0.7 //Sensivity Hot Money
    //-----------------------------------------------------------------//
    //-----RSI Banker--------------------------------------------------//
    rsiBanker=SensivityBanker*(rsi[RSIPeriodBanker](close)-RSIBaseBanker)
    if rsiBanker>20 then
    rsiBanker=20
    elsif rsiBanker<0 then
    rsiBanker=0
    endif
    //-----------------------------------------------------------------//
    //-----RSI HotMoney------------------------------------------------//
    rsiHotMoney=SensivityHotMoney*(rsi[RSIPeriodHotMoney](close)-RSIBaseHotMoney)
    if rsiHotMoney>20 then
    rsiHotMoney=20
    elsif rsiHotMoney<0 then
    rsiHotMoney=0
    endif
    //-----------------------------------------------------------------//
    //-----------------------------------------------------------------//
    return 20 as "Retailer" coloured(0,94,7)style(histogram), rsiHotmoney as "Hot Money" coloured(216,194,0)style(histogram), rsiBanker as "Banker" coloured(255,0,0)style(histogram), 5 as "5" coloured("silver")style(line,2), 10 as "10" coloured("fuchsia")style(line,2),15 as "15"coloured("silver")style(line,2)
    
    jcl thanked this post
    DXSXXXX-1-hora.png DXSXXXX-1-hora.png
Viewing 2 posts - 1 through 2 (of 2 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

TradingView to ProRealTime Translation Center

New Reply
Author
author-avatar
jcl @jcl Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
2 years, 2 months ago.

Topic Details
Forum: TradingView to ProRealTime Translation Center Forum
Started: 07/08/2024
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...