Fuzzy Logic from a TradeStation EasyLanguage Signal
The below tests for a fuzzy truth value (between 0.0 and 1.0) to determine to what degree a trading condition is met. Using such, one can program trading systems & indicators that go beyond just yes and no and into the realm of maybe. This is very useful when dealing with complex rules, especially ones about which you may not be completely certain. It is very useful for ferreting out issues with your trading system rules. Rather than combining true and false with "and" & "or", one combines values between 0.0 (false) & 1.0 (true) with "MinList" (and) & "MaxList" (or). Notice the indentation. Doing indentation in this fashion makes it far easier to comprehend and correct complex logic statements. Notice that many lines are commented. Frequent comments make understanding and altering code much easier. I always comment complex or non-obvious statements, especially when someone else may need to understand them.