Register Login
Forums    February 6, 2012
TradersStudio Forums
Derived Plots
Last Post 10-14-2008 10:59 AM by David Rooke. 4 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
David Rooke
New Member
New Member
Posts:22

--
10-04-2008 04:52 PM

    Hi,

    Is it possible to take the output of one indicator plot as input to another? Let's use an example:

    Bollinger bands plots a moving average with two bands. Is it possible to pipe the band values into another plot in order to calculate and plot the width of the bands in another window?

    There are a number of uses for this type of logic but that's a good basic example.

     

    Regards,

    Dave

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    10-10-2008 01:06 PM

    Plot1Ago...Plot9Ago properties

    Returns/Assigns value of the output series.

    Syntax

    Plot1Ago(BarsAgo) = value
    value = Plot1Ago(BarsAgo)

    The Plot1Ago property syntax has these parts:

    Part Description
    BarsAgo Number of the bar
    value Price value on that bar

    The following custom indicator demonstrates how you can access previous values of the plots:

     Sub IndicatorTest()
        Dim aver
        Dim dev

        aver = Average(Close, 10)
        dev = StdDev(Close, 10)

        Plot1(aver)
        Plot2(aver + dev)
        Plot3(aver - dev)
        If Plot1Ago(0) > Plot1Ago(5) Then BarColor(0)=vbBlue
    End Sub

    David Rooke
    New Member
    New Member
    Posts:22

    --
    10-13-2008 02:37 PM

    That's not really what I'm after. It works on prior bars, when I just want to work with the current bar, and requires that the raw plot and derived plots both be in the same piece of code.

    What I want to be able to do is make my code as generic as possible. So, plot A exists in function A while plot B exists as function B which is a fairly generic task type function - to do Y and Z to input X.

    The separation helps with reuseability and elimination of code bloat. I suspect that what I want to do isn't possible. Is that correct?

     

    Regards,

    Dave

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    10-14-2008 10:42 AM

    One last thing to try is global variables, GValueXX. If that does not work then I don't think it's possible.

    Question , why can't you write your indicator calculations as functions, call them in Indicator "B" as well as in Indicator "A"

     

    David Rooke
    New Member
    New Member
    Posts:22

    --
    10-14-2008 10:59 AM
    Posted By murray on 10-14-2008 10:42 AM

    One last thing to try is global variables, GValueXX. If that does not work then I don't think it's possible.

    Question , why can't you write your indicator calculations as functions, call them in Indicator "B" as well as in Indicator "A"

     

    Hi,

    Let's be clear...I haven't tried any of this yet. I'm asking a leading question here about how things should work. unfotunately, I don't have time for heading down blind alleys...I'm hoping you can light the way before I move on.

    To me, there are two angles to this:

    1. The programatic solution where values are calculated and used within my code. Your point above addresses this.

    2. The charting solution where different indicators can be plotted and treated in different ways. Your answer doesn't seem to address this. By this I mean and indicator is plotted on a chart and a second indictor is then charted with the output of the first indictor taken as it's input.  

    It's graphical rather than programmatic control I'm looking for. At times, manual slicing and dicing is the only way to gain insight. that requires flexibility and control...

     
    Regards,

    Dave

    You are not authorized to post a reply.


     TradersStudio, Inc. ® Copyright 2004-2012 All Rights Reserved   Terms Of Use  Privacy Statement