Probuilder impazzito

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #254989 quote
    RobbRobb
    Participant
    Average

    ciao

    stavo scrivendo del codice per un indicatore, ma ad un certo punto non rispondeva più ai comandi.

    Il cursore non resta nella posizione che seleziono se digito un numero o il * non li prende e il cursore va da un’altra parte…Premo delete e non succede niente…

    E’ capitato anche a voi? Si può risolvere in qualche modo?

    grazie

    Roberto

    #254990 quote
    RobbRobb
    Participant
    Average

    …altro esempio: digito 1 e mi esce 0.1

    ????

    #254994 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Prova ad uscire dalla piattaforma e a rientrarci. Se non basta, prova addirittura a riavviare il PC.

    #255006 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ciao. Stai usando V13?
    A volte ho notato qualcosa di strano con il V13 ma sono uscito e rientrato e basta.
    Quando succede di nuovo, apri un ticket di supporto in modo che PRT possa vedere il problema esatto.

    robertogozzi thanked this post
    #258745 quote
    Elias1965Elias1965
    Participant
    New

    // This script had been cloned from “Weinstein Stage Analysis” at 27 Jan 2025, 16:14

    describe_indicator(‘Weinstein Stage Analysis’);


    // This is an experimental implementation of Weinstein Stage Analysis for candle coloring.

    // Please note that this is an interpretation and may not perfectly align with all aspects of the analysis.


    const smaLength = input.number(‘MA Length’, 30, { min: 1 });

    const withinRangePercent = input.number(‘Within Range %’, 5, { min: 0, max: 25 });


    // Allow user to select the moving average type

    const maType = input.select(‘MA Type’, ‘sma’, constants.ma_types);

    const computeMA = indicators[maType];


    // Allow user to adjust candle colors

    const stage2Color = input.color(‘Stage 2 Color’, ‘green’);

    const stage3Color = input.color(‘Stage 3 Color’, ‘orange’);

    const stage4Color = input.color(‘Stage 4 Color’, ‘red’);

    const stage1Color = input.color(‘Stage 1 Color’, ‘lightgreen’);


    // Fetch weekly data

    const weeklyData = await request.history(current.ticker, ‘W’);

    assert(!weeklyData.error, Error fetching weekly data: ${weeklyData.error});


    const weeklyMA = computeMA(weeklyData.close, smaLength);

    const withinRange = mult(weeklyMA, withinRangePercent / 100);


    let currentTrend = ”;

    const myColors = for_every(

      weeklyData.open, weeklyData.close, shift(weeklyData.open, 1), shift(weeklyData.close, 1), weeklyMA, shift(weeklyMA, 1), withinRange,

      (_open, _close, _pOpen, _pClose, _ma, _pMa, _withinRange, _prevColor) => {

        const myBodyLow = Math.min(_open, _close);

        const myBodyHigh = Math.max(_open, _close);

         

        if (myBodyLow > _ma + _withinRange && _pMa < _ma) {

          currentTrend = ‘upward’;

          return stage2Color;

        } 

         

        if (myBodyHigh < _ma – _withinRange && _pMa > _ma) {

          currentTrend = ‘downward’;

          return stage4Color;

        }


        if (currentTrend == ‘upward’) {

          return stage3Color;

        }


        if (currentTrend == ‘downward’) {

          return stage1Color;

        }


        return _prevColor || null;

      }

    );


    // Map weekly colors to the chart’s time frame

    const myMappedColors = interpolate_sparse_series(land_points_onto_series(weeklyData.time, myColors, time, ‘le’), ‘constant’);

    color_candles(myMappedColors);


    // Paint the weekly MA for reference

    const myMappedMA = land_points_onto_series(weeklyData.time, weeklyMA, time, ‘le’);

    const myInterpolatedMA = interpolate_sparse_series(myMappedMA, ‘linear’);

    paint(myInterpolatedMA, { name: Weekly ${maType.toUpperCase()}, color: ‘white’ });


    // Create signals based on candle colors

    const myGreenSignal = for_every(myMappedColors, _color => _color === stage2Color ? 1 : 0);

    const myOrangeSignal = for_every(myMappedColors, _color => _color === stage3Color ? 1 : 0);

    const myRedSignal = for_every(myMappedColors, _color => _color === stage4Color ? 1 : 0);

    const myLightGreenSignal = for_every(myMappedColors, _color => _color === stage1Color ? 1 : 0);


    register_signal(myGreenSignal, ‘Stage 2’);

    register_signal(myOrangeSignal, ‘Stage 3’);

    register_signal(myRedSignal, ‘Stage 4’);

    register_signal(myLightGreenSignal, ‘Stage 1’);

    #258747 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Ciao,

    Vedo che hai incollato del codice ma non hai spiegato nulla… Sembra che tu stia cercando una traduzione del codice da TradingView a ProRealTime.

    Il posto corretto per richiedere traduzioni è il seguente gruppo: https://www.prorealcode.com/group/tradingview-to-prorealtime-translation-center/

    Crea un nuovo post richiedendo la traduzione. Puoi specificare di quale indicatore si tratta, da dove proviene e di cosa hai esattamente bisogno.

    Un saluto, un “per favore” e un “grazie” possono fare molto per convincere la comunità a darti una mano.

    Grazie.

Viewing 6 posts - 1 through 6 (of 6 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

Probuilder impazzito


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Robb @robb Participant
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by Iván GonzálezIván González
6 months, 2 weeks ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 01/05/2026
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...