Most Recent Occurrence returns the numbers of bars ago that the condition was true.

 

If the condition was not true during the lookback the function returns the value -1.

 

Syntax:

MRO( conditionseries, bars, instance )

 

Parameter:

Description:

conditionseries

Name of the condition series.

 

The Condition series should use 1 for TRUE, and 0 for FALSE.

bars

The number of bars over which to find the instance of the condition.

instance

Which occurrence the condition to search for; for example, 1 = most recent, 2 = 2nd most recent.

 

Returns:

The number of bars ago that the condition was true or -1 if not found.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Update Indicators Script
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  HighPivot = IPV Series - Auto-Index - Default = False
'  PlotHighPivot = IPV Series - Auto-Index - Default = Zero
'                  Plot Dot on Pivot High
'  Bar_Count = 21
'  Instance = 1 = Most Recent
 
'  Test for a simple High Pivot Bar Pattern
If instrument.high[2] < instrument.high[1] AND
  instrument.high[1] > instrument.high[0] THEN
  '  Assign this element a True State
  HighPivot = TRUE
ENDIF  
 
'  Show High Pivot Locations
If MRO( HighPivot, Bar_Count, 1 ) = 1 THEN
  '  Plot Dot over Pivot High
  PlotHighPivot[2] = instrument.high[2] + (instrument.minimumTick * 4)
Else
  PlotHighPivot = Undefined
ENDIF  
 
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Chart Display:

MRO_EC_Pivot-High_Dots

 

Links:

 

 

See Also:

 

 


 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software