Using BCFL or fine tuning a selection process is not necessary for SPA3 operation. Based on that most of our customers do not use BCFL for stock selection purposes. When more stocks come up than capital available, all you need is consistent process that can be analytical or non-analytical (ie. A to Z or choosing a letter from the alphabet based on the time of the month). A BCFL can help refine the returns, but does require some amount of effort for an unknown additional change to the edge.
Ok I think I need to understand what the broader user base is using BCFL for as you seem to have a good understanding of this?
More stocks are continually coming up than I have capital for, and about 50 percent of my portfolio is in varying stage of losses slightly down from gains at any one time. At which point I then go through and cull the worst 2 to 3 stocks on any day to replace them with new incoming entries. It's a tricky business requirng watching IRESS for most of the day, and that I want to get away from doing, so to level out and understand and have better tools for this whole process of do I hold or do I cut, based on a scan ranking system.
Ok so lets take the day of the month example from your quote extract above; lets say first day of the month (or week) as the comparison point of reference for price for all stocks that SPA3 has identified as trade-able from within a watch list as the 'analytical' and apposed to the 'non analytical' "A to Z or choosing a letter from the alphabet based on the time of the month".
How would I code to normalise all stock prices to be comparable? so that higher moving prices on the third day and forth day etc. could be identified in a scan column?
I think it is a 'normalisation code' that could then be applied to other aspects of variables like indicators, index levels, price to volume ratio, percent gains etc. Do you think this is doable in BCFL?
Could it be done by the reduction to a decimal like 0.1 or -0.1 so that adding all the variable decimals within the scan can then be added together to give a total tally for comparison purposes.
Separately but on the same agenda;
Next up is getting the RSI value to work so that the % value today is less or more than the value previous bar ago to asses if the RSI is rising or falling by x percent value over time:
I get the impression your head, Campbell, is chock full of stock formula code, so humbly ask once again if you could try solve the following:
I've tried a number of ways to get it to work without any success, it's another of those standard formula sequences that could be used for different indicators to replace the RSI with like ROC or moving average etc.;
The output I'm looking for is to get a single
negative (-3) or
positive (+3) % (or number) value output, so I can see if the indicator\price\anything is rising or falling in a scan column. I'm sure its trickier than it first appears so take your time no hurry.
This is what I started with and not sure if I'm heading in the right direction at all does it require the IF() statement:
%DAY_0 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -1)) * 100;
%DAY_1 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -2)) * 100;
%DAY_2 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -3)) * 100;
%DAY_3 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -4)) * 100;
I'll post the full scan code of what I have done so far, as you can see the RSI columns are too numerous and needs to be two column for RSI value and percent gain or loss:
MAM := FMLVAR("MA 60:90","MAM1");
MAS := FMLVAR("MA 60:90","MAS1");
ROC_LEVEL:= ROC(CLOSE,100,%);
RSI_level_0 := RSI(CLOSE,13);
RSI_level_3 := ref(RSI(close,13),-3);
MA_X := CROSS(MAM, MAS);
FILTER1 := MAM > MAS;
FILTER2 := ROC_Level > 8;
FILTER3 := CLOSE > REF(CLOSE, -1) AND REF(CLOSE, -1) > REF(CLOSE, -2) AND REF(CLOSE, -2) > REF(CLOSE, -3);
FILTER4 := MOV(CLOSE,60,S) * MOV(VOLUME,21,S) >= 50000;
%DAY_1 := ((Close - REF(Close, -100)) / Ref(Close, -1)) * 100;
%DAY_2 := ((Close - REF(Close, -100)) / Ref(Close, -2)) * 100;
%DAY_3 := ((Close - REF(Close, -100)) / Ref(Close, -3)) * 100;
{%DAY_4 := ((Close - REF(Close, -100)) / Ref(Close, -4)) * 100;}
{%DAY_5 := ((Close - REF(Close, -100)) / Ref(Close, -5)) * 100;}
RSI_%DAY_0 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -1)) * 100;
RSI_%DAY_1 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -2)) * 100;
RSI_%DAY_2 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -3)) * 100;
RSI_%DAY_3 := ((RSI(Close,13) - REF(RSI(Close,13), -100)) / Ref(RSI(Close,13), -4)) * 100;
Av % Gain 3_Days := (%DAY_1 + %DAY_2 + %DAY_3)/3 { + %DAY_4 + %DAY_5};
Bars_Since MA_X := barssince(MA_X);
Output := 1 AND FILTER1
AND FILTER2
AND FILTER3
AND FILTER4
AND Av % Gain 3_Days
AND ROC_LEVEL
AND Bars_Since MA_X
AND RSI_Level_0
AND RSI_%DAY_0
AND RSI_%DAY_1
AND RSI_%DAY_2
AND RSI_%DAY_3;
Output;
ShowCol(Av % Gain 3_Days, ROC_LEVEL, Bars_Since MA_X, RSI_level_0, RSI_%DAY_0, RSI_%DAY_1, RSI_%DAY_2, RSI_%DAY_3, "WL Name");