Author Topic: Help with BCFL custom Scans & Coding  (Read 3091 times)

0 Members and 1 Guest are viewing this topic.

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 219
Re: Help with BCFL custom Scans & Coding
« Reply #90 on: 30/08/2019, 11:09:47 AM »
Hi John,

The outcome in this instance will be the outcome. There is no way to edit the output of a calculation without editing the inputs that are part of the calculation, or adding or subtracting other variables.

In this case you are osscilating two independant variables... they will not overlap nicely in every instance.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #91 on: 30/08/2019, 12:50:20 PM »
Was hoping to get the RSI of the ATRTS working, There must be a way to fix both independent variables prior to outcome. You notice I used {MAIN_L := MOV(ATRTS_L, 1, W);} so might go back and implement this as the price line and try a few swap-a-rounds. I have rem'd it out for some reason not sure why now.

Another more important problem I'm facing is getting the RSIMH's to oscillate as per the MACD trend state; IOW: macd > signal the rsimh oscillates above 50 mid line, and macd < signal rsimh oscillates bellow 50 mid line, . A bit like fixing the macd signal line to the rsi 50 mid line.
 
Can you offer any insights here or direct me to another indicator that oscillates like this.

« Last Edit: 30/08/2019, 01:25:34 PM by JohnR »

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 219
Re: Help with BCFL custom Scans & Coding
« Reply #92 on: 30/08/2019, 02:04:38 PM »
John,

We are happy to offer assistance with how to turn concepts in to BCFL where possible or explain why certains results come out, but suggesting the indicators and ideas for BCFL we leave to our users and the plethora of third party investment sites. Investopedia.com is probably the most popular for finding technical indicators.

To make a system can take many, many 1000s of hours and it is just outside the current scope of the business. Our Research and Developement team are dedicated with researching SPA3 and testing different ideas.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #93 on: 30/08/2019, 04:15:26 PM »
The upper  and downer oscillations of the  RSI mid line is the extension of the RSIMH I have been working on, and due to not being able to get a clean trending reading from the RSIMH group implementation I'm now looking to split the rsi oscillation between the above 50 for macd 100,50,30 main above signal, so that when the trend flips (up) in the macd indicator the rsi will report a crossing above the rsi 50 mid line giving a clear unambiguous signal.
So macd histogram values above the 50 line (macd main above signal) will vary from 50 to 100, I have noticed that the general height of macd main above signal line do not exceed an average value, observed in many stocks. So the value is definable of the oscillations of the RSI from 50 to 100. I just need a snippet of formula code to get started, which was my request to point me in the right direction for a cut n paste scrap.

To my thinking it would require the rsi 0 to 100 index to be subdivided in two an re expressed as 0 to 50 as -0 to -100 (macd main< signal ) and 50 to 100 as +0 to +100 (macd main > signal) for the rsi of the macd histogram to work within. But my formula expression building ability is limited to cut n paste from other indicator code to experiment with. Do you think the above explanation will work as a formula?

I've been through the many meta stock sites but as yet are unable to locate above formula description.
One formula I am looking at is the Moving Average Oscillator, but need to re express it through the macd histogram output in the RSI of the macd histogram :confused:
What I need is a Qudro indexed rsi :ehh:

maybe I'm over thinking this?
I mean already I'm dealing with the following MACD states plus four 6x2 additional rsi macd histogram states, why would I want to add another 4 rsi states??

MACDM1 := FMLVAR("MACD1","MACDM1");
MACDS1 := FMLVAR("MACD1","MACDS1");
MACDH1 := FMLVAR("MACD1","MACDH1");

MACDM2 := FMLVAR("MACD2","MACDM2");
MACDS2 := FMLVAR("MACD2","MACDS2");
MACDH2 := FMLVAR("MACD2","MACDH2");

MACDM3 := FMLVAR("MACD3","MACDM3");
MACDS3 := FMLVAR("MACD3","MACDS3");
MACDH3 := FMLVAR("MACD3","MACDH3");

{MACD STATES}
{MACD_1 -  RISING / FALLING}
MACDM1_UP := MACDM1 > REF(MACDM1, -1);
MACDM1_DN := MACDM1 < REF(MACDM1, -1);

