Hi All
I do like to get the Close of a bar from a certain time (eg. 17:30) during the last session (yesterday).
How to get this value as easy as possible?
Thank you very much for your appreciated help.
LRP
Value of a bar at a certain time from last session? [SOLVED]
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Value of a bar at a certain time from last session?
A few questions:
1. Do you only need the data from the previous session?
2. Is this a recurring request?
3. Do you need a specific time? or the time is different for every request?
4. When do you make the request?
eg at 1730 today, you want to know the close of 1730 the previous day?
1. Do you only need the data from the previous session?
2. Is this a recurring request?
3. Do you need a specific time? or the time is different for every request?
4. When do you make the request?
eg at 1730 today, you want to know the close of 1730 the previous day?
- LRP
- Posts: 153
- Joined: 07 Apr 2008
- Location: Switzerland
- Has thanked: 96 times
- Been thanked: 15 times
Re: Value of a bar at a certain time from last session?
A few questions:
1. Do you only need the data from the previous session?
2. Is this a recurring request?
3. Do you need a specific time? or the time is different for every request?
4. When do you make the request?
eg at 1730 today, you want to know the close of 1730 the previous day?
yes, it is an intraday Chart and i need everyday always that close from the previous session of the bar at 17:30 during the full current session until the end of it.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Value of a bar at a certain time from last session?
OK, this is a simple requirement.
All you need is to set up a variable,
then at 1730 every day, assign the close price to the variable.
this variable is available for you to recall at any time in the future.
eg.
All you need is to set up a variable,
then at 1730 every day, assign the close price to the variable.
this variable is available for you to recall at any time in the future.
eg.
Code: Select all
var: price.at.1730(0);
if time = 1730 then price.at.1730 = Close;
- LRP
- Posts: 153
- Joined: 07 Apr 2008
- Location: Switzerland
- Has thanked: 96 times
- Been thanked: 15 times
Re: Value of a bar at a certain time from last session?
Thanks a lot TJ, but as soon 17:30 is reached (today) I will get a new but unwanted value. Instead I do like to keep the close 17:30 value from yesterday until the end of the session. I tried a lot but can not find the solution to keep that 17:30 Close value from yesterday until the session ends today at eg. 22:00. Thank you again for your help.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Value of a bar at a certain time from last session?
What is your trading session time?Thanks a lot TJ, but as soon 17:30 is reached (today) I will get a new but unwanted value. Instead I do like to keep the close 17:30 value from yesterday until the end of the session. I tried a lot but can not find the solution to keep that 17:30 Close value from yesterday until the session ends today at eg. 22:00. Thank you again for your help.
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Value of a bar at a certain time from last session? [SOLVED]
Try this:
Code: Select all
var: price.at.1730(0), temp(0);
if time = 1730 then temp = Close;
if time = 2200 then price.at.1730 = temp;
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
Re: Value of a bar at a certain time from last session?
You are welcome.Perfect, it works! Thank you very much for your appreciated help TJ.
Kind regards, LRP
Where there is a will, there is a way.