PureBytes Links
Trading Reference Links
|
Hi Ernie,
Have you looked at my PeakTrough examples at the ZBoard ... I think you will find they are a good starting point?
- you need to settle on a definition of a Peak or Trough
- you need to decide which data point, per bar, that you will evaluate
- for accurate reporting of Pk/Tr you need to account for equal highs or lows
- optionally you can evaluate for Major Peaks or Troughs
I have given examples of all of the above there.
For your own use:
- if you really need lookback versions, and you like my examples as a starting template, then you can recode them for your purpose quite easily.
- if you want to quantify Peak or Trough values first you need to define the PK/TR and then use Valuewhen(Peak ==1, Close,1)/Valuewhen(Peak ==1, Close,2) (or similar) to give you a ROC type answer (I have done this successfully, in the past, without the need for loops).
If you are interested, have a go ... if you get stuck post your progress code ... if I am around I will help or maybe add an example of ROC(Peaks) to the Zboard.
In some circumstances you can also simplify the code .. anything that works over a reasonable test period is fine.
I call Peaks and Troughs Pivot Points .... note that there are other versions of Pivots and Peaks around but I don't have anything to say about them.
http://zboard.wordpress.com/2009/02/20/189/
Brian.
--- In amibroker@xxxxxxxxxxxxxxx, "Ernie Newman" <trading4@xxx> wrote:
>
> I am trying to design a new Peak Trough Indicator that would
> detect a peak or trough condition before is has risen to a % value.
> Or one that does not look forward and be able to number the past conditions for use in a scan below is my idea of how this might be programed but the signals are incorrect.
> Basically I want to use this as you would a Trough but
> I want to define a low trough value before it makes a 10% advance.
> How can I get the previous Value of this occurance by assigning it a
> number. I am thinking I must use a loop buy not sure?
> I hope I am explaining this correctly.
> THANKS
> Ernie
>
>
> // Test Scan to find 10% Lowest Low Troughs by Number
>
> TrCond = Ref(L,-2) > Ref(L,-1) AND
> Ref(L,-1) < L AND
> Ref(H,-1) < H AND Ref(L,-1) < Ref(HHV(H,10),-2)*.90;
> for( i = 1; i < BarCount; i++ )
> {
> TrCond[ i ] = L[i];
> }
>
> Filter = TrCond;
> AddColumn(C,"Close",1.2);
> AddColumn(Ref(L,-1),"L-1",1.2);
> AddColumn(TrCond[1],"TR1",1.2);
> AddColumn(TrCond[2],"TR2",1.2);
> AddColumn(TrCond[3],"TR3",1.2);
>
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|