Download Improvian Guide

Transcript
Improvian Guide
Inputs
Length:"Length",9,0,1000,1;
End_inputs
Var
LowestLow := 0;
Difference := 0;
End_var
LowestLow := Lowest(Low, Length);
Difference := Highest(High, Length) - LowestLow;
if Difference = 0 then return 0;
return (Close - LowestLow) / Difference * 100;
Note: Some indicator strings are printed with an indent. By combining
the indented indicator strings that are part of the "If" block you can
better see the structure of your source code. Empty strings are used in
the body of the indicator in order to separate the code blocks from one
another. Tradecision overlooks all these empty strings and indents.
However, this makes your indicators easier to read and understand for
you and any other programmer.
What happens inside this version of MyFastK indicator? Let us assume
that for some of the bars the value HighestHigh(High, Length) will be
equal to the value LowestLow. When Tradecision reaches the operator
If…Then, it compares the value of the variable Difference with the
number "0." As most of the bars these values do not correspond to each
other, or, in other words, the statement is false, Tradecision skips the
code string following the keyword "Then" and proceeds by executing the
keyword "else." In those cases when Difference is equal to zero,
Tradecision will avoid making a mistake of dividing into zero by
assigning the zero value to the indicator.
39