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

0 Members and 1 Guest are viewing this topic.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #120 on: 18/12/2019, 10:31:26 PM »
Yes to be specific, the Incredible Charts Comparison type setup, but only with the XDJ index snapped into single charts in BC, so I can judge how far above, equal to, below, each stock in the list is compared to the XDJ / XAO index.

Quote
Execution wise it appears to be a series of moving averages and if that hunch is right you may not need BCFL, but I cannot see the specifics on what you are trying to replicate.
I would like to get a price chart overlay intercept for: Security("$XDJ.XASX", C) if it can be done through BCFL code, and then saved to a function key, so that it intercepts each stock I review from the left hand side.

If I use moving averages for the index, what would be the best direction to take to get an intercept working like you see in I.C.
Overlaying a Formula indicator, set as a moving average doesn't link the two different indexes; price and base index level, and resultant price chart will look squished to allow for the higher index.

So normalising the two data sets is the fist step? matching one data set to the others index level automatically as an overlay overlaid, at the chart window loaded data start period, or at a specific point in time like 4 weeks ago.

Could 'Value When' have some importance?
[Lookup & Reference]
Returns the value of the DATA ARRAY when the EXPRESSION was TRUE on the Nth most recent occurrence.
This includes all data loaded for the security according to the PERIOD selection on the CHART tab.
SYNTAX                      valuewhen(Nth, EXPRESSION, DATA ARRAY )

I was thinking the RSC could be the way in to normalising data to the sector or index used in the code, but when I set up two RSC's in the one formula the second one didn't plot out, or no output. Not sure why. I might try this again tomorrow.

One thing I have noticed is that the reference index ($XDJ) represents as almost a flat linein IC's charts much like a MA / Envelope set to 500 or so.  If the MA could be the actual XDJ line and matched to a data time period point.
I guess its all about the breakout range from the envelopes set at 15% or whatever, so just a moving average envelope might do? as that out sets itself on each chart. need to think this out more. I have a % above a MA line code for an indicator, might set it to 500 and see if it works similar to IC's Comparison.

As far as I can find there isn't a lot on normalising data sets in Metastock there being only one post on their forum about it, and I'm not sure what its about.
https://forum.metastock.com/posts/t144349--Normalized--Relative-Strength-Comparative

The best I can do is search for others formulas, and by asking questions here. Much of the formula I'll be cut and pasting from others work, if I can find something substantial enough to use.

Post Edit:
Just as a final edit to this post; I have worked the Moving Average Envelope up with the Percent Above MA indicators (Separately, see attached snapshot). If the Moving Average 500 were to actually be the XDJ index line, this would work as a comparison to index. But I can't get my head around how to link the one to many index scales. 'One' being the XDJ, the 'many' being the stock price data charts.
Code here. I tried adopting the RSC code into the MA but didn't work:
> - - - - - - <

{ RSC }
COMP1 := Security("$XDJ.XASX", CLOSE);
RSC1 := (CLOSE / COMP1){*1000000};

MA1 := MOV(CLOSE,500,E);
{ McGinley MA }
MA2 := Ref(Mov(C,60,E),-1)+((C-(Ref(Mov(C,60,E),-1))) / (C/(Ref(Mov(C,2,E),-1))*10));

{ MA Envelope Bands }
Band_upper_inner := Mov(MA1, 1,E) + 0.5;
Band_lower_inner := Mov(MA1, 1,E) - 0.5;
Band_upper_outer := Mov(MA1, 1,E) + 1;
Band_lower_outer := Mov(MA1, 1,E) - 1;

MA1;
MA2;
Band_upper_inner;
Band_lower_inner;
Band_upper_outer;
Band_lower_outer;

> - - - - - - <

This MA1 code doesn't reflect the price chart accurately enough.

{Percent Above/Below Moving Average}
MA1 := ROC(CLOSE, 500, %);
MA2 := MOV(MA1, 50, E);

LINE1 :=0;
LINE1_UP:=50;
LINE1_DN:=-50;

LINE2_UP := 100;
LINE2_DN := -100;
MA1;
MA2;

LINE1;
LINE1_UP;
LINE1_DN;

LINE2_UP;
LINE2_DN;

> - - - - - - <

First Image is of code above in BC.
Second Image IC chart of MP1 and 500EMA bands with Comparison $XDJ
Third Image is the $XDJ with EMA500 Bands and comparison MP1.

