Hi:
I need help with this:
I am using 5min intra data; want to calculate val22 below;
Close is the close of this bar;
Lowest(close, daynum) is the lowest DAILY close, same logic for Highest
but these functions return the lowest and highest over intra bars, NOt daily bars
how can I get lowest and highest daily closes ?
Val22 = ( ( Close - Lowest(Close, daynum) )/
(Highest(Close, daynum) - Lowest(Close, daynum) ) )
thanks
Deo
Highest and Lowest daily values
Highest and lowest daily values
deobisnath, what you are describing can be achieved in a number of ways by writing an indicator but this lies in the sphere of custom programming and is done for a fee.
Since my programming skills are rather limited, I always have to find workaround for things like that. What I would do, which is most likely not the most efficient way, is as follow:
Add a daily chart as well of the same symbol to your workspace so that you have a 5 minute and daily chart. If you don't care to see the daily chart, make the bars invisible.
Then change your code as follows:
Val22 = ( ( Close - Lowest(Close of data2, daynum) )/
(Highest(Close of data2, daynum) - Lowest(Close of data2, daynum) ) );
Make sure 5 minute chart is data1 and your daily chart is data2.
I am sure there are better ways of doing this though.
Regards
- Fanus
Add a daily chart as well of the same symbol to your workspace so that you have a 5 minute and daily chart. If you don't care to see the daily chart, make the bars invisible.
Then change your code as follows:
Val22 = ( ( Close - Lowest(Close of data2, daynum) )/
(Highest(Close of data2, daynum) - Lowest(Close of data2, daynum) ) );
Make sure 5 minute chart is data1 and your daily chart is data2.
I am sure there are better ways of doing this though.
Regards
- Fanus
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Deo,
a simple way would just be to track the highest/lowest close as the day progresses and store the values inside a variable.
Now you can use the two variables for your calculations.
Best regards,
ABC
a simple way would just be to track the highest/lowest close as the day progresses and store the values inside a variable.
Code: Select all
Variables:
HiClose(-999999),
LoClose(+999999);
If Date <> Date[1] then begin {reset the variables on date change}
HiClose = -999999;
LoClose = +999999;
end;
If BarStatus(1) = 2 then begin {to ensure you only get the close of the bar}
If Close > HiClose then HiClose = Close;
If Close < LoClose then LoClose = Close;
end;
Best regards,
ABC
Hi ABCDeo,
a simple way would just be to track the highest/lowest close as the day progresses and store the values inside a variable.
Now you can use the two variables for your calculations.Code: Select all
Variables:
HiClose(-999999),
LoClose(+999999);
If Date <> Date[1] then begin {reset the variables on date change}
HiClose = -999999;
LoClose = +999999;
end;
If BarStatus(1) = 2 then begin {to ensure you only get the close of the bar}
If Close > HiClose then HiClose = Close;
If Close < LoClose then LoClose = Close;
end;
Best regards,
ABC
I could be wrong, but the example you provided will keep track of the intraday high/low, but from what I understood, Deo want to keep track of the High/Low of the last N days and reference them in the intraday chart..
Regards
- Fanus
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
-
- Posts: 40
- Joined: 17 Jul 2007
Re: Highest and lowest daily values
Can you refer me to these custom programmers? I am interested in hiring one to write a few functions that were written in C++ for Linux platform (g++)deobisnath, what you are describing can be achieved in a number of ways by writing an indicator but this lies in the sphere of custom programming and is done for a fee.
Thanks
-
- Posts: 40
- Joined: 17 Jul 2007
Function for Highest/Lowest - does this look ok?
I coded a function to do return the highest daily close; your comments? suggestions etc
Inputs: numberdays(numericsimple) ;
Variables: highval(-1);
For value1 = 1 To numberdays
Begin
If HighD(value1) > highval Then
highval = HighD(value1);
End;
HighestD = highval;
Inputs: numberdays(numericsimple) ;
Variables: highval(-1);
For value1 = 1 To numberdays
Begin
If HighD(value1) > highval Then
highval = HighD(value1);
End;
HighestD = highval;