|
Chaim6
2014-09-16 15:01:29
0
|
|
Thanks. After thinking it over, one workaround that should work before using the money management script (which is still a bit intimidating for me) is to use the Comp with Percentile, manually set the rank for the cash ticker to a lower number, and pick the and filter for the SMA rule if the ticker != cash.
EDIT:
cashFund = StringEqual(Name(), "TLT");
// IsNA() is a custom function that replaces all NAs in a vector with the second parameter
r = IsNA(Comp(Close[0]/Close[63]-1, "Percentile!", 1, 1, "AAA;BBB;CCC;DDD"), -1);
SetSimLongRank(r);
Buy = Close > SMA(P_SMA) || cashFund;
This seems to work. I am doing some more testing to verify it.
|
|