I don't think the third will work in BC to flip through stock charts as you can't load in comparison stocks like in I.C. , but the Second would so is my preferred layout, if I can get the MA Bands to fit to the index line not the price chart.
« Last Edit: 19/12/2019, 09:16:57 AM by JohnR »

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #121 on: 19/12/2019, 10:59:40 AM »
Have found a code for Normalising but not surprisingly it doesn't plot out anything.
Could this be fixed and adapted to the
COMPARISON:= Security(SECTOR, CLOSE);
RSC:= (CLOSE / COMPARISON)*1000000;
code?

{ Moving Average Low Normalized Value }
Periods := Input("Time Periods", 1, 1000, 55);
BaseLow := Mov(LOW,Periods,E);
K := (1+((LOW-BaseLow)/BaseLow))*LastValue(BaseLow);
K;
LastValue(BaseLow);

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 249
Re: Help with BCFL custom Scans & Coding
« Reply #122 on: 20/12/2019, 02:39:54 PM »
there is so much thoughts being recorded here, it is hard to tell what is an honest question and what is a tangent thought, but I will do my best to help direct where I can.

Yes to be specific, the Incredible Charts Comparison type setup, but only with the XDJ index snapped into single charts in BC, so I can judge how far above, equal to, below, each stock in the list is compared to the XDJ / XAO index.

I would like to get a price chart overlay intercept for: Security("$XDJ.XASX", C) if it can be done through BCFL code, and then saved to a function key, so that it intercepts each stock I review from the left hand side.

I can help convert an idea in to BCFL if it is well defined what is trying to be achieved. Saying that we do not write formulas ourselves, in these cases we can point in the right direction & provide some guidance.

What is the intercept you are looking for in terms of how it is calculated? It does not mean much to me as a word on its own so I make a few assumptions from here on in. I am assuming it's the same function I linked to on the previous post.

I will mention it is not always the best move to use BCFL for the sake of using BCFL and I cannot really provide much direction if it is not clear what the requirements are. Right now it is 'an intercept with $XDJ from the left hand side'. What is the left hand side? I am assuming from now on, from the 1st bar of the chart.

Quote
If I use moving averages for the index, what would be the best direction to take to get an intercept working like you see in I.C.

This is something you will need to work out and decide because it all depends how you want to decide the intercept is found.

From the link in my last post, the formula is clearly attributed:

Quote
The Price Comparison line is calculated using the ratio of closing price to that of another security/index, on the first day of the chart. This means that the starting point of the Price Comparison will vary according to the Time Period selected. The line may appear to move if you change time periods; but the slope remains the same.

Price Comparison (Intercept) performs a similar calculation, but on a selected date. If no date is selected, the earliest possible date is used. If the date selected is not a trading day, the next trading day is taken as the intercept date.

This is why I talked about charts starting on different dates, how the formula is done over each bar and how this will need to be taken in to consideration. This is not an insignificant piece of code. If you want to take it to a scan as part of your process, you will need to untangle the net on how you not only make sure the price is being adjusted appropirately in a way you are happy with, but also that the intercept is happening on the correct date.

Quote
So normalising the two data sets is the fist step? matching one data set to the others index level automatically as an overlay overlaid, at the chart window loaded data start period, or at a specific point in time like 4 weeks ago.

Could 'Value When' have some importance?
[Lookup & Reference]
Returns the value of the DATA ARRAY when the EXPRESSION was TRUE on the Nth most recent occurrence.
This includes all data loaded for the security according to the PERIOD selection on the CHART tab.
SYNTAX                      valuewhen(Nth, EXPRESSION, DATA ARRAY )

Value When gives you back the DATA ARRAY (ie. close price) the for the last N time some criteria is met.

If you are looking to normalise an intercept, the starting point is trying to grab the relevant price for the relevant intercept point and make sure it matches the underlying chart it is being applied to.

In that mind, it could if you structured it right. You want the close price for $XDJ on te 1st time that $XDJ was the 1st day of the underlying chart it is being applied to.

Have a look in to the DAY, MONTH and YEAR methods to try and select dates. Remember that you know you are on the 1st bar of a chart when the function CUM(1) equals 1.

Quote
The best I can do is search for others formulas, and by asking questions here. Much of the formula I'll be cut and pasting from others work, if I can find something substantial enough to use.

I want to mention without going in to the details here as the office is closing today and I won't be back until at least the 6th Jan - this does come back to the type of intercept you are looking for and what type of indicator you are trying to create. Otherwise it becomes in to one big guessing game on what you are trying to achieve.

Personally I think this line of thinking is way too over the top for what your charts actually depict is happening. Are you sure the comparison is relative strength and not just pulling the normalised data from another chart?

Beyond Charts overlays are a 1 to many relationship. It is 1 overlay object that can apply to many different charts, with the inputs being largely the same chart to chart but the price action data like open / high / low / close are obviously unique.

You would want anything you create to be flexible from this point of view.

I would suggest to work out exactly what Incredible Charts is calculating or finding a relevant support page for the function, find the formula than try and work from there.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #123 on: 27/12/2019, 03:05:33 PM »
Merry Christmas!  Happy new year! :wave:

I have done a ROC % comparison, although not sure if the comparison works as it should for direct comparison to a security for the relevant sector index. Clearly not as you haven't mentioned ROC % as a method of comparison in any of the  posts I made about it. The difference between the I.C. fixed starting point (3 years) is evident when comparing the two apps charts (see attached images).
I would like to get a price fixed together at a specific date period 'input' to 3 months, or 1 year, or whatever input date selected to use, I'll work this up over the break.

Feedback appreciated.

INDEX_IN := Security("$XDJ.XASX", C);
ROC_INDEX := ROC(INDEX_IN,126,%);
ROC_INDEX;

SECURITY_IN := CLOSE;
ROC_SECURITY := ROC(SECURITY_IN,126,%);
ROC_SECURITY;

{ Envelope Bamds }
MA1 := MOV(ROC_INDEX,21,E);
MA1;

{ Envelope Bamds }
Band_upper_inner := Mov(MA1, 1,E) + 15;
Band_lower_inner := Mov(MA1, 1,E) - 15;
Band_upper_inner;
Band_lower_inner;
« Last Edit: 27/12/2019, 03:33:17 PM by JohnR »

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #124 on: 29/12/2019, 01:25:19 PM »
Wondering how to use the Data Window column "Market Cap" data in BCFL to get a daily volume to market capitalisation ratio for a column in scans?

