I have encountered a weird bug (version 1.960). The script below does not contain any short trades, however, if I added the My_problem line, there would be several short trades entered. As I narrow down the bug, it is the My_problem line, even though it does not do anything besides declaring a variable which is not even used later. What gets even weirder is that if I change the first letter of "My_problem" to lowercase "my_problem", the script behaves accordingly. I have tested several other variable names, and it seemed some names with first letter uppercase would cause the problem, where names with all lowercase letters normally would not.


function run()
{
set(LOGFILE);
set(PLOTNOW);
StartDate = 20120901;
EndDate = 20130901;
BarPeriod=240;
vars P = series(price());
vars Signal=series(RSI(P,6));

var My_problem=RSI(P,30);

if(crossUnder(Signal,30))
{
if(NumOpenLong<1)
{
enterLong();
}
}
}