Help needed on making plot A = plot B.
Forums › ProRealTime English forum › ProBuilder support › Help needed on making plot A = plot B.
- This topic has 7 replies, 2 voices, and was last updated 5 years ago by GraHal.
-
-
02/23/2019 at 11:24 PM #92155
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
endifCan anyone help me with this please?
Many Thanks!!
Ross
02/24/2019 at 8:22 PM #92203Example if my current attempt123456789if RSI2 > Bollinger2 MA thenxproc = (RSI2 – Bollinger2MA)/(UpperBollinger2-Bollinger2MA)RSI2Value = xproc*(Upper Bollinger1 – Bollinger1MA) + Bollinger1 MAelsif RSI2 < Bollinger2MA thenxproc = (RSI2 – LowerBollinger2)/( Bollinger2MA – LowerBollinger2)RSI2Value = xproc*( Bollinger1MA – Lower Bollinger1) + LowerBollinger1elseRSI2Value = Bollinger2MAendifHere’s the code…..
Thanks allot
Ross
02/24/2019 at 11:25 PM #92210I 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?
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?
02/24/2019 at 11:34 PM #9221202/24/2019 at 11:41 PM #92213First 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/
02/25/2019 at 12:05 AM #92215Thanks 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….
02/25/2019 at 2:18 PM #92259It 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.
02/26/2019 at 10:20 PM #92404Hey 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.
123BollUP = ExponentialAverage[20](open)+2*std[20](open)BollDN = ExponentialAverage[20](open)-2*std[20](open) -
AuthorPosts
Find exclusive trading pro-tools on