Finding Highest Price Based on value

Questions about MultiCharts and user contributed studies.
dtl
Posts: 3
Joined: 30 Oct 2012

Finding Highest Price Based on value

Postby dtl » 02 Nov 2012

Hi,

I would like to know the highest occurence of price whilst stochastic is above 80, how do I do this is easy language?

Thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Finding Highest Price Based on value

Postby TJ » 02 Nov 2012

Hi,

I would like to know the highest occurence of price whilst stochastic is above 80, how do I do this is easy language?

Thanks
Sounds like a simple concept (it is, and it is not)...

This is a basic basic basic counter question. It is not difficult to program such an analysis.
eg.

Code: Select all

variable:
highest.stoch(0);

if slowk > highest.stoch then
highest.stoch = slowk;
But I am sure you won't satisfy with such an answer... because it only generates more questions (and requests).

What is the chart resolution you are using? daily chart? minute chart?

What are you looking for ? The date and time of the occurance? The stochastic value? the price of the symbol at that point?

What do you mean by "the occurence"? Highest stoch during the day of a minute chart? or all the incidences of values above 80? Do you want to keep a database of the prices? What if there are more than one peak? In real time, the first occurance of stoch over 80 is the highest, but is it the highest of the day? What if the stoch pull back below 80 and peaks again? What analysis do you want to do? Do you want to find the divergence of the peaks?
Hint: You have a simplistic question; you have to write out the specification of what analysis you plan to be doing.

This is only the beginning. The possibilities are endless. I hope I have whetted your appetite for more.

I would suggest you to go through the manual once, so that you can equip yourself for more sophisticated analysis.

https://www.multicharts.com/multicharts ... mentation/

dtl
Posts: 3
Joined: 30 Oct 2012

Re: Finding Highest Price Based on value

Postby dtl » 06 Nov 2012

Hi,

Thanks for your response.

Using minute charts;

1) With stoch above 80 I would like to store the highest price that occurs.

2) When stoch leaves 80 and then re-enters above 80 I would like to then compare current price with this previous stored high price.

It is 1) that I am struggling with, I think it has something to do with an array,

Thanks

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: Finding Highest Price Based on value

Postby furytrader » 06 Nov 2012

I don't think you need an array. If you view each time the stochastic goes over your threshold level (80) as a separate "event", you just need to keep track of the highest price that is reached for each event. In EasyLanguage, you would say something like this:

Code: Select all

Input: Threshold(80);
Var: Stoch_HighPrice(0), Old_Stoch_HighPrice(0);

value1 = Stochastic (<insert parameters here>); // You would have to define this based on whatever stochastic parameters you want (length, etc.)

// This will save the highest price value reached when the stochastic is above the threshold level - note that when we first cross above the threshold, we assign the stoch_highprice variable to the current high price by default

If(value1[1] < Threshold and value1 >= Threshold) Then
Stoch_HighPrice = High
Else If(value1 >= Threshold) and High > Stoch_HighPrice Then Begin
Stoch_HighPrice = High;
End;

// Once the stochastic goes below the threshold level, we save the last stoch_highprice value to Old_stoch_highprice - this prevents it from being written over once the stoch goes back over

If (value1[1] >= Threshold and value1 < Threshold) Then Begin
Old_Stoch_HighPrice = Stoch_HighPrice;
End;

// You can then reference Old_stoch_highprice when the stochastic goes above the threshold again, since we only update old_stoch_highprice once the stochastic goes back down
I have not tested this code to be absolutely sure it works, but hopefully you can see the concept being applied here. In EasyLanguage, "If, Then, Else, If" statements can be a little non-intuitive, so if you can't get it to work right, that's where I would focus.

Good luck!

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Finding Highest Price Based on value

Postby Henry MultiСharts » 06 Nov 2012

dtl, here is another sample script for you.
Attachments
Stochastic_mod.pla
(5.37 KiB) Downloaded 486 times


Return to “MultiCharts”