Custom Formula Confidence Solvers

BH provides only a few Confidence Solvers.   Each Confidence Solver has its own mathematical formula, but none of these formulas can be edited by the user. This limits the functionality of BH.  A formula wizard for each solver would greatly expand the possibilities and provide a way to create custom Confidence Solvers.

Unlike custom indicators, all valid formulas in Confidence Solvers would require use Boolean logic conditional tests, thus evaluate to either TRUE or FALSE.

BH solver formulas could utilize the full Ninjascript functions library, but formula construction could be by a popup Wizard utility, parameter table, with syntax checking to facilitate rapid solver formula development.

So, a valid solver formula might look like this:

Close[0] > Open[0] && CrossAbove(EMA(10), EMA(20), 5)

.. but could be much more complex with mathmatical functions which would include addition, subtraction, multiplication, division, exponentiation, and modulo negation (+, -, *, /, ^, %, -) .   C# Boolean conditional logic notation might be replaced with AND, OR instead.  Commenting feature could be allowed to improve formula readability.  Saving/loading formulas to/from a file/library would be desirable.

Plus.. it would be nice if the formula wizard allowed mathmatical logic such that conditional tests evaluated to 1 or 0 instead of TRUE and FALSE. That way formulas could evaluate values based on conditional tests.  In C# a IF-TRUE-THEN-ELSE mathmatical formula using the ?: operator would look like this...

//  IF TRUE-THEN-ELSE

double myResult = (myVar1 == 1 ? 1 : 0)* myFormula1 + (myVar1 != 1 ? 1 : 0)* myFormula2;

float myResult2 = (myVar1 == 1 ? 1F : 0F)* myFormula1 + (myVar1 != 1 ? 1F : 0F)* myFormula2;

// placement of myFormula1 and myFormula2 for readability only, could be placed before semicolon within braces.

But in the formula wizard, the user might only see the formula which evaluates to TRUE or FALSE, without the ?: operator, and not be concerned with precision. A valid formula in the Wizard might look like this..

Stochastics(14,3,1).K[0] >= 80 AND ( Stochastics(14,3,1).K[0] - Stochastics(14,3,1).K[1] ) <= 5 - ( IExecution.Time.Date == DateTime.Today)

instead in C# like this..

Stochastics(14,3,1).K[0] >= 80 && ( ( Stochastics(14,3,1).K[0] - Stochastics(14,3,1).K[1] ) <= 5 - ( IExecution.Time.Date == DateTime.Today ? 1 : 0 ) )

 

BH indicator plot on the chart as 1, -1, or 0, so I think this approach to the math is more consistant with what's plotted on the chart.

 

.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk