Toggle and ToggleInclusive

Top  Previous  Next

Chart for this topic:  Toggle.cht

 

Toggle(what, condition1, condition2)

ToggleInclusive(what, condition1, condition2)

 

What - an integer number between 1 and 4 (default 1).

Condition 1 – a time series that must be a condition that defines when the search begins (default Close should not be used)

Condition 2 – a time series that must be a condition that defines when the search ends (default Close should not be used)

 

What:

1 = between the conditions, it returns 1 and elsewhere it returns 0
2 = between the conditions, it returns 0 and elsewhere it returns 1
3 = between the conditions, it returns 1 and elsewhere it returns N/A
4 = between the conditions, it returns N/A and elsewhere it returns 1

 

Toggle excludes bars where conditions are true.  ToggleInclusive includes bars where conditions are true.  These indicators tell you whether or not you're in a condition.

The N/A output means that the value on the chart is actually missing, i.e., not computed. You may rightly wonder why we would produce an output which would be non-existent on some segments of the chart. The reason is that missing values cause indicators and neural network inputs and outputs to not be computed on such bars. For example, a moving average is obviously not computed on any bars where the time series being averaged is not there. The Prediction Wizard uses average values as the input when that input is not there. Most importantly, the Prediction Wizard actually ignores all bars during training when the output is not there. This means that you can exclude segments on the chart from the training set just by multiplying your original output by a Toggle containing a What=3 or a What=4 condition. The indicator created by this multiplication (call it the adjusted output) will be missing when the Toggle is missing, because "anything x missing = missing". The Prediction Wizard should then be set to use the adjusted output instead of the original output. This means that the neural network will not be trained on any bars between the two conditions of your Toggle Indicator.

You may select the conditional true/false indicators from any of the indicators that came with the NeuroShell Trader as well as the conditional indicators included in Advanced Indicator Set 3.

Note:  This indicator uses close as a default parameter value when a condition is required.  Close is a non-zero value so it is always a true condition.   However, you should not pay attention to the indicator results until you change the close to a real condition such as the RSI < 30 or a crossover.

 

 

 

Toggle Moon Distance

In this example, the Toggle indicator turns on when the moon distance is in the middle range, and turns off when the moon distance is outside of the middle range.