Warning: the function returns 2 values but your code needs 1
- This topic has 2 replies, 2 voices, and was last updated 7 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
Forums › ProRealTime English forum › ProOrder support › Warning: the function returns 2 values but your code needs 1
Hi
I wanted to add a second condition to a system buy condition and it gave me a warning (pls see screenshot). Any ideas why? (The Oscillator is bounded between -1 and +1)
Thanks.
The original code was:
1 2 3 4 5 |
if (stdev[0]+stdev[1]+stdev[2]+stdev[3]+stdev[4]) < (stdev[1]+stdev[2]+stdev[3]+stdev[4]+stdev[5]) then SWBUY=1 else SWBUY=0 ENDIF |
And then I wanted to add a filter (the oscillator):
1 |
c1 = CALL "Ehler's Univ Osc SuperSmoother" |
which was placed at the top of the system code and the Oscillator added to a Std Dev condition:
1 2 3 4 5 6 |
if (stdev[0]+stdev[1]+stdev[2]+stdev[3]+stdev[4]) < (stdev[1]+stdev[2]+stdev[3]+stdev[4]+stdev[5]) AND c1 >= 0.0 then SWBUY=1 else SWBUY=0 ENDIF |
Hi,
I don’t know the Ehler’s univ osc supersmoother, but I am going to guess its “return” line contains 2 variables? If the answer is yes, then if you want the first one of these 2, try with:
1 |
c1,ignored <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"Ehler's Univ Osc SuperSmoother"</span> |
or if you want the second one rather than the first:
1 |
ignored,c1 <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"Ehler's Univ Osc SuperSmoother"</span> |
Thanks very much Noobywan, example #1 above has fixed it because it was returning the actual signal line value plus the zero line value (the latter needing to be ignored). It is normally written, when created by simple programming, as:
1 2 3 |
// Conditions to enter long positions indicator1, ignored = CALL "Ehler's Univ Osc SuperSmoother" c1 = (indicator1 CROSSES OVER -0.8) |