Help needed on making plot A = plot B.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #92155 quote
    VPT PRT
    Participant
    Junior

    Hi Everyone,

     

    As anyone reading my previous posts might have guessed, I have only a very basic coding ability, so I’ve been asking someone to help me with an idea that I have. However, we have become stuck with the following, and I was hoping that someone might point us in the right direction?

     

    Basically, I am trying to run Bollinger Bands on two RSI indicators; each RSI is to be set at different lengths.

     

    I want to use the Upper and Lower Bollinger’s along with the MA of the Bollinger’s as reference points. I want to use these reference points to attach the values of Bollinger2 including its MA, to the values of Bollinger1.

     

    I have been approaching this in the following way:

     

    Bollinger2 MA = Bollinger1 MA

    Upper Bollinger2 = Upper Bollinger1

    Lower Bollinger2 = Lower Bollinger1

     

    I have been trying to implement this in the following (and thus far unsuccessful) way:

     

    if RSI2 > Bollinger2 MA then
    xproc = (RSI2 – Bollinger2MA)/(UpperBollinger2-Bollinger2MA)
    RSI2Value = xproc*(Upper Bollinger1 – Bollinger1MA) + Bollinger1 MA
    elsif RSI2 < Bollinger2MA then
    xproc = (RSI2 – LowerBollinger2)/( Bollinger2MA – LowerBollinger2)
    RSI2Value = xproc*( Bollinger1MA – Lower Bollinger1) + LowerBollinger1
    else
    RSI2Value = Bollinger2MA
    endif

     

     

    Can anyone help me with this please?

     

    Many Thanks!!

     

    Ross

    #92203 quote
    VPT PRT
    Participant
    Junior
    if RSI2 > Bollinger2 MA then
    xproc = (RSI2 – Bollinger2MA)/(UpperBollinger2-Bollinger2MA)
    RSI2Value = xproc*(Upper Bollinger1 – Bollinger1MA) + Bollinger1 MA
    elsif RSI2 < Bollinger2MA then
    xproc = (RSI2 – LowerBollinger2)/( Bollinger2MA – LowerBollinger2)
    RSI2Value = xproc*( Bollinger1MA – Lower Bollinger1) + LowerBollinger1
    else
    RSI2Value = Bollinger2MA
    endif

    Here’s the code…..

     

    Thanks allot

     

    Ross

    #92210 quote
    GraHal
    Participant
    Master

    I am not good at coding, but I am a clear thinker who would like to help you where I can.

    I need to keep things simple so first off … you are trying to code up an Indicator … yes?

    VPT PRT wrote:

    However, we have become stuck with the following, and I was hoping that someone might point us in the right direction?

    Is the we / us somebody off here or who is familiar with the PRT coding language in any way at all?

    #92212 quote
    VPT PRT
    Participant
    Junior

    Hi there GraHal,

     

    Yes I/we are trying to code up an indicator.

    I only know some of the very basics, but my friend is much better at coding and is familiar with the PRT language.

     

    Cheers

     

    Ross

    #92213 quote
    GraHal
    Participant
    Master

    First thing I would have done is to look at Indicators using Bollinger Bands and the one below seems straightforward?

    Below uses BollingerUp and BollingerDown so you need to go back to the coding board and use the same I think (not just Bollinger)?

    https://www.prorealcode.com/prorealtime-indicators/bollinger-range-bound/

    #92215 quote
    VPT PRT
    Participant
    Junior

    Thanks for that  GraHal, I have renamed the bollingers within the code so the code is calling the correct plots and displaying these.

     

    I’ve stripped things out one by one and the issue seems to be with my logic/maths of combining the two bollingers together…  I am trying to ‘force’ Bollinger2 to the values of Bollinger1, with the expectation that RSI2 is changed as well, but maintains its relationship to bollinger2…

     

    A numerical example might be:

     

    RSI1 value = +75

    UpperBollinger1 = +100

    Bollinger1MA = +50

    LowerBollinger1 = 0

     

    RSI2 Before scaling:

    RSI2 value = 0

    UpperBollinger2 = +100

    Bollinger2MA = 0

    LowerBollinger2 = -100

     

    RSI2 After scaling:

    RSI2 value = +50

     

    UpperBollinger2 = +100

    Bollinger2MA = +50

    LowerBollinger2 = 0

     

    **I appreciate that RSI cant read negative numbers but this is just an example….

    #92259 quote
    GraHal
    Participant
    Master

    It would be much easier if you posted the full code you have developed so far towards what you want to achieve.

    The full code will enable I and others, in a spare few minutes, to dive in make suggestions and / or  run the code thus far and do a few tweaks and so the full code moves forward.

    So please post your full code thus far.

    #92404 quote
    GraHal
    Participant
    Master

    Hey I was just trying an idea with Bollinger as below.

    You may find below easier to work with as it allows variables to be optimised.

    BollUP = ExponentialAverage[20](open)+2*std[20](open)
    
    BollDN = ExponentialAverage[20](open)-2*std[20](open)
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Help needed on making plot A = plot B.


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
VPT PRT @vpt-prt Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by GraHal
6 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/23/2019
Status: Active
Attachments: No files
Logo Logo
Loading...