{MACD_2 -  RISING / FALLING}
MACDM2_UP := MACDM2 > REF(MACDM2, -1);
MACDM2_DN := MACDM2 < REF(MACDM2, -1);

{MACD_3 -  RISING / FALLING}
MACDM3_UP := MACDM3 > REF(MACDM3, -1);
MACDM3_DN := MACDM3 < REF(MACDM3, -1);

{MACD STAGES }
{MACD_1 ABOVE ZERO - POSITIVE & NEGATIVE}

MACDM1_A0_UP1 := MACDM1_UP and MACDM1 > 0 and MACDM1 > MACDS1;
MACDM1_A0_DN1 := MACDM1_DN and MACDM1 > 0 and MACDM1 > MACDS1;
MACDM1_A0_UP2 := MACDM1_UP and MACDM1 > 0 and MACDM1 < MACDS1 ;
MACDM1_A0_DN2 := MACDM1_DN and MACDM1 > 0 and MACDM1 < MACDS1;

{MACD_1 BELOW ZERO - POSITIVE & NEGATIVE}
MACDM1_B0_UP1 := MACDM1_UP and MACDM1 < 0 and MACDM1 > MACDS1;
MACDM1_B0_DN1 := MACDM1_DN and MACDM1 < 0 and MACDM1 > MACDS1;
MACDM1_B0_UP2 := MACDM1_UP and MACDM1 < 0 and MACDM1 < MACDS1;
MACDM1_B0_DN2 := MACDM1_DN and MACDM1 < 0 and MACDM1 < MACDS1;

{MACD_2 ABOVE ZERO - POSITIVE & NEGATIVE}
MACDM2_A0_UP1 := MACDM2_UP and MACDM2 > 0 and MACDM2 > MACDS2;
MACDM2_A0_DN1 := MACDM2_DN and MACDM2 > 0 and MACDM2 > MACDS2;
MACDM2_A0_UP2 := MACDM2_UP and MACDM2 > 0 and MACDM2 < MACDS2;
MACDM2_A0_DN2 := MACDM2_DN and MACDM2 > 0 and MACDM2 < MACDS2;

{MACD_2 BELOW ZERO - POSITIVE & NEGATIVE}
MACDM2_B0_UP1 := MACDM2_UP and MACDM2 < 0 and MACDM2 > MACDS2;
MACDM2_B0_DN1 := MACDM2_DN and MACDM2 < 0 and MACDM2 > MACDS2;
MACDM2_B0_UP2 := MACDM2_UP and MACDM2 < 0 and MACDM2 < MACDS2;
MACDM2_B0_DN2 := MACDM2_DN and MACDM2 < 0 and MACDM2 < MACDS2;

{MACD_3 ABOVE ZERO - POSITIVE & NEGATIVE}
MACDM3_A0_UP1 := MACDM3_UP and MACDM3 > 0 and MACDM3 > MACDS3;
MACDM3_A0_DN1 := MACDM3_DN and MACDM3 > 0 and MACDM3 > MACDS3;
MACDM3_A0_UP2 := MACDM3_UP and MACDM3 > 0 and MACDM3 < MACDS3;
MACDM3_A0_DN3 := MACDM3_DN and MACDM3 > 0 and MACDM3 < MACDS3;

{MACD_3 BELOW ZERO - POSITIVE & NEGATIVE}
MACDM3_B0_UP1 := MACDM3_UP and MACDM3 < 0 and MACDM3 > MACDS3;
MACDM3_B0_DN1 := MACDM3_DN and MACDM3 < 0 and MACDM3 > MACDS3;
MACDM3_B0_UP2 := MACDM3_UP and MACDM3 < 0 and MACDM3 < MACDS3;
MACDM3_B0_DN2 := MACDM3_DN and MACDM3 < 0 and MACDM3 < MACDS3;

In fact, I will not be going down "the comprehensive system rabbit hole", but simply using a MA60:90 or MACD 120,260,90 above signal and above zero line, and not bother with any other variations of the states. KISS is the example you have set with SWS SPA3 Trader, although maybe a bit too generalised i.e. far too may moderate to even trades making it a full time job watching to see if they look like turning into limp biscuits, but what does make the SPA3 system work is the 'trade with the pack' approach that seems to help after day or two. Maybe I'm reflecting on a very difficult period to trade when so many sectors are high risk? and nothing seems to be moving.

I might add; it's all very good selling a long term approach to investments like 20 year future equity curve time frame approach to a portfolio, but if you are looking at retirement down the barrel (and who isn't) with smallish superannuation then you really need to optimise whatever tools you have bought into. And that's the real kicker here; optimisation of the trade within system parameters to keep it safe, being able to get enough from the trade to have fortnightly expenses income, as well as optimised trades for growth, because it's what I'll be living off until pension age; the scalping of profits for income while letting the better trades run for growth. Now if I had 400K plus at this time then I could do both; have solid income and bank 1 to 2 baggers for redeployment. Not everyone is in this position,  I think most people? This is why I persist with optimisations.
« Last Edit: 30/08/2019, 07:58:30 PM by JohnR »

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 219
Re: Help with BCFL custom Scans & Coding
« Reply #94 on: 03/09/2019, 01:15:14 PM »
Quote
I'm now looking to split the rsi oscillation between the above 50 for macd 100,50,30 main above signal, so that when the trend flips (up) in the macd indicator the rsi will report a crossing above the rsi 50 mid line giving a clear unambiguous signal.

You may need to clear up the intentions here. It is very difficult to follow the specific chain of events you are looking for and what is going to be achieved by piecing together different elements of logic. Without the concise concept, it would be difficult to write up what you are trying to find. 

The CROSS(give me a signal when this, goes above this number or other indicator) which we have discussed before is the closest fit for what you are trying to find from what I can gather. That is when one value goes above another. It may be the key words here are when the RSI goes above 50 so:

Signal1 := CROSS(RSI_Function, 50);
Signal;

Quote
So macd histogram values above the 50 line (macd main above signal) will vary from 50 to 100, I have noticed that the general height of macd main above signal line do not exceed an average value, observed in many stocks. So the value is definable of the oscillations of the RSI from 50 to 100. I just need a snippet of formula code to get started, which was my request to point me in the right direction for a cut n paste scrap.

What exactly in this 50 to 100 range are you looking for though?

Quote
To my thinking it would require the rsi 0 to 100 index to be subdivided in two an re expressed as 0 to 50 as -0 to -100 (macd main< signal ) and 50 to 100 as +0 to +100 (macd main > signal) for the rsi of the macd histogram to work within. But my formula expression building ability is limited to cut n paste from other indicator code to experiment with. Do you think the above explanation will work as a formula?

This seems like you are multipying out ranges, but there is little use in doing so if you know where to target and you can define what threshold you are interested in. BCFL is full of little building blocks, you can use them best if you can define the logic first of what you are trying to do.

The key concept of SPA3 is having trust in the edge. We have trust that ours is proven to work, over many trades, based exactly on that long term equity curve. It may be worth having a discussion with David M here in the office about your reservations on SPA3 after looking through the 1st video here: https://learn.sharewealthsystems.com/courses/331967/lectures/10469997 .

In brief, we believe that you will still need to be an investor during retirement and that is when most of the returns to pay for life expenses are made. Most retirements based on life expecteancy, will be 20 years or thereabouts.

Within the last financial year, our public portfolis for SPA3 Trader provided at 23.64% return. Of course there would be given variation for each investor, but having trust in the edge should not be a full time job. Yes, it may not be perfect and there is highly likely room for optmisations, but it should be in the balance of time spent identifying then implementing where those improvements are.

You will never find a system that works in all market conditions 100% of the time or even close to it. The purpose of looking at the history of a system and looking over different time periods is to ensure it is acceptably robust through multiple market conditions. To trust that it will come out the other end without having any grevious drawdown an investor may not be able to handle. Trying to find the best system for any given moment in the market, is an extremely tough job.

