How to pass a dataseries "bars" ( not price bars) into function.
Author: sofia
Creation Date: 1/4/2013 7:45 PM
profile picture

sofia

#1
Hello,

I want to calculate high and lows for dataseries.
I want to pass Dataseries bars from "PS" into pivot-point function that calculate highs and lows.
i.e I want to calculate highs and lows for PremierStochastic -PS dataseries.
Here is what I am trying to do.
CODE:
Please log in to see this code.


Thanks.

Sofia
profile picture

Eugene

#2
CODE:
Please log in to see this code.

No. This call is not required in this code snippet, unless you have omitted something when posting. Additionally, the syntax would be incorrect as you seem to be confusing Bars and DataSeries here.
QUOTE:
I want to pass Dataseries bars from "PS" into pivot-point function that calculate highs and lows.

If a method accepts a Bars parameter, it was usually made so for a very good reason. In particular, it means that the indicator's calculation is based on more than one standard OHLC DataSeries, like using High and Low or even the 4 of them together. Otherwise, why not just accept a single DataSeries as the parameter, isn't it? Consequently, passing an arbitrary DataSeries instead of "Bars" does not make any sense and is in conflict with the indicator's internal logic. Thus, your pivot point method is not likely to function properly as usually it's based on tracking Highs and Lows of a Bars object. An indicator such as PremierStochastic just doesn't have highs and lows - it's a single value per bar, not 4 as in OHLC.

So, let's redefine/clarify your question to find a solution:

* What are "highs" and "lows" for the PremierStochastic?
* How different they are from applying Highest.Series and Lowest.Series to it?
* What has inspired you, i.e. how do envision the thing to look like?
profile picture

sofia

#3
Hi Eugene,

"PremierStochastic" indicator is directional indicator, but a delayed and smoothened version of price bars.
I want to use certain setup on oscillator to initiate buy.

Here is my original code. It catches good entry points based on pivot-points on PremierStochastic.Works good with 30 min scale.

CODE:
Please log in to see this code.


Thanks,

Sofia
profile picture

Eugene

#4
Hi Sofia,

Good for you. However, your comment didn't make me feel that we're getting close to having a clear-cut plan on what to do.
profile picture

sofia

#5
Hi Eugene,

Sorry for the confusion, let me try to explain what I am trying here.

I want to use pivotpoint function on Bars generated off external dataset.
This is not for trading as pivotpoint function using ppL_bar, and ppH_bar are moving functions
i.e they change as new lows or highs are made, but I want to see them on different Bars.[Not the default selected Dataset Bars]

CODE:
Please log in to see this code.


By default "PivotPointBar.Series" is getting "Bars" off DataSet that is selected. So if I select DataSet as "SPY" clicking on the dataset selection on left-hand side, then by default SPY "Bars" will be input to "PivotPointBar.Series",

I don't want "Bars" value to come from SPY Dataset, but to come from external dataset selected using

QUOTE:

Bars ext1 = GetExternalSymbol("vxx",true);


i.e How do I get ext1 Bars into "PivotPointBar.Series"



Thanks,

Sofia



profile picture

sofia

#6
Never mind, I found out. Closing this request.
CODE:
Please log in to see this code.


Thanks,
Sofia
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).