Getting absolute time and date of bar in API?

How to create strategies and indicators
Message
Author
andygreenhk
Posts: 4
Joined: Sat Jan 27, 2007 5:09 am
Location: Hong Kong

Getting absolute time and date of bar in API?

#1 Postby andygreenhk » Sat Jan 27, 2007 5:18 am

I have been evaluating Forextester using Delphi Explorer, it looks good and if I can code my systems in it then I will buy it. I use some indicators and startegies that use the time of trading day and the day of the week within their assessment, can I get the absolute time and date for the current bar from the indicator and strategy API?

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: Getting absolute time and date of bar in API?

#2 Postby Terranin » Sat Jan 27, 2007 10:04 am

andygreenhk wrote:I have been evaluating Forextester using Delphi Explorer, it looks good and if I can code my systems in it then I will buy it. I use some indicators and startegies that use the time of trading day and the day of the week within their assessment, can I get the absolute time and date for the current bar from the indicator and strategy API?


Sure you can do this, if you know the number of bar. For this purpose there is Time() array so to get bar time you can call tm := Time(number);
This is default timeframe for indicators and strategies (after SetCurrencyAndTimeframe). You can access another timeframe and currency with tm := iTime('USDJPY', PERIOD_M15, 10); for example.
Hasta la vista
Mike

johntester
Posts: 17
Joined: Sun Sep 14, 2008 9:17 am

#3 Postby johntester » Wed Sep 24, 2008 11:32 am

Dear Mike,

I want to build an indicator which would change the background color of the chart when entering into another trading session eg for Japanese white, for london red and for us blue color.

it will help me a lot in backtesting.

Also can you please enlighten me on different time zones?

I have four clocks on my desktop set to

1- GMT (Monrovia, Reykjavik); matches the time in my gft forex dealbook.
2- GMT (Greenwich mean time; Dublin, Edinburgh)
3- (GMT-5:00) Eastern time: US and Canada
4- (GMT+5:00) Islamabad, Pakistan

My question is:
1- Which version of GMT is the right one 1 or 2? because there are numerous versions of it. i have to pick a standard in order to calculate other timezones.
2- Is GMT-5:00 the only correct Eastern time of US or are there any other versions as well? and if so which is the right one to know whether US session has started or not?

My questions are overwhelming; i know.

but i can't help it; you are too intelligent and i want to learn.

thanks in advance.
Sheraz

johntester
Posts: 17
Joined: Sun Sep 14, 2008 9:17 am

#4 Postby johntester » Thu Sep 25, 2008 2:24 pm

Dear Mike,

I have cleared up my confusion regarding time zones.

What i need from you to assist me how to develop an indicator, indicating trading sessions on a chart(us session, japanese session, london session etc) during test mode.

thanks in advance.

Sheraz

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#5 Postby Terranin » Thu Sep 25, 2008 2:36 pm

johntester wrote:Dear Mike,

I have cleared up my confusion regarding time zones.

What i need from you to assist me how to develop an indicator, indicating trading sessions on a chart(us session, japanese session, london session etc) during test mode.

thanks in advance.

Sheraz


Sorry for delay, we provide data with Central European Time that is GMT + 1 (+2 summer time). What kind of assistance do you need?
Hasta la vista

Mike

johntester
Posts: 17
Joined: Sun Sep 14, 2008 9:17 am

#6 Postby johntester » Fri Sep 26, 2008 5:10 am

In simpler words,

I want a certain time interval in a chart to look different from other intervals eg the asian trading session (0:00 to 9:00; GMT time) to look different from London session (0800 to 1500; GMT time).

I want to program an indicator that would highlight the sessions opening and closing (whether by painting arrows, labels or colors).

waiting for reply.

thanks in advance.

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#7 Postby Terranin » Fri Sep 26, 2008 9:14 am

johntester wrote:In simpler words,

I want a certain time interval in a chart to look different from other intervals eg the asian trading session (0:00 to 9:00; GMT time) to look different from London session (0800 to 1500; GMT time).

I want to program an indicator that would highlight the sessions opening and closing (whether by painting arrows, labels or colors).

waiting for reply.

thanks in advance.


You can make it in a form of oscillator, where have 3 buffers (one buffer for every session) in different colors. Buffers' style should be ds_Histogram. Fixed values range for example 0..1, when you have asian session set buffer 0 to 1, and other buffers to 0. When you have european session set buffer 1 to 1 and other buffers to 0, and so on.
Hasta la vista

Mike

johntester
Posts: 17
Joined: Sun Sep 14, 2008 9:17 am

#8 Postby johntester » Fri Sep 26, 2008 6:51 pm

that would be great too.

although i'd like simple arrows or text labels on the chart, painted at the right time.

Could you please show me how to paint arrow/text labels on a chart. ie how do i program it.

some code will be great.

thanks in advance.

FinGeR
Posts: 72
Joined: Wed Apr 23, 2008 12:24 pm

#9 Postby FinGeR » Sat Sep 27, 2008 3:29 am

Use the examples (C++ / Delphi)

look
Attachments
capture145.gif
capture145.gif (60.77 KiB) Viewed 15644 times
capture144.gif
capture144.gif (7.06 KiB) Viewed 15644 times


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 12 guests