Again, happy to help, but there should be a defined end game and process for what you are trying to achieve. The best way to do this is list out step by step how each signal should come about. What precise criteria is needed? Then you look at the functions or tools in BCFL that can help get to that result.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #95 on: 03/09/2019, 03:44:01 PM »
Well that is exactly what it is that I'm doing EXPLORING options within the tool set.
I have the RSIM as best as I will ever achieve without exploring formula code (don't have the time to dig deeper into math equations at this point).

Having done the RSI I have moved onto other set ups like doing medians of two indicator sets to balance out the jerkiness of one over the other. This is a piecing together bits and pieces exploration of which I will need feedback on to achieve the objective of optimising SPA3 Trader trades once they are initially signaled and acted on or sent to watch lists. Median calcs are where I found the Bressert DSS oscillation above 50 for trending and jumps below 50 for non trending (based on MA 60:90 observations), and am trying to apply that oscillating type to other set ups like siroc and rsi of macd, and this is also an extension of the macd histogram the way it makes lower highs or gives divergence readings as the trend cycle shuts down.

Don't get me wrong I am developing trust in the system, more so now, for implementing different trade choices that I would never had exposure to, it's a good way to find stocks to trade, and to have built in safety systems. But I feel these trades still need optimisation for critical exit points and re-entry points when the underlying trend remains intact for the MA 60:90. This is my underlying objective for all BCFL efforts. Just have to make this clear so as to not introduce confusion as to where I'm going with it all.

Quote
Within the last financial year, our public portfolis for SPA3 Trader provided at 23.64% return
You seem to be satisfied with this outcome, would you think improving this level of return could be of benefit? I would like to see upside of 60% through better capture of entry and exit points, longer trend duration holdings and action point timings. I don't believe one indicator approach will be sufficient though.

I'm finding my own scans less reliable without implementing more SPA3 parameters to nail the MA 60:90 and MACD medium and longer setups (I'm primarily using to find crossing for new potential trends and relying on to identify trend duration). These two indicators alone are the backbone of everything I'm doing in BCFL, as moving averages they are also close enough to price action. If I can set up a scan to find in advance future SPA3 trades, and have trust in that scan, then it will be worthwhile exploring.

Within that process of 'logic' I'm learning to trust the SPA3 Trader and Investor systems, but feel a blend of SPA3 Trader into the SPA3 Investor open trades could produce a better edge. I will look into this once I have a stable of custom indicators set ups for the faster SPA3 Trader system (almost there). This is not something I am doing consistently every day, sometimes I'm to lazy to bother and just go with the flow of SPA3 exits and entry signals and Market risk profiling, but have been day trading some high risk stocks from both systems over the last few weeks.

As for the ATR-TS indicator set I was looking at I can't see this working due to the nature of the ATR-TS reversals jumping up and down above price line, but had to explore the formula sets to see if I could draw out one output from two inputs.

Having the RSIM out of the way I'm now looking at percentage above a signal line to primarily identify overbought and oversold conditions (which was what the RSIMH was all about: macd short histogram (for the leader of the MACD main line) tracked through the RSI). I can see how this percentage high and low states could be a very useful technique if a signal system can by implemented.
The RSI does this already in a way and so does the stochastic, (which I have blended through a median formula for one F key setup), the Moving Average Oscillator is now my focus, and I want to get a readout on the chart to highlight what the % above the reference line is, because it rarely gets higher than +10 and -10 on the index within trend, and to signal for these higher peak zone ranges.

This formula code can then be applied to other indicator like ATR-TS's Moving averages to compare % range readouts on the chart, and in scans and scan results, so as to mentally focus on the price panel for less distraction. I will get back to you on this later when I have enough code explored.

I have a bunch of oscillators now that have interbred with each other to produce some very good indicator overlay sets.

[Edit 6/9/19]
What I don't understand, and is the thing I would like not to be closed out from within the system is this happening (in attached image), and I see it often enough in charts to want to fix it with my own indicators and scans. But this does introduce all sorts of complications of having to scan a dual system of watch lists and scans for out of system re-entries further pyramids, lightens and exits. See attached chart of asx.AZJ.
What would cause this gap in SPA3 Trader signals; could it be attributed to volume or indicator? Clearly the trend remains in tact and 'in the zone'.




« Last Edit: 06/09/2019, 12:25:52 AM by JohnR »

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #96 on: 05/09/2019, 09:37:10 AM »
Hi Campbell,
not sure if you can deduce from this scrap of formula line, if so is the int value required to be the same as the other two values for the formula to be 'balanced' or is it possible to use a lower value.
for example:
RSIPeriod:= Int( 13 / (Stdev( C, 13 ) / Stdev( C, 13 )));

