LowerCandleClose Event
Posted: Mon Aug 27, 2012 10:55 pm
I am trying to build a script that will recognize:
-- the highest high in the last "N" bars,
-- the Low of that "Highest High" bar and then
-- a subsequent Close below the Low of that bar as an Event.
I have tried the following (which does not work):
PriorHighBar:= Ref(HHV(H,N),1);
LowOfHighBar:= if(H > PriorHighBar, Low, 0);
LX:= C > 0 & C < LowOfHighBar;
Event: LX;
In Amibroker I would use the ValueWhen function for this purpose. for example:
SYNTAX ValueWhen(EXPRESSION, ARRAY, n = 1)
RETURNS ARRAY
FUNCTION Returns the value of the ARRAY when the EXPRESSION was true on the n -th most recent occurrence. Note: this function allows also 0 and negative values for n - this enables referencing future
EXAMPLE valuewhen( cross( close, ma(close,5) ) ,macd(), 1)
Is there a similar function in EdgeRater for this purpose or is there another way to achieve my goal?
Any assistance you can provide will be gratefully received.
Many thanks,
Fred
-- the highest high in the last "N" bars,
-- the Low of that "Highest High" bar and then
-- a subsequent Close below the Low of that bar as an Event.
I have tried the following (which does not work):
PriorHighBar:= Ref(HHV(H,N),1);
LowOfHighBar:= if(H > PriorHighBar, Low, 0);
LX:= C > 0 & C < LowOfHighBar;
Event: LX;
In Amibroker I would use the ValueWhen function for this purpose. for example:
SYNTAX ValueWhen(EXPRESSION, ARRAY, n = 1)
RETURNS ARRAY
FUNCTION Returns the value of the ARRAY when the EXPRESSION was true on the n -th most recent occurrence. Note: this function allows also 0 and negative values for n - this enables referencing future
EXAMPLE valuewhen( cross( close, ma(close,5) ) ,macd(), 1)
Is there a similar function in EdgeRater for this purpose or is there another way to achieve my goal?
Any assistance you can provide will be gratefully received.
Many thanks,
Fred