Q1. Could you recommend an indicator or series that could weed out the non performing junk stocks?
Have added this to some scans for volume, not sure how effective it is at this stage:
AND MOV(CLOSE,21,S) * MOV(VOLUME,21,S) >= 50000;
That formula calculation is definitely how to set a liquidity benchmark requirement.
It is part of SPA3 criteria for RSC parameters to be met. Section 9.5 of the reference manual goes in to more detail:
https://documentation.beyondcharts.com/SPA3_REF.phpThe RSC formula for comparing a stock to the index is provided in the Sample Formula section of the Formula Explorer, which can be imported to your formula with this line:
RSC_Comp := FML("Relative Strength Comparison");
Then to convert it in to a moving average:
RSC_MOV := MOV(RSC_Comp, 30, E);
Then to acheieve a similar effect to the SPA3 Trader system built in to your scans, you just need to compare the position of the RSC to the RSC MOV. Section 9.5.3 goes in to more detail as to why this in particular is useful for finding currently outperforming stocks.
Q2. Also having problems with getting the TMF to code correctly for use in lower code, if you could point me in the right direction, I assume it's an indicator script without an output?. I'm tempted to think it needs a MOV(ADV,,) type line? but when I tried this it didn't want to save.
The way it is setup is designed to be used on its own with the IF statement working out the only output. It can get a bit messy and I personally, am not a fan of inputs (still work though), but I would defintely change the last line to this:
TMF := If(Wilders(V,periods)=0,0,Wilders(ADV,periods)/Wilders(V,periods));
Then the calculation can be referenced easier. It does work as-is in its own formula.
Once that is achieved I would like next to code for a TMF >=0 and less then 15, or any number of indexed levels. Is the index level built into the indicator formula or do you need to build one seperately?
(I guess this question covers any indicator that could be referenced to an index level like; RSI (of MACD) and MACD itself, ultimately to code for a crossing above a line level like 20 or 50 for buys and downward 50 80 or 90 for sells. I know the cross() script but does it apply to index levels also?
[/quote]
Plot TMF as an output on to a chart and work this one out. It is a good habit to get in to, to know what is actually happening with the indicator. In this case it seems to osscilate above and under 0.
So depending on what you are looking for - you can always check if say TMF > 0 or <-0.5 depending what you are interested in.
Ok here's a problem I've had all along where the MACD above and below zero qualifier is ignored by the scan:
{ ---- Parameters ---- }
MACD1_DN := MACD1<0 and MACD1<MACD1sig;
MACD2_UP := MACD2<0 and MACD2<MACD2sig and MACD2 > REF(MACD2,-1);
MACDhist_converge := MACD2hist > REF(MACD2hist,-1) and MACD1hist < REF(MACD1hist,-1);
{ ---- Scan triggers ---- }
SCAN_TRIG_BUY := MACD1_DN and MACD2_UP and MACDhist_converge and MOV(CLOSE,21,S) * MOV(VOLUME,21,S) >= 50000;
{ ---- Alert Signals ---- }
Alert_BUY_MACD_hist := Alert (SCAN_TRIG_BUY, 1);
{ ---- Output to Scan Engine ---- }
Alert_BUY_MACD_hist;
SCAN_TRIG_BUY;
You have 2 outputs here - best to keep it to 1 for scans so it's clear what you are searching for. In this case, have you dragged this formula on to a chart to check what it is doing and ensure it lines up to what you are expecting?
Remember if you put MACD1; or MACD1_DN; on their own line in the output at the end - you can see on the chart what that calculation is actually doing. If you get a few lines, right click the chart background -> panel -> add.
Then drag one of the lines in to their own empty panel - makes it easier to read and understand what each calculation is actually producing. If you are not sure to do this let me know and I can produce a quick video about it by COB tomorrow.
{ ---- Formula ---- }
RSIM_X20 := RSIM_out cross(RSIM_out,1, 20);
{ ---- Alerts ---- }
ALERT_RSIM_x20 := alert(RSIM_X20);
{ ---- Output to Scan Engine ---- }
ALERT_RSIM_x20;
RSIM_X20;
Stay RSIM_out is not defined ie. BCFL does not understand.
Also the cross function is cross(some indicator, some other indicator) checking if A has gone above B for a certain bar. So if you wanted to see if it moved above a value of 20 it would look like this:
RSIM_X20 := cross(RSIM_out, 20);