Prob with function

dpleydell

Junior member
Messages
11
Likes
0
Hi,

I was playing around with a function and when I put it into a showme it didn't seem to work correctly in the sense that it selected every signal bar. However if I paste the code straight into the showme it actually works so I'm not sure why my function isn't returning the right value.

Any clues? Thanks
David

{Function Name: check_entry}

Var: BBLength(21),BBStdDev(2);
Var: retval(0);
Var: lowerBand(0), upperBand(0);

{ Get the Bollinger Band values}
upperBand = BollingerBand(Close,BBLength, BBStdDev);
lowerBand = BollingerBand(Close,BBLength,-BBStdDev);

{---- Check for a Long Entry condition ----}

{ Check bands etc etc }
If ((High > High[1]) AND (Low > Low[1])) Then
retval = 1;

{ For a short return -1 }

{ Return Result }
check_entry = retval;
 
Please Ignore. I solved the problem. I'm still getting used to programming TS compared to C/C++.
 
Top