or lower value:
RSIPeriod:= Int( 8 / (Stdev( C, 13 ) / Stdev( C, 13 )));

thanks.
« Last Edit: 05/09/2019, 10:18:35 AM by JohnR »

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #97 on: 11/09/2019, 10:59:20 AM »
Hi Campbell,
Wanting to implement the Swing Chart indicator in BCFL, is the formula available?

In relation to above; I put the Zig Zag from BCFL into a chart but the output gives a flat line:
ZIGZAG :=  zig( CLOSE, 3, % )  or zig(HIGH, 5, %);
ZIGZAG;

Is there something I'm missing here?
EXAMPLE                  zig( CLOSE, 3, % )  or zig(HIGH, 5, PERCENT)

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 219
Re: Help with BCFL custom Scans & Coding
« Reply #98 on: 11/09/2019, 04:57:06 PM »
Hi John,

Re: AZJ

This comes up quite a bit with customers, even ones who have been around for a while. The simple answer, which is the right one, is that the sell signal is a profit stop. This profit stop over a large sample of trades, over many portfolios in our simulations resulted in better portfolio equity curves than not having them. They are a challenging stop because the times it benefits are rarely noticed, they just look like reasonable places to have exits. It allows the capital gained from the trade to compound in another position elsewhere.

By not having a profit stop, there would have been an exit on the signal of high market risk (5th August). The re-entry is based on where the indicators are and which patterns of the SIROC and EMA form for a valid entry signal.

Hi Campbell,
not sure if you can deduce from this scrap of formula line, if so is the int value required to be the same as the other two values for the formula to be 'balanced' or is it possible to use a lower value.
for example:
RSIPeriod:= Int( 13 / (Stdev( C, 13 ) / Stdev( C, 13 )));

or lower value:
RSIPeriod:= Int( 8 / (Stdev( C, 13 ) / Stdev( C, 13 )));

thanks.

Possible to use a lower value. As long as the formula saves it is valid usage of the functions within the formula. You can always 'Save As' a given concept and play around with it if you don't want to lose the original base point.

Hi Campbell,
Wanting to implement the Swing Chart indicator in BCFL, is the formula available?

In relation to above; I put the Zig Zag from BCFL into a chart but the output gives a flat line:
ZIGZAG :=  zig( CLOSE, 3, % )  or zig(HIGH, 5, %);
ZIGZAG;

Is there something I'm missing here?
EXAMPLE                  zig( CLOSE, 3, % )  or zig(HIGH, 5, PERCENT)

The Swing Chart indicator itself - no. It has a lot of customisations that are not suited to a general function for BCFL, such as ignoring inside bars at times. A peak / trough metastock formula will do a similar job, like the one below which I have on hand.

{ User inputs }
change:=3;

{ ZigZag }
diffHi:=H-Ref(H,-1);
diffLo:=Ref(L,-1)-L;
x:=If(diffLo>diffHi,L,H);
zzPer:=Zig(x,change,%);

{ Plot on price chart }
zzPer;

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #99 on: 12/09/2019, 12:29:27 AM »
Great. I'm primarily looking for an HHV and LLV type setup, the BC swing chart fits the precision looking back over the charts. I had a look at some zig-zags but couldn't find anything that worked to expectation.

On closer look I doubt the Swing Chart would work as it lags recent price and takes periods to fill, although I've read it can be combined with macd to fill the last periods data, so if macd maybe another type indicator too. If this is the case then the last period could be used to indicate a rising or falling from recent low swing point (but I guess that's what recent bars are doing anyway), it has my interest.

