Warning: the function returns 2 values but your code needs 1
Forums › ProRealTime English forum › ProOrder support › Warning: the function returns 2 values but your code needs 1
- This topic has 2 replies, 2 voices, and was last updated 8 years ago by
Bard.
-
-
04/06/2017 at 3:47 PM #31270
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:
12345if (stdev[0]+stdev[1]+stdev[2]+stdev[3]+stdev[4]) < (stdev[1]+stdev[2]+stdev[3]+stdev[4]+stdev[5]) thenSWBUY=1elseSWBUY=0ENDIFAnd then I wanted to add a filter (the oscillator):
1c1 = 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:
123456if (stdev[0]+stdev[1]+stdev[2]+stdev[3]+stdev[4]) < (stdev[1]+stdev[2]+stdev[3]+stdev[4]+stdev[5]) ANDc1 >= 0.0 thenSWBUY=1elseSWBUY=0ENDIF04/06/2017 at 5:14 PM #31284Hi,
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:
1c1,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:
1ignored,c1 <span class="token operator">=</span> <span class="token keyword">CALL</span> <span class="token string">"Ehler's Univ Osc SuperSmoother"</span>04/07/2017 at 12:24 AM #31310Thanks 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:
123// Conditions to enter long positionsindicator1, ignored = CALL "Ehler's Univ Osc SuperSmoother"c1 = (indicator1 CROSSES OVER -0.8) -
AuthorPosts
