There's also another problem with this script.

I mentioned in the other thread that the "static" keyword keeps the content of the "crossed" variable even when the function is left. This is not desired here, because the HuckTrend() function is called many times in your portfolio script, every time with a different asset. Thus you need a different way to temporary store the content of "crossed" separately per asset.

There are 8 variables for this purpose, with the name SkillLong[0] ... SkillLong[7]. Instead of defining crossed as static, in a portfolio script you would write at the begin of the function

int crossed = SkillLong[0];

for loading the variable content from SkillLong[0]. And for storing it again after it was modified in the function, add this line at the end:

SkillLong[0] = crossed;

The "crossed" variable can now have a different content for any asset.