Hi,
how do I get the (closing)price at a specific time (same day/session) in order to use this price for further calculations, e.g. price at 12:35 times xy...
Would I have to use a time frame which is maximum 5 minutes or
can I use 60minutes bars with the Intrabar function?
Thank you very much. Regards
price at specific time
-
- Posts: 49
- Joined: 26 Dec 2009
- Has thanked: 34 times
- Been thanked: 1 time
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1034 times
- Been thanked: 2228 times
Re: price at specific time
do you want the closing price of a specific bar?Hi,
how do I get the (closing)price at a specific time (same day/session) in order to use this price for further calculations, e.g. price at 12:35 times xy...
Would I have to use a time frame which is maximum 5 minutes or
can I use 60minutes bars with the Intrabar function?
Thank you very much. Regards
or the price at a specific time?
for the price at a specific time,
you can use the keyword currenttime.
and you can use this keyword in any chart resolution (minute+).
for sub-minute charts, you can use the keyword currenttime_s.
e.g.
Code: Select all
input:
specific.time(1235);
var:
specific.price(0);
if currenttime = specific.time
then specific.price = close;
note: this code is not useful for backtesting purposes.
-
- Posts: 49
- Joined: 26 Dec 2009
- Has thanked: 34 times
- Been thanked: 1 time
Re: price at specific time
Dear TJ,
thank you very much for your help.
In order to backtest I'd need the closing price of a specific bar.
Actually, I need for further calculations the closing price of 8 p.m. of 1 minute data.
Do you know a solution?
Many thanks in advance, Best Regards
thank you very much for your help.
In order to backtest I'd need the closing price of a specific bar.
Actually, I need for further calculations the closing price of 8 p.m. of 1 minute data.
Do you know a solution?
Many thanks in advance, Best Regards
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1034 times
- Been thanked: 2228 times
Re: price at specific time
MultiCharts uses EOB (End Of Bar) as time reference.Dear TJ,
thank you very much for your help.
In order to backtest I'd need the closing price of a specific bar.
Actually, I need for further calculations the closing price of 8 p.m. of 1 minute data.
Do you know a solution?
Many thanks in advance, Best Regards
ie. for a 1 min chart,
the bar time 2000 (8:00pm) covers the time from 07:59:01pm to 08:00:00pm inclusive. (hh:mm:ss)
try this:
Code: Select all
input:
specific.time(2000);
var:
specific.price(0);
if time = specific.time
then specific.price = close;
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: price at specific time
Why don't you just say ...
At this point, you could refer to whatever the value of the variable "TimeValue" is?
Code: Select all
Inputs: TimeToCatch(2000);
Vars: TimeValue(0);
If Time = TimeToCatch Then TimeValue = Close;
-
- Posts: 49
- Joined: 26 Dec 2009
- Has thanked: 34 times
- Been thanked: 1 time