The zig-zag-macd one I found here(http://trader-online.tk/MSZ/e-w-ZigZag_Combining_With_MACD.html) won't save in BCFL for a bracket missing, have been over it a number of times to find where without any success so far, and won't bother you to trouble shoot it, I should exercise my bracket closure skills.

Have searched high and low last few days to find a swing chart that works close enough to the BC one without any success. So will add your m.s. code in and see what can be done.
The Williams is an interesting indicator set pegging the highs and lows sufficiently enough but jumps around too much, so have been attempting smoothing of all sorts to tame it down. Want to do a median with another indicator with it utilising the extreme high and lows for pin pointing with more precision the very oversold buy in points and sell points that will be the money maker of the trade. Iv'e always said; some traders are hitting the lows and highs with a surgical precision that has eluded me.

Will search 'peak / trough metastock formula' , and thanks for the code.

Just a quick question re the SPA3 Investor scans; As I 'll be shifting my attention to doing scans, more so now my indicator sets are done, I was looking for a way to identify all currently 'open' status Investor stocks (and also SPA3 Trader open status stocks), as it seems the scan profiles look for trigger events and dates, not status, am I missing something? 
I will need to introduce custom columns into scan results to identify from all open status Investor and Trader stocks scanned into watch lists the percentage of price move from the initial SPA3 scan trigger dates.
The scan will be ongoing to the same watch lists (x2), eliminating closed stocks as they are closed out of the system. I want to identify strong trending stocks via the percentage price move from initial trigger dates. Does this seem a reasonable way to identify performance stocks?

Cheers.
« Last Edit: 12/09/2019, 11:38:13 AM by JohnR »

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 219
Re: Help with BCFL custom Scans & Coding
« Reply #100 on: 12/09/2019, 05:05:55 PM »
It is not possible right now to systematically find all open / closed positions. It has not been programmed in that way to Beyond Charts as the function of the system is to follow signals as they appear. So it is only possible via the Alerts App and only for SPA3 Investor. We do know that people interested in open positions, that they have maintained their own watch list in the past. 

Managing your own watch list of open positions does actually interface with BCFL though which is good news.

SHOWCOL(); is a function that lets you define what columns appear in the scan results. Here is a direct link of a quick primer I made at the time of release: https://www.youtube.com/watch?v=BhxpK4ZejnM

What is not covered is that SHOWCOL(); also has a special function of sorts called "WL Name". If you run a BCFL scan over a formula with this line at the end (on its own):

SHOWCOL("DEFAULT", "WL Name");

You will get the usual BCFL result columns, but "WL Name" will tell you which Watch List it comes from. So if you maintain the watch list and find a way to manage them, you can use these watch lists as the items the BCFL scan looks over and Beyond Charts will tell you which list the stock comes from.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #101 on: 15/09/2019, 12:51:50 PM »
Ok the above gets a foot in the door for the potential of scan result custom columns. Watch list identification isn't one of my priorities for scan results as all the daily 21:8 New Entry scans go into the same watch list.
I could use that scan when scans are drawn from multiple watch lists, maybe for identifying non performing stock scans based around an indicator.

I'd like to scan for % gain compared to close (x) periods back or from date of adding to a watch list with percentage added to a column in the scan results, ( I understand the database does not link this data currently), to identify stocks that are gaining in percentage price increase in scan list, as apposed to eyeballing dozens of charts every day.

The point made is the BC Watch Lists do not link in the database the date when added to, or link date to percentage increase since adding to watch lists (extra DB Table with a few relationships?), like how Trade Master does, (and something I have requested in future release for Beyond Charts watch lists), to get a quick visual idea if the item previously triggered in a SPA3 21:8 scan and now in a watch list, has risen or fallen by percent since adding it.
It would be an efficient way to track stocks without having to resort to eyeballing dozens of charts and reference indicators every day/week.
« Last Edit: 16/09/2019, 12:49:20 PM by JohnR »

Offline JohnR

  • Jr. Member
  • **
  • Posts: 63
Re: Help with BCFL custom Scans & Coding
« Reply #102 on: 18/09/2019, 06:27:05 PM »
Ok, had time to think out a few scan column additions; one for % rises over several days (see Formula 1 sample).
A scan for indicating duplicate entries within watch lists,
One for identifying non performing watch list entries via an indicator main less than signal report in columns. This will save time going through charts, but will still have to remove them from watch lists manually.
The above non-performing indicator scan works well with SHOWCOL("DEFAULT", "WL Name"); to identify the watch list that have stocks within that are not MACD or MA positive. One down two to go.

I'm not able yet to author my own formulas, the best I can do is cut and paste from elsewhere, so might need some help, sorry.
Are there any other special functions for SHOWCOL() ([EDIT] I see from the BCFL library descriptions the data sheet 'Column Chooser' list is the source),
How would I add a formula result to display in a column, are there any example code of this, adding a formula output doesn't seem to work.

First up; found this formula will have to adapt to BCFL.
Formula 1:

{Performance Daily}
{Stocks sorted on % gains over 1, 2, 3, 4, and 5 days. Rank results for the selected day. Good for finding breakout stocks.}
{Performance Daily}
Stocks sorted on % gains over 1, 2, 3, 4, and 5 days. Rank results for the selected day. Good for finding breakout stocks.
CLOSE
ROC(CLOSE,1,percent)
ROC(CLOSE,2,percent)
ROC(CLOSE,3,percent)
ROC(CLOSE,4,percent)
ROC(CLOSE,5,percent)


My first attempt to BCFL it up:
{Performance Daily}
TODAY := (CLOSE/OPEN) *100;
DAY_1 := (REF(CLOSE,-1) / CLOSE)*100;
DAY_2 := (REF(CLOSE,-2) / CLOSE)*100;
DAY_3 := (REF(CLOSE,-3) / CLOSE)*100,;
DAY_4 := (REF(CLOSE,-4) / CLOSE)*100;
DAY_5 := (REF(CLOSE,-5) / CLOSE)*100;

VDT := VOLUME;
VD1 := REF(VOLUME,-1);
VD2 := REF(VOLUME,-2);
VD3 := REF(VOLUME,-3);
VD4 := REF(VOLUME,-4);
VD5 := REF(VOLUME,-5);

ShowCol("DEFAULT","VDT","TODAY")
ShowCol("DEFAULT","VD1","DAY_1")
ShowCol("DEFAULT","VD2","DAY_2")
ShowCol("DEFAULT","VD3","DAY_3")
ShowCol("DEFAULT","VD4","DAY_4")
ShowCol("DEFAULT","VD5","DAY_5")

-> There is no function defined. Please define your function with valid arguments


I take it the SHOWCOL() in BCFL isn't the sames as metastock filtercol code : https://www.meta-formula.com/Metastock-Explorers-Formula.html
« Last Edit: Today at 01:53:45 PM by JohnR »

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 219
Re: Help with BCFL custom Scans & Coding
« Reply #103 on: Today at 02:43:46 PM »
Hi John,

Based on the formula, this is how I would do it:

{Performance Daily}
{Stocks sorted on % gains over 1, 2, 3, 4, and 5 days. Rank results for the selected day. Good for finding breakout stocks.}
TODAY := (CLOSE/OPEN) *100;
DAY_1 := ROC(CLOSE,1,%);
DAY_2 := ROC(CLOSE,2,%);
DAY_3 := ROC(CLOSE,3,%);
DAY_4 := ROC(CLOSE,4,%);
DAY_5 := ROC(CLOSE,5,%);

VDT := VOLUME;
VD1 := REF(VOLUME,-1);
VD2 := REF(VOLUME,-2);
VD3 := REF(VOLUME,-3);
VD4 := REF(VOLUME,-4);
VD5 := REF(VOLUME,-5);

Output := 1;
Output;
ShowCol("DEFAULT",VDT,TODAY,VD1,DAY_1,VD2,DAY_2,VD3,DAY_3,VD4,DAY_4,VD5,DAY_5);

SHOWCOL() is our own little addition. You need Output := 1; Output as the formula needs a reason to put the stock in the results grid.

If you wanted to add a column you can add to the datasheet by right clicking a header -> column chooser such as GICS Industry, it would look like this:

ShowCol("DEFAULT",VDT,TODAY,VD1,DAY_1,VD2,DAY_2,VD3,DAY_3,VD4,DAY_4,VD5,DAY_5,"GICS Industry");.

You do not need "DEFAULT" either if you want to remove some columns. This is perfectly valid to have. It gives you the calculations you want on the results screen with only mandatory columns which are the Security Code, Security Name and Exchange it's listed on. It is good in case you have a lot of columns and want to reduce to as few as possible.

ShowCol(VDT,TODAY,VD1,DAY_1,VD2,DAY_2,VD3,DAY_3,VD4,DAY_4,VD5,DAY_5);