To create a Custom Indicator, create a System Scoped Auto-Indexed Instrument Permanent Variable of type Series. Then assign this value in the Update Indicators script.


An example of a custom indicator might be the average close since trade entry. This value cannot be determined pre test, so it cannot be a calculated indicator and must be a custom indicator.


Create a new Auxiliary Block. Create a system scoped auto indexed IPV series variable. Set it to plot. Let's call it averageClose.




Now in the Update Indicators script section set the created averageClose series value like this:


'  We can only compute this value when we are in a position
IF instrument.position <> OUT THEN
  '  Compute the number of bars in the trade including the entry bar.
  bars = instrument.unitBarsSinceEntry[1] + 1
  '  Compute the average close over the last 'bars' number of bars
  averageClose = Average( instrument.close, bars )


This value will be set everyday of the test. It will be set at the start of the instrument bar, so it can be used as part of the order fill process, stop adjustment, risk adjustment, after trading day work as well as entry and exit signals for the next trading day.



Calculated Indicators, Creating Indicators, Custom Indicators, Indicator Access, Indicator Reference

See Also:

Data Groups and Types, Indicator Pack 1 Indicators


Edit Time: 5/10/2017 6:36:44 PM

Topic ID#: 246


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