Gregor wrote:
In the orginal formula the "x" variable provided the period lenght for the moving average and the "y" and "z" variable adjusted the precentages of the upper and lower bands of the channel from the central moving average EMA. How are these pecentages adjusted in the combined signals formula?
Just just the value of the "x" variable. If you want a envelope that is 10 percent above and below the center line then change x to represent a value of 10, i.e. x:=10;
Gregor wrote:Could you expand on what is meant by "neither funcation actaully returning a value, as all the computations are still tied up the defined variables"?
Take this as an example:
All you have done is tell MS to assign a value of 10 to the variable x. Compare the previous code to:
which assigns the value to variable and then tells MS to plot the variable on the chart.
Gregor wrote:You have talk about the importance of returning at least one value within a formula, is this the "1" with in the UB and LB variables of the combine signals formula? And does this refer to the need for metastock to define a statement with a one as true and zero as false (such as you see in indicator biulder).
This comment follows on from the previous comment where you should make sure that your function returns at least one value to the chart. Takefor example:
Like above, all this does is assign values to variables. The function plots nothing, and if you were to try to find the value of this function using a Fml() function call then it would return N/A because there is no assigned value. Compare this to:
Code:x:=10;
y:=15;
z:=20;
{return this value}
y;
Although the code assigns values to the variables, and plots the value of the y variable on the chart, this is also the value of the function which would be returned if you used a Fml() function call. For interest, the value of the fucntion returned by a Fml() call is the last value of a function as listed, so:
Code:x:=10;
y:=15;
z:=20;
{plot/return}
z;
y;
x;
would return the value of the x variable as it is the last in the code.
Gregor wrote:Could you expand on what is meant by " need to do some work with the logic B1 and B2 ( compare the combine logic results with the case L>EMA)"?
Have a close look at what you are trying to detect:
Code:B1:= H>UB;
B2:= L>EMA AND H<UB;
B1 OR B2;
If we extract the important parts and use some bracketting for clarity:
Code:(H>UB) OR (L>EMA AND H<UB)
As the conditions for the HIGH price is either above or below the UB line (but not exactly equals), consider the possibilites for the code to return a TRUE value of 1:
H > UB L > EMA returns TRUE
H > UB L = EMA returns TRUE
H > UB L < EMA returns TRUE
H = UB L > EMA returns FALSE
H = UB L = EMA returns FALSE
H = UB L < EMA returns FALSE
H < UB L > EMA returns TRUE
H < UB L = EMA returns FALSE
H < UB L < EMA returns FALSE
Are these the results you really wanted?
wabbit [:D]