StockFetcher Forums · General Discussion · Need help for this filter. please<< 1 2 >>Post Follow-up
pa247
143 posts
msg #147859
Ignore pa247
5/21/2019 6:11:57 PM

ive been working on this filter for 2 days and its not going the way I expected. I dont know where ive gone wrong in the formula so could someone please look and see where ive messed it up? The TMF variable is coming out to .01 or .010 on every stock which is not correct. Thank you!


Fetcher[
market is nasdaq
market is not etf
close > 5
Volume > 12345678
optionable

/* Calculate Highest High (HH) and Lowest Low (LL)
LL = minimum(current low or previous close)
HH = maximum(current High or previous close) */

set{LL, min(low, close)}
set{HH, max(high, close)}


/* calculate Range = (Close - LL) / (HH - LL) * 2 - 1 ) */
set{R1, Close - LL}
set{R2, HH - LL}
set{R3, R1 / R2}
set{R4, R3 * 2}
set{R5, R4 - 1} /* R5 = Range */


/* Calculate Range Volume
RangeV = EMA (Volume * Range) */

set{range1, volume * R5}
set{rangeV, EMA(range1)}


/* Calculate TMF = RangeV / EMA(Volume) * 100 */
set{tmf1, EMA(volume)}
set{tmf2, tmf1 * 100}
set{tmf, rangeV / tmf2}
add column tmf
draw tmf

/* (Apply EMA to TMF as second signal line) TMF Signal Line = EMA(TMF) */
set{tmfsignal, EMA(tmf)}
add column tmfsignal

draw tmfsignal on plot tmf
draw line 0 on plot tmf
]



graftonian
1,089 posts
msg #147869
Ignore graftonian
5/22/2019 11:49:20 AM

your line
"set{rangeV, EMA(range1)}"
did you mean?
set{rangeV, CEMA(range1, XXX)}

xarlor
587 posts
msg #147873
Ignore xarlor
5/22/2019 4:05:33 PM

I'm not sure if this is what you were hoping for, but graft is right. For custom EMAs you need the fuction CEMA(indicator,days).

I changed 3 instances on your original filter to CEMA and did it for 30 days.

Also, your HH and LL was incorrect. You were comparing the high and low to today's close instead of the previous day's close.

Fetcher[
market is nasdaq
market is not etf
close > 5
Volume > 12345678
optionable

/* Calculate Highest High (HH) and Lowest Low (LL)
LL = minimum(current low or previous close)
HH = maximum(current High or previous close) */

set{LL, min(low, close 1 day ago)}
set{HH, max(high, close 1 day ago)}


/* calculate Range = (Close - LL) / (HH - LL) * 2 - 1 ) */
set{R1, Close - LL}
set{R2, HH - LL}
set{R3, R1 / R2}
set{R4, R3 * 2}
set{R5, R4 - 1} /* R5 = Range */



/* Calculate Range Volume
RangeV = EMA (Volume * Range) */

set{range1, volume * R5}
set{rangeV, CEMA(range1,30)}


/* Calculate TMF = RangeV / EMA(Volume) * 100 */
set{tmf1, CEMA(volume,30)}
set{tmf2, tmf1 * 100}
set{tmf, rangeV / tmf2}
add column tmf
draw tmf

/* (Apply EMA to TMF as second signal line) TMF Signal Line = EMA(TMF) */
set{tmfsignal, CEMA(tmf,30)}
add column tmfsignal

draw tmfsignal on plot tmf
draw line 0 on plot tmf
]



Cheese
1,374 posts
msg #147874
Ignore Cheese
5/22/2019 5:28:22 PM

I am not familiar with the above TMF filters, but here is the version for basic subs
Fetcher[
market is nasdaq
market is not etf
close > 5
Volume > 12345678
optionable

/* Calculate Highest High (HH) and Lowest Low (LL)
LL = minimum(current low or previous close)
HH = maximum(current High or previous close) */

set{LL, min(low, close 1 day ago)}
set{HH, max(high, close 1 day ago)}


/* calculate Range = (Close - LL) / (HH - LL) * 2 - 1 ) */
set{R1, Close - LL}
set{R2, HH - LL}
set{R3, R1 / R2}
set{R4, R3 * 2}
set{R5, R4 - 1} /* R5 = Range */



/* Calculate Range Volume
RangeV = EMA (Volume * Range) */

set{range1, volume * R5}
set{rangeV, CEMA(range1,30)}


/* Calculate TMF = RangeV / EMA(Volume) * 100 */
set{tmf1, CEMA(volume,30)}
set{tmf2, tmf1 * 100}
set{tmf, rangeV / tmf2}
add column tmf
draw CEMA(tmf,30) line at 0

/* (Apply EMA to TMF as second signal line) TMF Signal Line = EMA(TMF) */
set{tmfsignal, CEMA(tmf,30)}
add column tmfsignal
/*
draw tmfsignal on plot tmf
draw line 0 on plot tmf
*/
]





Cheese
1,374 posts
msg #147875
Ignore Cheese
5/22/2019 5:36:51 PM

I'm not sure why xarlor's version sometimes flashed advanced subscription requirement.

graftonian
1,089 posts
msg #147888
Ignore graftonian
5/23/2019 12:07:20 PM

I took the liberty of re-writing one section.

/* Calculate TMF = RangeV / EMA(Volume) * 100 */
set{tmf1, CEMA(volume,30)}
set{tmf2, rangeV - tmf1}
set{tmf3, rangeV / tmf2}
set{tmf, tmf3 * 100}
add column tmf
draw tmf

Is this consistant with your original logic?


pa247
143 posts
msg #147898
Ignore pa247
5/23/2019 3:51:35 PM

Thank you all for help!!

@xarlor .... I see where you made the change on this part but. What im trying to formulate is .... the lowest low from either yesterdays close or todays low. And the highest high from either yesterdays close or todays high. Is that what your formula shows but in less steps than mine?

from xarlor .......
set{LL, min(low, close 1 day ago)}
set{HH, max(high, close 1 day ago)}

from me .....
set{LL1,low today}
set{LL2,close 1 day ago}
set{HH1,high today}
set{HH2,high 1 day ago}

pa247
143 posts
msg #147900
Ignore pa247
modified
5/23/2019 4:05:40 PM

@graftonian .... 5/23/2019 12:07:20 PM

I took the liberty of re-writing one section.

/* Calculate TMF = RangeV / EMA(Volume) * 100 */
set{tmf1, CEMA(volume,30)}
set{tmf2, rangeV - tmf1}
set{tmf3, rangeV / tmf2}
set{tmf, tmf3 * 100}
add column tmf
draw tmf

Is this consistant with your original logic?
----------------------------------------------------------------
If i substitute this for the way I had it before I get the message I need the advanced subscription. so I cant actually test if it gives the same results.

Cheese
1,374 posts
msg #147901
Ignore Cheese
5/23/2019 4:25:49 PM

pa247, here is your original TMF filter with correct cEMA syntax
Fetcher[


market is nasdaq
market is not etf
close > 5
Volume > 12345678
optionable

/* Calculate Highest High (HH) and Lowest Low (LL)
LL = minimum(current low or previous close)
HH = maximum(current High or previous close) */

set{LL, min(low, close)}
set{HH, max(high, close)}


/* calculate Range = (Close - LL) / (HH - LL) * 2 - 1 ) */
set{R1, Close - LL}
set{R2, HH - LL}
set{R3, R1 / R2}
set{R4, R3 * 2}
set{R5, R4 - 1} /* R5 = Range */


/* Calculate Range Volume
RangeV = EMA (Volume * Range) */

set{range1, volume * R5}
set{rangeV, CEMA(range1,30)}


/* Calculate TMF = RangeV / EMA(Volume) * 100 */
set{tmf1, cEMA(volume,30)}
set{tmf2, tmf1 * 100}
set{tmf, rangeV / tmf2}
add column tmf
draw CEMA(tmf,30) line at 0

/* (Apply EMA to TMF as second signal line) TMF Signal Line = EMA(TMF) */
set{tmfsignal, CEMA(tmf,30)}
add column tmfsignal
/*
draw tmfsignal on plot tmf
draw line 0 on plot tmf
*/

chart-time 6 months
]



xarlor
587 posts
msg #147917
Ignore xarlor
5/24/2019 2:17:48 PM

@xarlor .... I see where you made the change on this part but. What im trying to formulate is .... the lowest low from either yesterdays close or todays low. And the highest high from either yesterdays close or todays high. Is that what your formula shows but in less steps than mine?

from xarlor .......
set{LL, min(low, close 1 day ago)}
set{HH, max(high, close 1 day ago)}

from me .....
set{LL1,low today}
set{LL2,close 1 day ago}
set{HH1,high today}
set{HH2,high 1 day ago}

-----------------------------------------------------

pa427, mine says:

Look at today's Low
Look at yesterday's Close
Give me whichever of the two prices is the lower one

Look at today's High
look at yesterday's Close
Give me whichever of the two prices is the higher one

Your original filter said:

Look at today's Low
Look at today's Close
Give me whichever of the two prices is the lower one

Look at today's High
look at today's Close
Give me whichever of the two prices is the higher one

As for what you posted here:

set{LL1,low today}
set{LL2,close 1 day ago}
set{HH1,high today}
set{HH2,high 1 day ago}

Yes, it's essentially the same thing, only you need to then get the low and high:
set{LL, min(LL1,LL2)}
set{HH, max(HH1,HH2)}

StockFetcher Forums · General Discussion · Need help for this filter. please<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.