I have written a custom indicator to find gaps in an uptrend. Basically I want to identify gaps where the current day's low is higher than the previous trading day's high which should find me any gaps in an uptrend.
I want to be able to output a value of +1 when I find a gap so that I can then filter on this value in the Market Analyser when I incorporate this custom indicator there.
The code I am using is as follows:
protectedoverridevoid OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if (Low[0] < PriorDayOHLC().PriorClose[0])
{
Value.Set(1);
}
else
{
Value.Set(0.0);
}
}
Please let me know if you think this will give me what I need.
Many thanks,
Evan
Comment