First signal crossing from HHV

What formula to use? I need the first crossing of the line 20 down. RSI indicator. First crossing from HHV.
Crossing only in the following 5 bars.
If no crossing line fallow 5 bars, the purchase signal will not be met.khjghk

I know how to find HHV, but I do not know how to proceed further. Thank you very much!

Post up your code of what you have tried so far.

1 Like

If you know how to find HHV function then you also know how to find HHVBars function. Once you have found it everything else after that is easy too such as

etc.

2 Likes

I am a beginner, the principle of AFL functioning is mostly learned from the formula can find here and or on the Internet. So far I can put together simple basics.
Now I do not know how to start putting the idea together. I do not want to do it without work, but I need to where to go at least.

I do not know what's going to look into the future. And how to limit it to 5 days.

HH= High > Ref(HHV(H, 20),-1) 

Have you opened the AmiBroker documentation (ever)?
Have you searched for what has been written above about HHVBars?
Those and many more can be found in AB documentation.

AFL guide
https://www.amibroker.com/guide/AFL.html

List of functions
https://www.amibroker.com/guide/a_funref.html

Same applies to Cross... it can be found in upper list of functions.

So considering cross of RSI through level 20 from above only within 5 bars after a new HHV and during some price down trend after new HHV leads to example:

/// @link https://forum.amibroker.com/t/first-signal-crossing-from-hhv/9427/6
HHperiod = 20;
HH = HHV(H, HHperiod );
HHbars = HHVBars(H, HHperiod); // bars since HHV
Cond = HHbars <= 5 AND ROC(L, 1) < 0 AND Cross(20, RSI(5));

Plot( C, "Price Chart", colorDefault, styleBar);
Plot( HH, "HH", colorGreen, styleStaircase );
PlotShapes( Cond * shapeUpArrow, colorRed, layer = 0, y = L, -12 );

936

5 Likes

Thank very much for the information. I appreciate it. Yes, I know the library. I went through several times. HHV Bars and Cross I also know. But I can not use it. I did not know how to put it into context. Your help opened my eyes.