FXCM Forex Trading

Using Bar Source for an indicator requiring a Tick source...

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Using Bar Source for an indicator requiring a Tick source...

Postby Hellhound » Fri May 12, 2017 9:51 am

Dear administrators and friends,

Is it true that, using Bar Source for an indicator requiring a Tick source will cause the output stream to shift??

And how can we create an indicator using a tick source historical data?? The function:

host:execute ("getHistory", cookie, instrument, barSize, from, to, bidOrAsk)

barSize ==> "t1"

- If we put "t1" as argument, how the compiler knows what time frame it is using?

There's really confusion over here.... Please help
Hellhound
 
Posts: 14
Joined: Sun Mar 31, 2013 10:39 pm

Re: Using Bar Source for an indicator requiring a Tick sourc

Postby Apprentice » Mon May 29, 2017 11:28 am

If I understand you.
Your indicator will be added to the tick time frame chart.
From your indicator you will load higher time frame source.
U will have to use core.findDate to find higher time frame source index.
http://www.fxcodebase.com/documents/Ind ... dDate.html
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17168
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Using Bar Source for an indicator requiring a Tick sourc

Postby Hellhound » Wed May 31, 2017 8:42 pm

I did use the core.FindDate function to create the internal stream.

When the indicator specified at the Init() function that it requires a bar source, the program is working
perfectly; however, when the indicator specified at the Init() function that it requires a tick source, the output stream shifted 1 period, I can't remmember to the left or to the right... The only solution I can figured out is to require bar source at the Init() fuction and put in a bar source whenever I use the indicator

It seems that the core.FindDate function had find the wrong data at the correct datetime(when I used a bar source for the indicator that requires a tick source)

Thankyou for replying, probabily only the designer of TS2 can tell me what's going on. So just keep in mind of this and put in the correct source when we create indicators.
Hellhound
 
Posts: 14
Joined: Sun Mar 31, 2013 10:39 pm

Re: Using Bar Source for an indicator requiring a Tick sourc

Postby Apprentice » Mon Jul 10, 2017 4:19 pm

Can you share your code?
Maybe I can help.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 17168
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest