Intraday indicator using daily ans weekly datas
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Intraday indicator using daily ans weekly datas
Hi, is it possible to create an intraday indicator using daily and weekly data in order to use this one in an scanner.
Nuno
Nuno
- Stan Bokov
- Posts: 963
- Joined: 18 Dec 2009
- Has thanked: 367 times
- Been thanked: 302 times
Re: Intraday indicator using daily ans weekly datas
Dear Nuno,
Indicators that use data2, data3 and so on cannot be used in the Scanner.
Indicators that use data2, data3 and so on cannot be used in the Scanner.
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Re: Intraday indicator using daily ans weekly datas
Stan
is there another solution to monitor a list of stocks (using multiple time frame, without plotting the chart of each stock?
Nuno
is there another solution to monitor a list of stocks (using multiple time frame, without plotting the chart of each stock?
Nuno
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Re: Intraday indicator using daily ans weekly datas
Hi
i recreate the indicator using CloseD (in order to use this one in an intraday scanner)
So, when i plot this one near the first indicator, i don't have the same result.
what is it wrong?
thank you
i recreate the indicator using CloseD (in order to use this one in an intraday scanner)
So, when i plot this one near the first indicator, i don't have the same result.
what is it wrong?
thank you
- Attachments
-
- THE INDICATOR I RECREATE.txt
- (772 Bytes) Downloaded 358 times
-
- THE INDICATOR 1.txt
- (885 Bytes) Downloaded 349 times
-
- CHART.png
- (118.72 KiB) Downloaded 1561 times
Re: Intraday indicator using daily ans weekly datas
You are using 2 different functions.
1.xAverage is calling itself as a series which does work with CloseD(0) //it needs number OR series but it uses only the number part of the series
2.Highest is calling Extremes which needs series to work with. You are giving him a number with CloseD(0) and NOT a series.
Just try this code as a simple example
function:
indicator
result
the Plot2 shows the price of today's close and Plot 1 the price of the close 5 days ago.
I bet you can find out for yourself how to advance from here
EDIT 10:32 The simplest and easiest way to go from here is to write your own "_fHighestD" function which includes a loop.
1.xAverage is calling itself as a series which does work with CloseD(0) //it needs number OR series but it uses only the number part of the series
2.Highest is calling Extremes which needs series to work with. You are giving him a number with CloseD(0) and NOT a series.
Just try this code as a simple example
function:
Code: Select all
inputs:
PriceValue(numericseries);
_fTest = PriceValue[5] ;
Code: Select all
Plot1(_fTest(c));
Plot2(_fTest(CloseD(0)));
the Plot2 shows the price of today's close and Plot 1 the price of the close 5 days ago.
I bet you can find out for yourself how to advance from here
EDIT 10:32 The simplest and easiest way to go from here is to write your own "_fHighestD" function which includes a loop.
Last edited by siscop on 06 May 2011, edited 1 time in total.
Re: Intraday indicator using daily ans weekly datas
Function
_fHighestD
_fLowestD
Indicator
_iTest2
Just tested it and it works.
_fHighestD
Code: Select all
inputs:
Len(numericsimple);
variables:
var0(0);
var0=HighD(0);
for Value1 = 1 to Len - 1
begin
if HighD(Value1)>var0 then
var0=HighD(Value1);
end ;
_fHighestD=var0;
Code: Select all
inputs:
Len(numericsimple);
variables:
var0(0);
var0=LowD(0);
for Value1 = 1 to Len - 1
begin
if LowD(Value1)<var0 then
var0=LowD(Value1);
end ;
_fLowestD=var0;
_iTest2
Code: Select all
Inputs:
Length1(10), Length2(5), Length3(5), UpColor(Green), DnColor(Red), AlertLevel(40);
Var:
Day.HH(0), Day.LL(0), Day.SMI(0);
Day.HH = _fHighestD(Length1);
Day.LL = _fLowestD(Length1);
Day.SMI = 100 * (XAverage(XAverage(CloseD(0)-(0.5*(Day.HH+Day.LL)),Length2),Length3) / (0.5 * XAverage(XAverage(Day.HH-Day.LL,Length2),Length3)));
Plot1(Day.SMI, "Day.SMI" );
Plot2(AlertLevel, "Sell Line" );
Plot3(-AlertLevel, "Buy Line" );
If Day.SMI> Day.SMI[1] then
begin
Plot1[1](Day.SMI[1], "Day.SMI", Upcolor);
Plot1(Day.SMI, "Day.SMI", Upcolor);
end
else begin
Plot1[1](Day.SMI[1], "Day.SMI", Dncolor);
Plot1(Day.SMI, "Day.SMI", Dncolor);
end;
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Re: Intraday indicator using daily ans weekly datas
siscop
that 's great!!!
Thank you very much for your help
Nuno
that 's great!!!
Thank you very much for your help
Nuno
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Re: Intraday indicator using daily ans weekly datas
siscop
i tested the indicator in a daily chart and it's ok
But when i insert this indicator in an intraday chart, i don't have the same result.
Is it normal ?
Nuno
i tested the indicator in a daily chart and it's ok
But when i insert this indicator in an intraday chart, i don't have the same result.
Is it normal ?
Nuno
Re: Intraday indicator using daily ans weekly datas
you are right there is an error based on "XAverage" when I go intraday. I just changed the second function and it worked on the daychart but going to intraday the XAverage has to be changed as well.
I will work on it ASAP.
I will work on it ASAP.
Re: Intraday indicator using daily ans weekly datas
First I have rewritten the CloseD data to arrays.
The problem I have is that there are more bars in intraday then on the series you want the function to calculate on and xAverage is not just calculating the last 10 bars with a Length of 10. It is depending on the last calculated bars. I rewrote the xAverage to depend alone on the data series entered and not on the number of bars but because of that it needs series as input now and the way your code is you are giving him again a number (Day.HH which is based on Highest – a number) and not a series.
First I have thought it should be easy coding that. Now I have changed all the functions and after that I will have to change the entire code itself.
I am sorry because of the follow-ups it takes more time then I wanted to spend on it.
If someone else want to give it a try - just go ahead.
The problem I have is that there are more bars in intraday then on the series you want the function to calculate on and xAverage is not just calculating the last 10 bars with a Length of 10. It is depending on the last calculated bars. I rewrote the xAverage to depend alone on the data series entered and not on the number of bars but because of that it needs series as input now and the way your code is you are giving him again a number (Day.HH which is based on Highest – a number) and not a series.
First I have thought it should be easy coding that. Now I have changed all the functions and after that I will have to change the entire code itself.
I am sorry because of the follow-ups it takes more time then I wanted to spend on it.
If someone else want to give it a try - just go ahead.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Intraday indicator using daily ans weekly datas
XAverage uses a short cut, it is like a FC, which does not work well in a function.
Try a plain Average, the result might be more satisfactory.
Try a plain Average, the result might be more satisfactory.
Re: Intraday indicator using daily ans weekly datas
xAverage is the EMA. The normal Average is the SMA so a total different indicator.
The shortcut you mentioned is necessary for the normal calculation of the EMA. However I have rewritten the EMA to sync up to the same result as the normal EMA but requests at least 3x Length data to be dependable to the series and not to the bar calling it from.
Since you need a series to calculate the new EMA we have to rewrite the other parameters to arrays and that is just the first step.
If anyone has another idea how to do this without changing everything in the code …. Just go ahead. I am willing to learn.
The shortcut you mentioned is necessary for the normal calculation of the EMA. However I have rewritten the EMA to sync up to the same result as the normal EMA but requests at least 3x Length data to be dependable to the series and not to the bar calling it from.
Since you need a series to calculate the new EMA we have to rewrite the other parameters to arrays and that is just the first step.
If anyone has another idea how to do this without changing everything in the code …. Just go ahead. I am willing to learn.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Intraday indicator using daily ans weekly datas
try thisxAverage is the EMA. The normal Average is the SMA so a total different indicator.
The shortcut you mentioned is necessary for the normal calculation of the EMA. However I have rewritten the EMA to sync up to the same result as the normal EMA but requests at least 3x Length data to be dependable to the series and not to the bar calling it from.
Since you need a series to calculate the new EMA we have to rewrite the other parameters to arrays and that is just the first step.
If anyone has another idea how to do this without changing everything in the code …. Just go ahead. I am willing to learn.
XAverage.V by Bob Fulks
http://tradersxchange.com/viewtopic.php ... 9ce0104db9
This is a recoding of the XAverage function as a
"simple function" rather than as a "series function".
For correct results it must be evaluated on every bar, as is
normal for every simple functions.
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Re: Intraday indicator using daily ans weekly datas
Siscop and TJ,
thank you for your help
I m reading yours posts and i 'm sorry but i don't see what is the problem with the Xaverage
We use the CloseD(0) in this line
Day.SMI = 100 * (XAverage(XAverage(CloseD(0)-(0.5*(Day.HH+Day.LL)),Length2),Length3) / (0.5 * XAverage(XAverage(Day.HH-Day.LL,Length2),Length3)));
Is there another way to scan a list of stocks in intraday once the daily and weekly setups are ok?
Nuno
thank you for your help
I m reading yours posts and i 'm sorry but i don't see what is the problem with the Xaverage
We use the CloseD(0) in this line
Day.SMI = 100 * (XAverage(XAverage(CloseD(0)-(0.5*(Day.HH+Day.LL)),Length2),Length3) / (0.5 * XAverage(XAverage(Day.HH-Day.LL,Length2),Length3)));
Is there another way to scan a list of stocks in intraday once the daily and weekly setups are ok?
Nuno
-
- Posts: 174
- Joined: 31 Jan 2006
- Has thanked: 74 times
- Been thanked: 5 times
Re: Intraday indicator using daily ans weekly datas
for example , is it possible (using ADE (All Data Everywhere)) to transfer the indicator information from a daily chart to a scanner with intraday resolution?
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Intraday indicator using daily ans weekly datas
Why do you need to find another way? if you think there is no problem with xaverage... then why not use the method that works for you? Maybe I don't understand your intention, or the result you desired.Siscop and TJ,
thank you for your help
I m reading yours posts and i 'm sorry but i don't see what is the problem with the Xaverage
We use the CloseD(0) in this line
Day.SMI = 100 * (XAverage(XAverage(CloseD(0)-(0.5*(Day.HH+Day.LL)),Length2),Length3) / (0.5 * XAverage(XAverage(Day.HH-Day.LL,Length2),Length3)));
Is there another way to scan a list of stocks in intraday once the daily and weekly setups are ok?
Nuno
Re: Intraday indicator using daily ans weekly datas
Lets make it simple
The first part of the code puts CloseD to an array. The second part a normal SMA based on the Close of each day is calculated.
The normal SMA and my Indi have the same date when calculated on Timeframe D1.
It shouldn’t make a different when I base the SMA on D1 and my Indi on H1 (since his entry is based on CloseD from the code), but it does.
See screenshot.
My code is as simple as it gets but it doesnt work.
Anyone an idea?
Code: Select all
Inputs:
Len(10);
Var:
Indi(0),
var0(0);
Array:
OpenDtmp[110](0),
HighDtmp[110](0),
LowDtmp[110](0),
CloseDtmp[110](0);
for var0=0 to 90
begin
OpenDtmp[var0]=OpenD(var0);
HighDtmp[var0]=HighD(var0);
LowDtmp[var0]=LowD(var0);
CloseDtmp[var0]=CloseD(var0);
end;
Indi=Average(CloseDtmp[0],Len);
Plot1(Indi);
The normal SMA and my Indi have the same date when calculated on Timeframe D1.
It shouldn’t make a different when I base the SMA on D1 and my Indi on H1 (since his entry is based on CloseD from the code), but it does.
See screenshot.
My code is as simple as it gets but it doesnt work.
Anyone an idea?
- Attachments
-
- Indi.png
- (80.17 KiB) Downloaded 1551 times
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Intraday indicator using daily ans weekly datas
Saying "it doesnt work" tells me nothing.Lets make it simpleThe first part of the code puts CloseD to an array. The second part a normal SMA based on the Close of each day is calculated.Code: Select all
Inputs:
Len(10);
Var:
Indi(0),
var0(0);
Array:
OpenDtmp[110](0),
HighDtmp[110](0),
LowDtmp[110](0),
CloseDtmp[110](0);
for var0=0 to 90
begin
OpenDtmp[var0]=OpenD(var0);
HighDtmp[var0]=HighD(var0);
LowDtmp[var0]=LowD(var0);
CloseDtmp[var0]=CloseD(var0);
end;
Indi=Average(CloseDtmp[0],Len);
Plot1(Indi);
The normal SMA and my Indi have the same date when calculated on Timeframe D1.
It shouldn’t make a different when I base the SMA on D1 and my Indi on H1 (since his entry is based on CloseD from the code), but it does.
See screenshot.
My code is as simple as it gets but it doesnt work.
Anyone an idea?
You have to explicitly explain and point out what doesn't work. Where and what are the discrepancies you are looking at?
Re: Intraday indicator using daily ans weekly datas
Well I thought that looking at the attached screenshot would explain it.
“MovAve Line1” is based on D1 Len=10
_Test3 is based on H1 Len=10 however it is coded that from CloseD so it shouldn’t matter on what the indicator base TF is since it should always take the CloseD = D1.
Looking at the screenshot you see that MovAveLine1 is NOT the same as _Test3.
When I put both indicator (MovAveLine1 and _Test3) on D1 both indicator have the same value. So what is wrong with the code that it doesn’t work when I put the indicator on H1? It should still show the Average from D1 but it doesn`t.
“MovAve Line1” is based on D1 Len=10
_Test3 is based on H1 Len=10 however it is coded that from CloseD so it shouldn’t matter on what the indicator base TF is since it should always take the CloseD = D1.
Looking at the screenshot you see that MovAveLine1 is NOT the same as _Test3.
When I put both indicator (MovAveLine1 and _Test3) on D1 both indicator have the same value. So what is wrong with the code that it doesn’t work when I put the indicator on H1? It should still show the Average from D1 but it doesn`t.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Intraday indicator using daily ans weekly datas
What are the values for a H1 chart:Well I thought that looking at the attached screenshot would explain it.
“MovAve Line1” is based on D1 Len=10
_Test3 is based on H1 Len=10 however it is coded that from CloseD so it shouldn’t matter on what the indicator base TF is since it should always take the CloseD = D1.
Looking at the screenshot you see that MovAveLine1 is NOT the same as _Test3.
When I put both indicator (MovAveLine1 and _Test3) on D1 both indicator have the same value. So what is wrong with the code that it doesn’t work when I put the indicator on H1? It should still show the Average from D1 but it doesn`t.
1. in real time at 11 am, what is the value of CloseD(0)?
2. if you start the chart at the end of the day, what value do you see for CloseD(0) for 11 am?