Strange that Volume (Vol) is referenced but not listed in the BCFL Library for Look Up & Reference.
And what other non-listed reference-able entries would there be?
Thanks.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #125 on: 14/01/2020, 01:45:55 PM »
Re the ATR TS problem:
I found this light weight ATR-TS, it works well for scans unlike the previous one which slowed scans and chart loading down greatly.
But there is a corruption with the system ATR-TS when it is auto loaded into a chart, they are named differently (changed name to see if that helped it didn't so must be a code corruption), haven't tried to fiddle with the code as it's way beyond me. It might be just adding smoothing in there  that might help? I read somewhere that lots of 'PREV' in code slows Metastock down.

Basically the chart corrupts like a BCFL code fmlvar renamed reference does. only way to recover chart is to close it and reopen a new one without the system ATR_TS auto loaded.

Code here:

{ ATRTS NEW }
loss:= 3.75*ATR(10);
ATRTS:=If(C>PREV AND Ref(C,-1)>PREV,Max(PREV,C-loss),If(C<PREV AND Ref(C,-1)<PREV,Min(PREV,C+loss),If(C>PREV,C-loss,C+loss)));
ATRTS;

thanks in advance.

 

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 249
Re: Help with BCFL custom Scans & Coding
« Reply #126 on: 15/01/2020, 12:26:34 PM »
Merry Christmas!  Happy new year! :wave:

I have done a ROC % comparison, although not sure if the comparison works as it should for direct comparison to a security for the relevant sector index.

 Clearly not as you haven't mentioned ROC % as a method of comparison in any of the  posts I made about it. The difference between the I.C. fixed starting point (3 years) is evident when comparing the two apps charts (see attached images).
I would like to get a price fixed together at a specific date period 'input' to 3 months, or 1 year, or whatever input date selected to use, I'll work this up over the break.

Feedback appreciated.

Happy new year John. Sorry about the delay.

I do often try to make this clear but Rate of Change is a form of relative strength [analysis] that is self-referencing, in that it tells a story about how that particular chart is performing. Relative Strength is a broad time even in technical analysis: it is a group of indicators that do a certain thing (provide a relative measure of strength) and a way of describing analysis or asking a question over a particular set of data.

Relative Strength Comparison compares an underyling chart to a chosen chart that is set as a paramater for the RSC indicator.

What you are asking for is not Relative Strength or Rate of Change (these do not normalise prices on a given day) but base reference and examples are over the previous posts.

Quote

INDEX_IN := Security("$XDJ.XASX", C);
ROC_INDEX := ROC(INDEX_IN,126,%);
ROC_INDEX;

SECURITY_IN := CLOSE;
ROC_SECURITY := ROC(SECURITY_IN,126,%);
ROC_SECURITY;

{ Envelope Bamds }
MA1 := MOV(ROC_INDEX,21,E);
MA1;

{ Envelope Bamds }
Band_upper_inner := Mov(MA1, 1,E) + 15;
Band_lower_inner := Mov(MA1, 1,E) - 15;
Band_upper_inner;
Band_lower_inner;

All I can really talk about is what it does. The ROC_Index being above than ROC_Security is saying if the sector has moved up quicker (in terms of its own previous values) than the security (in terms of its own previous values) over the last 126 days. You can read more on Rate of Change here: https://www.investopedia.com/terms/r/rateofchange.asp

Then there are some moving average bands based around the calcuation. I cannot say if this is wrong or right.

Quote
Wondering how to use the Data Window column "Market Cap" data in BCFL to get a daily volume to market capitalisation ratio for a column in scans?

Strange that Volume (Vol) is referenced but not listed in the BCFL Library for Look Up & Reference.
And what other non-listed reference-able entries would there be?
Thanks.

I am assuming that you mean the data sheet table or the share information panel and not the data window which shows values on the chart. Market Cap is inaccessible as something to be played around with in BCFL as it is fundamental data. You can add it to the scan results by including it in SHOWCOL() which I talked about a few months ago.

Volume is not in the reference list as it is an input to functions as part of the selectable Data Array options (which are O / H / L / C / V). Only functions are on the lookup table.

Quote
Re the ATR TS problem:
I found this light weight ATR-TS, it works well for scans unlike the previous one which slowed scans and chart loading down greatly.
But there is a corruption with the system ATR-TS when it is auto loaded into a chart, they are named differently (changed name to see if that helped it didn't so must be a code corruption), haven't tried to fiddle with the code as it's way beyond me. It might be just adding smoothing in there  that might help? I read somewhere that lots of 'PREV' in code slows Metastock down.

Basically the chart corrupts like a BCFL code fmlvar renamed reference does. only way to recover chart is to close it and reopen a new one without the system ATR_TS auto loaded.

Code here:

{ ATRTS NEW }
loss:= 3.75*ATR(10);
ATRTS:=If(C>PREV AND Ref(C,-1)>PREV,Max(PREV,C-loss),If(C<PREV AND Ref(C,-1)<PREV,Min(PREV,C+loss),If(C>PREV,C-loss,C+loss)));
ATRTS;

thanks in advance.

PREV is a very sensitive beast and we usually do not point peoples attention towards it. It is a function that takes no inputs, because it grabs the last value for that variable on the chart. So every time you say PREV, the software has to recalculate what that value is and stick it in memory to calculate that bar.

Sometimes finding what that value is will not be possible depending how it is used, which in those situations can cause corruptions. It is something you do have to understand to get the most out of it.

The function you provided works fine in my Beyond Charts. What auto load on the chart may be from an earlier instance. What happens when you drag it on to a clean chart (nothing loaded) from the Formula Explorer on the left hand side?

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #127 on: 15/01/2020, 11:58:44 PM »
Understood about the ROC % comparison, I'm still trying to solve a formula to get a normalised syncing of Sector and stock/s let alone to a specific date period. You mention a number of times "previous post" are you indicating there is something I have overlooked? maybe in Reply #122?
- Whilst on ROC, I have noticed some trades in the SPA3 Portfolio - Risk Profile 1, that the ROC 126% is bellow zero and the RSC for sector is below the 30 signal line. ORA and GGG being the stocks, I was thinking the ROC and RSC were a qualifying factor for stock selection being positive?

Re the column Chooser fields;  sorry I did mean the Column Chooser fields () that can be called in BCFL under ShowCol() I was wondering how to call them into the formula much like a FMLVAR(). Wanting to assess Market Turnover as a ratio of Market Cap for a scan column. I don't quite understand Fundamental data being prohibited in BCFL.

Quote
The function you provided works fine in my Beyond Charts. What auto load on the chart may be from an earlier instance. What happens when you drag it on to a clean chart (nothing loaded) from the Formula Explorer on the left hand side?
The problem is not so much the system ATR_TS when loaded onto a clean chart, and the custom ATRTS is loaded in, they works fine together.

But more when the ATRTS is saved to a function key from the right hand Overlay panel, when dragged onto the chart it corrupts the chart.

It appears the stand alone Overlay of custom ATRTS works with system ATR_TS, but it is when a combination of other formulas saved in the Overlay panel the corruption occurs.

If the chart is already loaded with the Overlay panel indicators in the chart without the system ATR_TS loaded, and then the SPA3 Investor button is selected the system ATR_TS won't load into the chart.

Sorry that's as about as specific as I can describe the problem without showing you directly.
It's a bit of a nuisance as I generally leave the SPA3 Investor button depressed so it loads automatically to identify Investor stocks when I encounter them in scans, but this crashes the chart with my favourite Overlay set ups as the selected indicator set, but I can live with it if not fixable.

I've done some testing tonight by putting about 5 custom indicators and the custom ATRTS saved to an Overlay key without problems. And it doesn't appear to be anything to do with the alert signals I have written for the problematic Overlay key, as without the alerts in the chart the problem exists, so baffled as to the underlying cause, but it does seem to have something to do with the custom ATRTS. Post edit:
Could it be a memory write issue given all the PREV's in the formula conflicting with the system ATR_TS memory writes?
Also what line of code could replace the PREV to avoid it altogether?




« Last Edit: 18/01/2020, 06:18:01 PM by JohnR »

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 249
Re: Help with BCFL custom Scans & Coding
« Reply #128 on: 20/01/2020, 03:33:35 PM »
Understood about the ROC % comparison, I'm still trying to solve a formula to get a normalised syncing of Sector and stock/s let alone to a specific date period. You mention a number of times "previous post" are you indicating there is something I have overlooked? maybe in Reply #122?

http://www.sharewealthsystems.com/forum/index.php/topic,3526.msg16170.html#msg16170 In this post. The link I have dropped has the formula inside of it, surrounded by a discussion if it is possible or not in BCFL and what issues may arise.

There are limits to BCFL being a vector language, if you do need loops - you may wish to use something more powerful such as Amnibroker.

Quote
- Whilst on ROC, I have noticed some trades in the SPA3 Portfolio - Risk Profile 1, that the ROC 126% is bellow zero and the RSC for sector is below the 30 signal line. ORA and GGG being the stocks, I was thinking the ROC and RSC were a qualifying factor for stock selection being positive?

SPA3 Trader uses only the RSC as a filter for entry signals, the stock does have to be outperforming the market index. If it dips below while in trade we do not use that as an exit signal.

Quote
Re the column Chooser fields;  sorry I did mean the Column Chooser fields () that can be called in BCFL under ShowCol() I was wondering how to call them into the formula much like a FMLVAR(). Wanting to assess Market Turnover as a ratio of Market Cap for a scan column. I don't quite understand Fundamental data being prohibited in BCFL.

We do not have fundamental data within BCFL because the data format in from the ASX is static. Ie. the same value for the most recent bar would have to be applied for all previous bars. It is not something we are hard & fast about, but it has been left to be looked in to for later down the track while this is the case.

Quote
The problem is not so much the system ATR_TS when loaded onto a clean chart, and the custom ATRTS is loaded in, they works fine together.

But more when the ATRTS is saved to a function key from the right hand Overlay panel, when dragged onto the chart it corrupts the chart.

It appears the stand alone Overlay of custom ATRTS works with system ATR_TS, but it is when a combination of other formulas saved in the Overlay panel the corruption occurs.

If the chart is already loaded with the Overlay panel indicators in the chart without the system ATR_TS loaded, and then the SPA3 Investor button is selected the system ATR_TS won't load into the chart.

Sorry that's as about as specific as I can describe the problem without showing you directly.

It's a bit of a nuisance as I generally leave the SPA3 Investor button depressed so it loads automatically to identify Investor stocks when I encounter them in scans, but this crashes the chart with my favourite Overlay set ups as the selected indicator set, but I can live with it if not fixable.


I've done some testing tonight by putting about 5 custom indicators and the custom ATRTS saved to an Overlay key without problems. And it doesn't appear to be anything to do with the alert signals I have written for the problematic Overlay key, as without the alerts in the chart the problem exists, so baffled as to the underlying cause, but it does seem to have something to do with the custom ATRTS. Post edit:
Could it be a memory write issue given all the PREV's in the formula conflicting with the system ATR_TS memory writes?
Also what line of code could replace the PREV to avoid it altogether?

Overlays recall what is on top of a chart that is generic and able to be placed on top of other data (think BCFL or built in indicators). If you can drag on the ATR_TS that uses PREV from the left hand side BCFL Library on to a blank chart, this formula in particular should not be a problem. There is a lot to follow here though and sending in a copy of your database backup to support@sharewealthsystems.com with the overlay explicitly mentioned may be better so we can take a look at what is going on.

To send your database to us, please follow these instructions after ensuring SPA TradeMaster is closed:

1. In the Application menu to the left of the HOME tab, click BACKUP / RESTORE.
2. Change the BACKUP selection to CUSTOM, then browse (on right) and select your desktop, OK and OK again.
3. When the screen disappears, go back into BACKUP / RESTORE and change the selection back to DEFAULT then click OK.
4. Now, send the backup.zip file that is now on your desktop back to us as an email attachment.

PREV is in built and can not be written over. It is provided as a rudamentary way of looping in BCFL. It is a function in the language BCFL is coded with, not BCFL in of itself.

By the way - when a corruption does occur and you test it. Just make sure you close the chart and open it blank again to or the corruption can persist and the underlying issue can be murkied.

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #129 on: 04/02/2020, 12:30:41 AM »
SPA3 Trader New Entries scans have Market & Sector Risk columns. Went looking for the this in the column chooser to add to my own scans but due to this critical information missing outside locked System scans I can't include any risk assessment in scans? Also want to add these two columns to my holdings portfolio data sheet, but no listing for them, Or also want this information displayed in Trade Master >Open Trades Current >Trade Details, or >Open Trades Snapshot.

I might add; the System Risk assessment scan and display the indicator needs to be also run on the S&P's index group especially "All Australian 200 ($XAT.ASX) etc 20,50,100,200,300 500".

Hope the above will be addressed in next SW iteration. I mean this TradeMaster integration into BC your dev's are doing will address the Risk database relationships to TM?
As I understand the software system is 'chart based' it would be nice to have an overlay of Market and Sector Risk on the charts? as you flip through the New Entry charts and other scans etc.
« Last Edit: 04/02/2020, 12:39:07 AM by JohnR »

Offline JohnR

  • Jr. Member
  • **
  • Posts: 89
Re: Help with BCFL custom Scans & Coding
« Reply #130 on: 15/07/2020, 03:35:03 PM »
Hi,
Just doing an exploration of the ATRVE indicator, and as I have noticed a nice correlation of the DMI Minus with the ATRVE, and that the ATRVE could possible make for a better Directional Movement Index. So are wondering if it possible to invert the ATRVE to gain an inverse or 'Positve' version of standard ATRVE?

I say inverting but not necessarily mirroring of it, as there needs to be HHV for the positive and LLV for the standard ATRVE.

Have tried a few variations but nothing really works, the best I can get is this code:
ATRVE_M := (MOV(ATR(1), 15 , E)*close)*1000; But the indexes are quite different so don't overlay each other like the DMI indicator's MDI and PDI.

Given that the code for the ATRVE is as follows, what would be the procedure for getting a positive version of it?
ATRVE_M := (MOV(ATR(1), 15 , E)/CLOSE)*100;

Offline Campbell Sinclair

  • Support & Administration
  • Administrator
  • *****
  • Posts: 249
Re: Help with BCFL custom Scans & Coding
« Reply #131 on: 16/07/2020, 12:22:36 PM »
Hi John,

Not really following sorry what exactly you are trying to accomplish. The numbers you are using in the formula should generally be positive since ATRVE is a rate of volatility. It reverts to a small number when the volatility is low, but the volatility can never be negative.

Usally it oscillates within a range, just the same as the DMI.

Is there a given calculation of how you want your indicator to work, based on the price action, that may help you as a guide to build what you are after?